diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-02 14:51:35 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-02 15:28:30 -0400 |
commit | 94fdd16062ca6fae8e18352ae0a7547e6b65fd61 (patch) | |
tree | a6bea71fb60d2445f8b41eb4b10cfa4778eb0e84 /sc | |
parent | 46aec3014b16286df97ed0c7a47f509fffb564c9 (diff) |
Launch pop-up right-aligned in case the cell is wider than the popup.
Or else the popup and the popup button would get separated.
Change-Id: I4c8dda2bf5cebe0fe0e0ce64c9c213e2926d9570
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/cctrl/checklistmenu.cxx | 12 |
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) |