summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 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;
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) )