summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index d82329d51296..7d30e026c0e5 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1354,7 +1354,17 @@ void ScCheckListMenuWindow::launch(const Rectangle& rRect)
// We need to have at least one member selected.
maBtnOk.Enable(maChecks.GetCheckedEntryCount() != 0);
- StartPopupMode(rRect, (FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_GRABFOCUS));
+ Rectangle aRect(rRect);
+ if (maWndSize.Width() < aRect.GetWidth())
+ {
+ // Target rectangle (i.e. cell width) is wider than the window.
+ // Simulate right-aligned launch by modifying the target rectangle
+ // size.
+ long nDiff = aRect.GetWidth() - maWndSize.Width();
+ aRect.Left() += nDiff;
+ }
+
+ StartPopupMode(aRect, (FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_GRABFOCUS));
}
void ScCheckListMenuWindow::close(bool bOK)