summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-14 14:42:26 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-16 11:38:27 +0100
commitbd929bc551c586cf5d3ef49ad573a59e9fe1ce33 (patch)
tree4f09267c180ce6db375a39b2a51ed17037901b53
parentac9cf73997ea8e6ea8b5919dd677b4c8faf36acd (diff)
sw lok comments: implement mouse move and mouse up
As long as we don't tweak the map mode of the comment widgets permanently we also have to disable the selection engine's timer, as that would emit events without the correct map mode: so disable that for the LOK case for now. (cherry picked from commit b3dc0d7c72c2bb997bfceaeaf25dc9153ceca244) Conflicts: sw/inc/SidebarWin.hxx sw/source/uibase/docvw/SidebarTxtControl.hxx Change-Id: If377ff2f064c30feb473f153f9d5b29b8ace7113
-rw-r--r--sw/inc/SidebarWin.hxx2
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.hxx4
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx28
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx18
-rw-r--r--vcl/source/window/seleng.cxx5
5 files changed, 54 insertions, 3 deletions
diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index f176140d1ce9..4f7fc33272aa 100644
--- a/sw/inc/SidebarWin.hxx
+++ b/sw/inc/SidebarWin.hxx
@@ -180,6 +180,8 @@ class SwSidebarWin : public vcl::Window
virtual void Draw(OutputDevice* pDev, const Point&, const Size&, sal_uLong) SAL_OVERRIDE;
virtual void KeyInput(const KeyEvent& rKeyEvt) SAL_OVERRIDE;
virtual void MouseButtonDown(const MouseEvent& rMouseEvent) SAL_OVERRIDE;
+ virtual void MouseButtonUp(const MouseEvent& rMouseEvent) SAL_OVERRIDE;
+ virtual void MouseMove(const MouseEvent& rMouseEvent) SAL_OVERRIDE;
void PaintTile(vcl::RenderContext& rRenderContext, const Rectangle& rRect);
/// Is there a matching sub-widget inside this sidebar widget for rPointLogic?
bool IsHitWindow(const Point& rPointLogic);
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.hxx b/sw/source/uibase/docvw/SidebarTxtControl.hxx
index 57a60d3801bb..15d7c6fc3145 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.hxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.hxx
@@ -42,8 +42,6 @@ class SidebarTextControl : public Control
virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
/// @see OutputDevice::LogicInvalidate().
void LogicInvalidate(const Rectangle* pRectangle) SAL_OVERRIDE;
- virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
- virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE;
virtual void RequestHelp(const HelpEvent &rEvt) SAL_OVERRIDE;
@@ -63,6 +61,8 @@ class SidebarTextControl : public Control
virtual void GetFocus() SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKeyEvt ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+ virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+ virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
OutlinerView* GetTextView() const;
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 01ce695d8bfe..47b335a51696 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -411,6 +411,20 @@ void SwSidebarWin::KeyInput(const KeyEvent& rKeyEvent)
}
}
+void SwSidebarWin::MouseMove(const MouseEvent& rMouseEvent)
+{
+ if (mpSidebarTextControl)
+ {
+ mpSidebarTextControl->Push(PushFlags::MAPMODE);
+ MouseEvent aMouseEvent(rMouseEvent);
+ lcl_translateTwips(*EditWin(), *mpSidebarTextControl, &aMouseEvent);
+
+ mpSidebarTextControl->MouseMove(aMouseEvent);
+
+ mpSidebarTextControl->Pop();
+ }
+}
+
void SwSidebarWin::MouseButtonDown(const MouseEvent& rMouseEvent)
{
if (mpSidebarTextControl)
@@ -425,6 +439,20 @@ void SwSidebarWin::MouseButtonDown(const MouseEvent& rMouseEvent)
}
}
+void SwSidebarWin::MouseButtonUp(const MouseEvent& rMouseEvent)
+{
+ if (mpSidebarTextControl)
+ {
+ mpSidebarTextControl->Push(PushFlags::MAPMODE);
+ MouseEvent aMouseEvent(rMouseEvent);
+ lcl_translateTwips(*EditWin(), *mpSidebarTextControl, &aMouseEvent);
+
+ mpSidebarTextControl->MouseButtonUp(aMouseEvent);
+
+ mpSidebarTextControl->Pop();
+ }
+}
+
void SwSidebarWin::SetPosSizePixelRect(long nX, long nY, long nWidth, long nHeight,
const SwRect& aAnchorRect, const long aPageBorder)
{
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 213e077e5739..07d707b2262b 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3704,6 +3704,15 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
{
MouseEvent rMEvt(_rMEvt);
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ if (vcl::Window* pWindow = m_rView.GetPostItMgr()->IsHitSidebarWindow(rMEvt.GetPosPixel()))
+ {
+ pWindow->MouseMove(rMEvt);
+ return;
+ }
+ }
+
//ignore key modifiers for format paintbrush
{
bool bExecFormatPaintbrush = m_pApplyTempl && m_pApplyTempl->m_pFormatClipboard
@@ -4209,6 +4218,15 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
*/
void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
{
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ if (vcl::Window* pWindow = m_rView.GetPostItMgr()->IsHitSidebarWindow(rMEvt.GetPosPixel()))
+ {
+ pWindow->MouseButtonUp(rMEvt);
+ return;
+ }
+ }
+
bool bCallBase = true;
bool bCallShadowCrsr = m_bWasShdwCrsr;
diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 7999818b509c..69b220bedfcc 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -20,6 +20,7 @@
#include <vcl/window.hxx>
#include <vcl/seleng.hxx>
#include <tools/debug.hxx>
+#include <comphelper/lok.hxx>
FunctionSet::~FunctionSet()
{
@@ -301,7 +302,9 @@ bool SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
return true;
aWTimer.SetTimeout( nUpdateInterval );
- aWTimer.Start();
+ if (!comphelper::LibreOfficeKit::isActive())
+ // Generating fake mouse moves does not work with LOK.
+ aWTimer.Start();
if ( eSelMode != SINGLE_SELECTION )
{
if ( !(nFlags & SelectionEngineFlags::HAS_ANCH) )