From 5bc345a1624315c55b8ed1316d530d3943f96227 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 18 Nov 2021 12:38:32 +0000 Subject: menu placement is a little off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit its relative to the treeview, not the floating window Change-Id: I70c15231eb61d5b8da3bbf473db39489b4544f0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125473 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/ui/cctrl/checklistmenu.cxx | 5 +++++ sc/source/ui/inc/checklistmenu.hxx | 1 + sc/source/ui/view/gridwin.cxx | 3 +-- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'sc/source/ui') diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 328c51718364..7dfb572d0182 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -290,6 +290,11 @@ tools::Rectangle ScCheckListMenuControl::GetSubMenuParentRect() return mxMenu->get_row_area(*mxScratchIter); } +sal_Int32 ScCheckListMenuControl::ExecuteMenu(weld::Menu& rMenu) +{ + return rMenu.popup_at_rect(mxMenu.get(), GetSubMenuParentRect(), weld::Placement::End).toInt32(); +} + void ScCheckListMenuControl::launchSubMenu(bool bSetMenuPos) { ScCheckListMenuWindow* pSubMenu = maOpenTimer.mpSubMenu; diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx index cb78bf226a45..c9ca6466dff7 100644 --- a/sc/source/ui/inc/checklistmenu.hxx +++ b/sc/source/ui/inc/checklistmenu.hxx @@ -182,6 +182,7 @@ public: * argument for Executing a popup */ tools::Rectangle GetSubMenuParentRect(); + sal_Int32 ExecuteMenu(weld::Menu& rMenu); private: std::vector maMenuItems; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index acd2973075c1..33ea3fe045b8 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -976,8 +976,7 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode) i++; } - tools::Rectangle aRect = rControl.GetSubMenuParentRect(); - sal_Int32 nSelected = xColorMenu->popup_at_rect(pPopupParent, aRect, weld::Placement::End).toInt32(); + sal_Int32 nSelected = rControl.ExecuteMenu(*xColorMenu); xColorMenu.reset(); rControl.terminateAllPopupMenus(); -- cgit