diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-07 11:02:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-07 18:36:59 +0100 |
commit | 3e1977abc648a0b30be7af3c10060938de1b143f (patch) | |
tree | f4972e7f58139c08dad0339d1cc5071e524a659a /dbaccess/source | |
parent | RID_SBA_GRID_COLCTXMENU has the same odd pattern (diff) | |
download | core-3e1977abc648a0b30be7af3c10060938de1b143f.tar.gz core-3e1977abc648a0b30be7af3c10060938de1b143f.zip |
convert RID_QUERYCOLPOPUPMENU to .ui format
Change-Id: Idcf8566db964c475a0b9049f215af6fc57f0978b
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/inc/dbu_resource.hrc | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 18 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/query.src | 23 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TEditControl.cxx | 13 |
4 files changed, 12 insertions, 43 deletions
diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index 0121edb0a3ef..574042ef9616 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -123,7 +123,6 @@ // menus -#define RID_QUERYCOLPOPUPMENU RID_MENU_START + 5 #define RID_QUERYFUNCTION_POPUPMENU RID_MENU_START + 6 #define RID_TABLEDESIGNROWPOPUPMENU RID_MENU_START + 7 #define RID_SBA_RTF_PKEYPOPUP RID_MENU_START + 9 diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 496ced84a687..308f238f8f4e 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -1940,17 +1940,13 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) if (!static_cast<OQueryController&>(getDesignView()->getController()).isReadOnly()) { - ScopedVclPtrInstance<PopupMenu> aContextMenu( ModuleRes( RID_QUERYCOLPOPUPMENU ) ); - switch (aContextMenu->Execute(this, aMenuPos)) - { - case SID_DELETE: - RemoveField(nColId); - break; - - case ID_BROWSER_COLWIDTH: - adjustBrowseBoxColumnWidth( this, nColId ); - break; - } + VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "dbaccess/ui/querycolmenu.ui", ""); + VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu")); + sal_uInt16 nItemId = aContextMenu->Execute(this, aMenuPos); + if (nItemId == aContextMenu->GetItemId("delete")) + RemoveField(nColId); + else if (nItemId == aContextMenu->GetItemId("width")) + adjustBrowseBoxColumnWidth( this, nColId ); } } else if(nRow >= 0 && nColId <= HANDLE_ID) diff --git a/dbaccess/source/ui/querydesign/query.src b/dbaccess/source/ui/querydesign/query.src index 7530f5d0948f..f84fce531999 100644 --- a/dbaccess/source/ui/querydesign/query.src +++ b/dbaccess/source/ui/querydesign/query.src @@ -53,29 +53,6 @@ Menu RID_MENU_JOINVIEW_TABLE }; }; -Menu RID_QUERYCOLPOPUPMENU -{ - ItemList = - { - MenuItem - { - Identifier = ID_BROWSER_COLWIDTH ; - HelpID = HID_BROWSER_COLUMNWIDTH ; - Text [ en-US ] = "Column ~Width..." ; - }; - MenuItem - { - Separator = TRUE ; - }; - MenuItem - { - Identifier = SID_DELETE ; - Command = ".uno:Delete" ; - Text [ en-US ] = "~Delete" ; - }; - }; -}; - Bitmap BMP_PRIMARY_KEY { File = "jo01.png"; diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index d62b5cbd844c..5a5b7bd87bdf 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -1361,15 +1361,12 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt) if ( !IsColumnSelected( nColId ) ) SelectColumnId( nColId ); - ScopedVclPtrInstance<PopupMenu> aContextMenu( ModuleRes( RID_QUERYCOLPOPUPMENU ) ); - aContextMenu->EnableItem( SID_DELETE, false ); + VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "dbaccess/ui/querycolmenu.ui", ""); + VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu")); + aContextMenu->EnableItem(aContextMenu->GetItemId("delete"), false); aContextMenu->RemoveDisabledEntries(true, true); - switch ( aContextMenu->Execute( this, aMenuPos ) ) - { - case ID_BROWSER_COLWIDTH: - adjustBrowseBoxColumnWidth( this, nColId ); - break; - } + if (aContextMenu->Execute(this, aMenuPos) == aContextMenu->GetItemId("width")) + adjustBrowseBoxColumnWidth( this, nColId ); } } } |