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(-)

New commits:
commit 5bc345a1624315c55b8ed1316d530d3943f96227
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Nov 18 12:38:32 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Nov 18 15:11:44 2021 +0100

    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 <caol...@redhat.com>

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();
 

Reply via email to