From 94fdd16062ca6fae8e18352ae0a7547e6b65fd61 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 2 Nov 2012 14:51:35 -0400 Subject: 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 --- sc/source/ui/cctrl/checklistmenu.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sc/source/ui/cctrl') 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) -- cgit