summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.com>2016-03-31 14:47:27 +0530
committerJan Holesovsky <kendy@collabora.com>2016-04-08 12:49:45 +0200
commit6be044e919d28b93332f04bdc18f6def2925b098 (patch)
treee996b7cfa31c655b7998761394dd9b4d35be4f8d /sw
parent9820da23375d89c26d6feb9d8ee3969916dc0d76 (diff)
lok context menu: Expose context menu
Change-Id: I0968689630e10f838c075e86357eb36a9a220d0d
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/inc/edtwin.hxx4
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx9
2 files changed, 10 insertions, 3 deletions
diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx
index ed65f1e9d1d6..52ad95bbc510 100644
--- a/sw/source/uibase/inc/edtwin.hxx
+++ b/sw/source/uibase/inc/edtwin.hxx
@@ -197,8 +197,6 @@ protected:
virtual void MouseButtonUp(const MouseEvent& rMEvt) SAL_OVERRIDE;
virtual void RequestHelp(const HelpEvent& rEvt) SAL_OVERRIDE;
- virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
-
// Drag & Drop Interface
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;
@@ -297,6 +295,8 @@ public:
virtual ~SwEditWin();
virtual void dispose() SAL_OVERRIDE;
+ virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
+
/// @see OutputDevice::LogicInvalidate().
void LogicInvalidate(const Rectangle* pRectangle) SAL_OVERRIDE;
/// Same as MouseButtonDown(), but coordinates are in logic unit.
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 1f7fbf9de8f6..9a78c37b6ca2 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3344,12 +3344,19 @@ void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int
SolarMutexGuard aGuard;
SwEditWin& rEditWin = pDocShell->GetView()->GetEditWin();
- MouseEvent aEvent(Point(nX, nY), nCount, MouseEventModifiers::SIMPLECLICK, nButtons, nModifier);
+ Point aPos(nX , nY);
+ MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, nButtons, nModifier);
switch (nType)
{
case LOK_MOUSEEVENT_MOUSEBUTTONDOWN:
rEditWin.LogicMouseButtonDown(aEvent);
+
+ if (nButtons & MOUSE_RIGHT)
+ {
+ const CommandEvent aCEvt(aPos, CommandEventId::ContextMenu, true, nullptr);
+ rEditWin.Command(aCEvt);
+ }
break;
case LOK_MOUSEEVENT_MOUSEBUTTONUP:
rEditWin.LogicMouseButtonUp(aEvent);