diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/inc/edtwin.hxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 9 |
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); |