reportdesign/source/ui/dlg/GroupsSorting.cxx |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 72227d7adcd05056eb6b048edc5bc56f6c29aa29
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Dec 20 20:41:26 2020 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Dec 21 09:45:50 2020 +0100

    weld reportdesign groupsortmenu menu
    
    Change-Id: I933258d60b4792f880cdd757481635f9319e73ea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108067
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx 
b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index e79e32357a8d..77adb2664252 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -37,7 +37,6 @@
 
 #include <cppuhelper/implbase.hxx>
 #include <vcl/commandevent.hxx>
-#include <vcl/menu.hxx>
 #include <vcl/svapp.hxx>
 #include <tools/diagnose_ex.h>
 
@@ -691,10 +690,13 @@ void OFieldExpressionControl::Command(const CommandEvent& 
rEvt)
                         bEnable = true;
                     nIndex = NextSelectedRow();
                 }
-                VclBuilder aBuilder(nullptr, AllSettings::GetUIRootDir(), 
"modules/dbreport/ui/groupsortmenu.ui", "");
-                VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu"));
-                aContextMenu->EnableItem(aContextMenu->GetItemId("delete"), 
IsDeleteAllowed() && bEnable);
-                if (aContextMenu->Execute(this, rEvt.GetMousePosPixel()))
+
+                ::tools::Rectangle aRect(rEvt.GetMousePosPixel(), Size(1, 1));
+                weld::Window* pPopupParent = weld::GetPopupParent(*this, 
aRect);
+                std::unique_ptr<weld::Builder> 
xBuilder(Application::CreateBuilder(pPopupParent, 
"modules/dbreport/ui/groupsortmenu.ui"));
+                std::unique_ptr<weld::Menu> 
xContextMenu(xBuilder->weld_menu("menu"));
+                xContextMenu->set_sensitive("delete", IsDeleteAllowed() && 
bEnable);
+                if (!xContextMenu->popup_at_rect(pPopupParent, 
aRect).isEmpty())
                 {
                     if( m_nDeleteEvent )
                         Application::RemoveUserEvent( m_nDeleteEvent );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to