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 09:43:50 +0200
commit610db8d5d0500aed2ca6d4da822cf70746b44d49 (patch)
treededfb47f30a9ee62d3491a09df87a954733cdb3e /sw
parent396ed6ff96c02fccf6b26e983d628a5afce7d656 (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 58f2a489a7e4..96c1d5a7898c 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) override;
virtual void RequestHelp(const HelpEvent& rEvt) override;
- virtual void Command( const CommandEvent& rCEvt ) override;
-
// Drag & Drop Interface
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
@@ -295,6 +293,8 @@ public:
virtual ~SwEditWin();
virtual void dispose() override;
+ virtual void Command( const CommandEvent& rCEvt ) override;
+
/// @see OutputDevice::LogicInvalidate().
void LogicInvalidate(const Rectangle* pRectangle) 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 2087912ee710..5a7d25211b92 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3305,12 +3305,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);