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

New commits:
commit 7a6c6712698efc4cdf4b941db565634aae73279c
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Feb 23 20:23:41 2021 +0000
Commit:     Caolán McNamara <caol...@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 <caol...@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())
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to