diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-11-18 12:38:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-11-18 15:11:44 +0100 |
commit | 5bc345a1624315c55b8ed1316d530d3943f96227 (patch) | |
tree | afad9be50e53beb1e727b48594b90d874fb52d7d /sc/source/ui | |
parent | 187b28063fa9b908f5324ed345ba223d8f6168a2 (diff) |
menu placement is a little off
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 <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/cctrl/checklistmenu.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/inc/checklistmenu.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 3 |
3 files changed, 7 insertions, 2 deletions
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<MenuItemData> 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(); |