[Libreoffice-commits] core.git: sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 24 09:09:24 UTC 2021


 sfx2/source/notebookbar/NotebookbarTabControl.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 7a6c6712698efc4cdf4b941db565634aae73279c
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Feb 23 20:23:41 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Feb 24 10:08:38 2021 +0100

    use XPopupMenu::execute to run the menu
    
    instead of cheating and pulling the vcl::Menu out of it
    
    Change-Id: I498f4577c1e677e860ccb3bf394adbca298f074a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111435
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
index dd2e1fba5129..485b7f8da3a6 100644
--- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx
+++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
@@ -19,7 +19,6 @@
 
 #include <vcl/builderfactory.hxx>
 #include <vcl/layout.hxx>
-#include <vcl/menu.hxx>
 #include <vcl/notebookbar/notebookbar.hxx>
 #include <vcl/tabpage.hxx>
 #include <sfx2/viewfrm.hxx>
@@ -30,7 +29,7 @@
 #include <com/sun/star/frame/ModuleManager.hpp>
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/uno/Reference.h>
-#include <toolkit/awt/vclxmenu.hxx>
+#include <com/sun/star/awt/PopupMenuDirection.hpp>
 #include <com/sun/star/frame/XPopupMenuController.hpp>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/propertyvalue.hxx>
@@ -348,10 +347,10 @@ IMPL_LINK(NotebookbarTabControl, OpenNotebookbarPopupMenu, NotebookBar*, pNotebo
         return;
 
     xPopupController->setPopupMenu(xPopupMenu);
-    VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>(xPopupMenu);
-    PopupMenu* pVCLMenu = static_cast<PopupMenu*>(pAwtMenu->GetMenu());
     Point aPos(pNotebookbar->GetSizePixel().getWidth(), NotebookbarTabControl::GetHeaderHeight() - ICON_SIZE + 10);
-    pVCLMenu->Execute(pNotebookbar, tools::Rectangle(aPos, aPos),PopupMenuFlags::ExecuteDown|PopupMenuFlags::NoMouseUpClose);
+    xPopupMenu->execute(pNotebookbar->GetComponentInterface(),
+                        css::awt::Rectangle(aPos.X(), aPos.Y(), 1, 1),
+                        css::awt::PopupMenuDirection::EXECUTE_DOWN);
 
     Reference<css::lang::XComponent> xComponent(xPopupController, UNO_QUERY);
     if (xComponent.is())


More information about the Libreoffice-commits mailing list