summaryrefslogtreecommitdiff
path: root/sw
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-14 17:28:31 +0100
commitb3dc0d7c72c2bb997bfceaeaf25dc9153ceca244 (patch)
tree991103d43b0cc29be44eeb9aa186b0c33d504593 /sw
parent5730388b6e8cd1345318afedb00afcfc139287a5 (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. Change-Id: If377ff2f064c30feb473f153f9d5b29b8ace7113
Diffstat (limited to 'sw')
-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
4 files changed, 50 insertions, 2 deletions
diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index bda077bb8a62..4d88b4623a1c 100644
--- a/sw/inc/SidebarWin.hxx
+++ b/sw/inc/SidebarWin.hxx
@@ -179,6 +179,8 @@ class SwSidebarWin : public vcl::Window
virtual void Draw(OutputDevice* pDev, const Point&, const Size&, DrawFlags) override;
virtual void KeyInput(const KeyEvent& rKeyEvt) override;
virtual void MouseButtonDown(const MouseEvent& rMouseEvent) override;
+ virtual void MouseButtonUp(const MouseEvent& rMouseEvent) override;
+ virtual void MouseMove(const MouseEvent& rMouseEvent) 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 ca7271a0f9eb..71428981f1e9 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) override;
/// @see OutputDevice::LogicInvalidate().
void LogicInvalidate(const Rectangle* pRectangle) override;
- virtual void MouseMove( const MouseEvent& rMEvt ) override;
- virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
virtual void Command( const CommandEvent& rCEvt ) override;
virtual void LoseFocus() override;
virtual void RequestHelp(const HelpEvent &rEvt) override;
@@ -63,6 +61,8 @@ class SidebarTextControl : public Control
virtual void GetFocus() override;
virtual void KeyInput( const KeyEvent& rKeyEvt ) override;
virtual void MouseButtonDown(const MouseEvent& rMouseEvent) override;
+ virtual void MouseButtonUp(const MouseEvent& rMEvt) override;
+ virtual void MouseMove(const MouseEvent& rMEvt) override;
OutlinerView* GetTextView() const;
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 22bb863352eb..867cd2bf44cb 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 98aac5139f8b..59c11be17bcc 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3732,6 +3732,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
@@ -4237,6 +4246,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;