summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2016-10-30 18:01:21 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2016-10-30 19:37:03 +0200
commit96febd383cf2b72e66f18ea2b7a8be09a102080b (patch)
tree0ec83c5b03b4da06283bf391f3b6abd04ad0ac06
parentd1dd9269f1c9f0efc7fb44087fb172d66f54a8fa (diff)
Add resource name method to IContextMenuProvider
Change-Id: I218fd18101f8f7039052fe8a065096e4c9809adb
-rw-r--r--dbaccess/source/ui/app/AppController.cxx7
-rw-r--r--dbaccess/source/ui/app/AppController.hxx1
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx5
-rw-r--r--dbaccess/source/ui/inc/callbacks.hxx8
-rw-r--r--dbaccess/source/ui/inc/dbu_resource.hrc1
-rw-r--r--dbaccess/source/ui/inc/unodatbr.hxx1
6 files changed, 21 insertions, 2 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 3c6860d37380..c414c6369922 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -2281,9 +2281,14 @@ void OApplicationController::onDeleteEntry()
executeChecked(nId,Sequence<PropertyValue>());
}
+OUString OApplicationController::getContextMenuResourceName( Control& /*_rControl*/ ) const
+{
+ return OUString("edit");
+}
+
VclPtr<PopupMenu> OApplicationController::getContextMenu( Control& /*_rControl*/ ) const
{
- return VclPtr<PopupMenu>::Create( ModuleRes( RID_MENU_APP_EDIT ) );
+ return nullptr;
}
IController& OApplicationController::getCommandController()
diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx
index ded00698318d..6c5bcfd0e6e3 100644
--- a/dbaccess/source/ui/app/AppController.hxx
+++ b/dbaccess/source/ui/app/AppController.hxx
@@ -521,6 +521,7 @@ namespace dbaui
virtual sal_Int8 executeDrop( const ExecuteDropEvent& _rEvt ) override;
// IContextMenuProvider
+ virtual OUString getContextMenuResourceName( Control& _rControl ) const override;
virtual VclPtr<PopupMenu> getContextMenu( Control& _rControl ) const override;
virtual IController& getCommandController() override;
virtual ::comphelper::OInterfaceContainerHelper2*
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index f42a38633b91..5aa5f4f38f7d 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -3469,6 +3469,11 @@ bool SbaTableQueryBrowser::requestQuickHelp( const SvTreeListEntry* _pEntry, OUS
return false;
}
+OUString SbaTableQueryBrowser::getContextMenuResourceName( Control& ) const
+{
+ return OUString();
+}
+
VclPtr<PopupMenu> SbaTableQueryBrowser::getContextMenu( Control& _rControl ) const
{
OSL_PRECOND( &m_pTreeView->getListBox() == &_rControl,
diff --git a/dbaccess/source/ui/inc/callbacks.hxx b/dbaccess/source/ui/inc/callbacks.hxx
index c9e98ea41e9a..9d1c95e65019 100644
--- a/dbaccess/source/ui/inc/callbacks.hxx
+++ b/dbaccess/source/ui/inc/callbacks.hxx
@@ -68,6 +68,14 @@ namespace dbaui
class SAL_NO_VTABLE IContextMenuProvider
{
public:
+ /** returns the context menu resource name for the control
+
+ Supposed to be a valid name from uiconfig/<module>/popupmenu folder.
+ Nevertheless, the getContextMenu method will not be evaluated, as long
+ as this method returns non-empty string.
+ */
+ virtual OUString getContextMenuResourceName( Control& _rControl ) const = 0;
+
/** returns the context menu for the control
Note that the menu does not need to care for the controls selection, or its
diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc
index 83ccc950c905..4c6cd0838c83 100644
--- a/dbaccess/source/ui/inc/dbu_resource.hrc
+++ b/dbaccess/source/ui/inc/dbu_resource.hrc
@@ -133,7 +133,6 @@
#define RID_QUERYFUNCTION_POPUPMENU RID_MENU_START + 6
#define RID_TABLEDESIGNROWPOPUPMENU RID_MENU_START + 7
#define RID_SBA_RTF_PKEYPOPUP RID_MENU_START + 9
-#define RID_MENU_APP_EDIT RID_MENU_START + 10
#define RID_MENU_APP_PREVIEW RID_MENU_START + 12
#define MENU_BROWSER_DEFAULTCONTEXT RID_MENU_START + 14
#define RID_MENU_JOINVIEW_CONNECTION RID_MENU_START + 16
diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx
index f8bd65a26267..93118a4225cd 100644
--- a/dbaccess/source/ui/inc/unodatbr.hxx
+++ b/dbaccess/source/ui/inc/unodatbr.hxx
@@ -230,6 +230,7 @@ namespace dbaui
virtual sal_Int8 executeDrop( const ExecuteDropEvent& _rEvt ) override;
// IContextMenuProvider
+ virtual OUString getContextMenuResourceName( Control& _rControl ) const override;
virtual VclPtr<PopupMenu> getContextMenu( Control& _rControl ) const override;
virtual IController& getCommandController() override;
virtual ::comphelper::OInterfaceContainerHelper2*