diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-14 16:40:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-14 16:40:08 +0100 |
commit | 88b42085ab5af0f865573180e642af9b29f472e5 (patch) | |
tree | d7f21cce1aa299d63d83805d8086bfbbadf250eb | |
parent | 7a01268f3fccd9cb43097f27696fec563f21b336 (diff) |
convert cell menu to .ui
Change-Id: If0b17eb94a629d6a46d5fd44430e866135a4c002
-rw-r--r-- | include/svx/fmresids.hrc | 1 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 12 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.src | 13 | ||||
-rw-r--r-- | svx/uiconfig/ui/cellmenu.ui | 17 |
5 files changed, 22 insertions, 22 deletions
diff --git a/include/svx/fmresids.hrc b/include/svx/fmresids.hrc index 318cdd6d85c3..7ff02a58790f 100644 --- a/include/svx/fmresids.hrc +++ b/include/svx/fmresids.hrc @@ -64,7 +64,6 @@ // Menu-Id's ----------------------------------------------------------- #define RID_FMEXPLORER_POPUPMENU (RID_FORMS_START + 0) #define RID_SVXMNU_COLS (RID_FORMS_START + 2) -#define RID_SVXMNU_CELL (RID_FORMS_START + 3) #define RID_FMSHELL_CONVERSIONMENU (RID_FORMS_START + 4) #define RID_FM_FILTER_MENU (RID_FORMS_START + 5) #define RID_MENU_DATANAVIGATOR (RID_FORMS_START + 10) diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index 278100146ffe..286b14ac9560 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -18,6 +18,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/addnamespacedialog \ svx/uiconfig/ui/addsubmissiondialog \ svx/uiconfig/ui/asianphoneticguidedialog \ + svx/uiconfig/ui/cellmenu \ svx/uiconfig/ui/chineseconversiondialog \ svx/uiconfig/ui/chinesedictionary \ svx/uiconfig/ui/colorwindow \ diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index c4ee149afe30..363df1260eda 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -2860,14 +2860,10 @@ void DbGridControl::Command(const CommandEvent& rEvt) } else if (canCopyCellText(nRow, nColId)) { - ScopedVclPtrInstance<PopupMenu> aContextMenu(SVX_RES(RID_SVXMNU_CELL)); - aContextMenu->RemoveDisabledEntries(true, true); - switch (aContextMenu->Execute(this, rEvt.GetMousePosPixel())) - { - case SID_COPY: - copyCellText(nRow, nColId); - break; - } + VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "svx/ui/cellmenu.ui", ""); + VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu")); + if (aContextMenu->Execute(this, rEvt.GetMousePosPixel())) + copyCellText(nRow, nColId); } else { diff --git a/svx/source/fmcomp/gridctrl.src b/svx/source/fmcomp/gridctrl.src index b5365864420e..443537dea90e 100644 --- a/svx/source/fmcomp/gridctrl.src +++ b/svx/source/fmcomp/gridctrl.src @@ -161,17 +161,4 @@ Menu RID_SVXMNU_COLS }; }; -Menu RID_SVXMNU_CELL -{ - ItemList = - { - MenuItem - { - Identifier = SID_COPY ; - Command = ".uno:Copy" ; - Text [ en-US ] = "~Copy" ; - }; - }; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/uiconfig/ui/cellmenu.ui b/svx/uiconfig/ui/cellmenu.ui new file mode 100644 index 000000000000..e7edb0c359fe --- /dev/null +++ b/svx/uiconfig/ui/cellmenu.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="copy"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">_Copy</property> + <property name="use_underline">True</property> + </object> + </child> + </object> +</interface> |