[Libreoffice-commits] core.git: reportdesign/inc reportdesign/source reportdesign/uiconfig reportdesign/UIConfig_dbreport.mk

Caolán McNamara caolanm at redhat.com
Fri Apr 14 14:58:04 UTC 2017


 reportdesign/UIConfig_dbreport.mk                  |    1 +
 reportdesign/inc/RptResId.hrc                      |    1 -
 reportdesign/source/ui/dlg/GroupsSorting.cxx       |    7 ++++---
 reportdesign/source/ui/dlg/GroupsSorting.src       |   12 ------------
 reportdesign/uiconfig/dbreport/ui/groupsortmenu.ui |   17 +++++++++++++++++
 5 files changed, 22 insertions(+), 16 deletions(-)

New commits:
commit 975440b9189602b5a10059d892cb09e6849148f7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 14 15:55:34 2017 +0100

    convert group sort context menu to .ui
    
    Change-Id: I8ad51ef49cc0f869efd09b95d3dc11f201e8ee61

diff --git a/reportdesign/UIConfig_dbreport.mk b/reportdesign/UIConfig_dbreport.mk
index 84327116ecb4..b1b8a326e2db 100644
--- a/reportdesign/UIConfig_dbreport.mk
+++ b/reportdesign/UIConfig_dbreport.mk
@@ -47,6 +47,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/dbreport,\
 	reportdesign/uiconfig/dbreport/ui/floatingfield \
 	reportdesign/uiconfig/dbreport/ui/floatingnavigator \
 	reportdesign/uiconfig/dbreport/ui/floatingsort \
+	reportdesign/uiconfig/dbreport/ui/groupsortmenu \
 	reportdesign/uiconfig/dbreport/ui/pagedialog \
 	reportdesign/uiconfig/dbreport/ui/pagenumberdialog \
 ))
diff --git a/reportdesign/inc/RptResId.hrc b/reportdesign/inc/RptResId.hrc
index a095b3b26c1a..8535390c59c2 100644
--- a/reportdesign/inc/RptResId.hrc
+++ b/reportdesign/inc/RptResId.hrc
@@ -192,7 +192,6 @@
 #define RID_STR_PARAADJUST                  (RID_STRING_START + 161)
 
 // menu -----------------------------------------------------------------------
-#define RID_GROUPSROWPOPUPMENU              ( RID_MENU_START + 0 )
 #define RID_MENU_NAVIGATOR                  ( RID_MENU_START + 1 )
 // bitmaps
 #define RID_SVXBMP_SELECT_REPORT            (RID_BITMAP_START + 0 )
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index 6bb15689d36c..d60b07c557e8 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -709,7 +709,6 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt)
 
             if ( nColId == HANDLE_ID )
             {
-                ScopedVclPtrInstance<PopupMenu> aContextMenu(ModuleRes(RID_GROUPSROWPOPUPMENU));
                 bool bEnable = false;
                 long nIndex = FirstSelectedRow();
                 while( nIndex >= 0 && !bEnable )
@@ -718,8 +717,10 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt)
                         bEnable = true;
                     nIndex = NextSelectedRow();
                 }
-                aContextMenu->EnableItem(SID_DELETE, IsDeleteAllowed() && bEnable);
-                if (aContextMenu->Execute(this, rEvt.GetMousePosPixel()) == SID_DELETE)
+                VclBuilder aBuilder(nullptr, VclBuilderContainer::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()))
                 {
                     if( m_nDeleteEvent )
                         Application::RemoveUserEvent( m_nDeleteEvent );
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.src b/reportdesign/source/ui/dlg/GroupsSorting.src
index 21148dbd571e..9ae6ebda573a 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.src
+++ b/reportdesign/source/ui/dlg/GroupsSorting.src
@@ -105,16 +105,4 @@ String STR_RPT_HELP_SORT
     Text [ en-US ] = "Select ascending or descending sort order. Ascending means from A to Z or 0 to 9" ;
 };
 
-Menu RID_GROUPSROWPOPUPMENU
-{
-    ItemList =
-    {
-        MenuItem
-        {
-            Identifier = SID_DELETE ;
-            Text [ en-US ] = "~Delete FOO" ;
-        };
-    };
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/uiconfig/dbreport/ui/groupsortmenu.ui b/reportdesign/uiconfig/dbreport/ui/groupsortmenu.ui
new file mode 100644
index 000000000000..b9df6f291084
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/ui/groupsortmenu.ui
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface>
+  <requires lib="gtk+" version="3.10"/>
+  <object class="GtkMenu" id="menu">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkMenuItem" id="delete">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Delete</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list