[Libreoffice-commits] core.git: 6 commits - desktop/CppunitTest_desktop_lib.mk desktop/qa libreofficekit/qa sw/inc sw/Module_sw.mk sw/qa sw/source vcl/source
Miklos Vajna
vmiklos at collabora.co.uk
Sat Nov 14 08:29:12 PST 2015
desktop/CppunitTest_desktop_lib.mk | 1
desktop/qa/desktop_lib/test_desktop_lib.cxx | 46 ++++++++++++++++++++
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 19 ++++++++
sw/Module_sw.mk | 7 ++-
sw/inc/SidebarWin.hxx | 2
sw/qa/extras/tiledrendering/tiledrendering.cxx | 34 --------------
sw/source/core/fields/docufld.cxx | 5 +-
sw/source/uibase/docvw/SidebarTxtControl.hxx | 4 -
sw/source/uibase/docvw/SidebarWin.cxx | 28 ++++++++++++
sw/source/uibase/docvw/edtwin.cxx | 18 +++++++
vcl/source/window/seleng.cxx | 5 +-
11 files changed, 130 insertions(+), 39 deletions(-)
New commits:
commit 44c7272fc543947792ae8195341b8867d81e3925
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Nov 14 17:10:32 2015 +0100
SwPostItField::dumpAsXml: survive 0 mpText
And no need to copy it to be able to dump it.
Change-Id: I5c0782c489a5d7c24173a81cc82efd195c4aa56e
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 29b646c..45c0caa 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1841,8 +1841,9 @@ void SwPostItField::dumpAsXml(xmlTextWriterPtr pWriter) const
SwField::dumpAsXml(pWriter);
xmlTextWriterStartElement(pWriter, BAD_CAST("mpText"));
- OutlinerParaObject aParaObject(*mpText);
- aParaObject.dumpAsXml(pWriter);
+ xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", mpText);
+ if (mpText)
+ mpText->dumpAsXml(pWriter);
xmlTextWriterEndElement(pWriter);
xmlTextWriterEndElement(pWriter);
commit 1118689e70ed49604ded6e1ae83a22bdc995b2fb
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Nov 14 16:59:01 2015 +0100
CppunitTest_desktop_lib: add Writer comments textcase
Fails without e.g. the last hunk of commit
1ba9d7fd2a7a3e2b4f52ed0f5efdf7df867b9db3 (sw lok: forward key events to
annotation window if necessary, 2015-11-12).
Change-Id: I7f39530881f6141fea956b751aa57eb2bdcadcb2
diff --git a/desktop/CppunitTest_desktop_lib.mk b/desktop/CppunitTest_desktop_lib.mk
index ca9d8db..bbedfdc 100644
--- a/desktop/CppunitTest_desktop_lib.mk
+++ b/desktop/CppunitTest_desktop_lib.mk
@@ -67,6 +67,7 @@ $(eval $(call gb_CppunitTest_use_components,desktop_lib,\
xmloff/util/xo \
i18npool/source/search/i18nsearch \
filter/source/graphic/graphicfilter \
+ linguistic/source/lng \
))
$(eval $(call gb_CppunitTest_use_configuration,desktop_lib))
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 21e177a..5ca573d 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -10,6 +10,10 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/awt/Key.hpp>
+#include <com/sun/star/awt/XReschedule.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <comphelper/processfactory.hxx>
@@ -70,6 +74,7 @@ public:
void testRowColumnHeaders();
void testCellCursor();
void testCommandResult();
+ void testWriterComments();
CPPUNIT_TEST_SUITE(DesktopLOKTest);
CPPUNIT_TEST(testGetStyles);
@@ -85,6 +90,7 @@ public:
CPPUNIT_TEST(testRowColumnHeaders);
CPPUNIT_TEST(testCellCursor);
CPPUNIT_TEST(testCommandResult);
+ CPPUNIT_TEST(testWriterComments);
CPPUNIT_TEST_SUITE_END();
uno::Reference<lang::XComponent> mxComponent;
@@ -491,6 +497,46 @@ void DesktopLOKTest::testCommandResult()
CPPUNIT_ASSERT_EQUAL(aTree.get_child("success").get_value<bool>(), true);
}
+void DesktopLOKTest::testWriterComments()
+{
+ comphelper::LibreOfficeKit::setActive();
+ LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
+ pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
+ uno::Reference<awt::XReschedule> xToolkit(com::sun::star::awt::Toolkit::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY);
+
+ // Insert a comment at the beginning of the document and wait till the main
+ // loop grabs the focus, so characters end up in the annotation window.
+ TimeValue aTimeValue = {2 , 0}; // 2 seconds max
+ m_aCommandResultCondition.reset();
+ pDocument->pClass->postUnoCommand(pDocument, ".uno:InsertAnnotation", nullptr, true);
+ m_aCommandResultCondition.wait(aTimeValue);
+ CPPUNIT_ASSERT(!m_aCommandResult.isEmpty());
+ xToolkit->reschedule();
+
+ // Test that we have a comment.
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParagraphEnumerationAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParagraphEnumeration = xParagraphEnumerationAccess->createEnumeration();
+ uno::Reference<container::XEnumerationAccess> xParagraph(xParagraphEnumeration->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xTextPortionEnumeration = xParagraph->createEnumeration();
+ uno::Reference<beans::XPropertySet> xTextPortion(xTextPortionEnumeration->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("Annotation"), xTextPortion->getPropertyValue("TextPortionType").get<OUString>());
+
+ // Type "test" and finish editing.
+ pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
+ pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 'e', 0);
+ pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 's', 0);
+ pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
+ pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 0, com::sun::star::awt::Key::ESCAPE);
+
+ // Test that the typed characters ended up in the right window.
+ auto xTextField = xTextPortion->getPropertyValue("TextField").get< uno::Reference<beans::XPropertySet> >();
+ // This was empty, typed characters ended up in the body text.
+ CPPUNIT_ASSERT_EQUAL(OUString("test"), xTextField->getPropertyValue("Content").get<OUString>());
+
+ comphelper::LibreOfficeKit::setActive(false);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
CPPUNIT_PLUGIN_IMPLEMENT();
commit 18dfcbb11a05b7e702dc2161df9db8386a7ca34b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Nov 14 15:35:18 2015 +0100
CppunitTest_sw_tiledrendering: replace various ifdefs with a single condition
LOK is Linux-only at the moment, don't bother with disabling each and
every unit test on Mac/Windows for now.
Change-Id: I2ff1ed47251c16ec6a8d43138789480d95ea720e
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 7dfd541..39b466f 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -69,11 +69,16 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
CppunitTest_sw_odfexport \
CppunitTest_sw_odfimport \
CppunitTest_sw_uiwriter \
- CppunitTest_sw_tiledrendering \
CppunitTest_sw_mailmerge \
CppunitTest_sw_globalfilter \
))
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Module_add_slowcheck_targets,sw,\
+ CppunitTest_sw_tiledrendering \
+))
+endif
+
ifneq ($(DISABLE_CVE_TESTS),TRUE)
$(eval $(call gb_Module_add_slowcheck_targets,sw,\
CppunitTest_sw_filters_test \
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 523c9d2..2ec1052 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -151,18 +151,6 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
void SwTiledRenderingTest::testRegisterCallback()
{
-#ifdef MACOSX
- // For some reason this particular test requires window system access on OS X.
-
- // Without window system access, we do get a number of "<<<WARNING>>>
- // AquaSalGraphics::CheckContext() FAILED!!!!" [sic] and " <Warning>: CGSConnectionByID: 0 is
- // not a valid connection ID" warnings while running the other tests, too, but they still
- // succeed.
-
- if (!vcl::IsWindowSystemAvailable())
- return;
-#endif
-
SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
@@ -171,13 +159,8 @@ void SwTiledRenderingTest::testRegisterCallback()
// Check that the top left 256x256px tile would be invalidated.
CPPUNIT_ASSERT(!m_aInvalidation.IsEmpty());
-#if !defined(WNT) && !defined(MACOSX)
Rectangle aTopLeft(0, 0, 256*15, 256*15); // 1 px = 15 twips, assuming 96 DPI.
- // FIXME - fails on Windows since about cbd48230bb3a90c4c485fa33123c6653234e02e9
- // [plus minus few commits maybe]
- // Also on OS X. But is tiled rendering even supposed to work on Windows and OS X?
CPPUNIT_ASSERT(m_aInvalidation.IsOver(aTopLeft));
-#endif
}
void SwTiledRenderingTest::testPostKeyEvent()
@@ -291,9 +274,7 @@ void SwTiledRenderingTest::testSetGraphicSelection()
Rectangle aShapeAfter = pObject->GetSnapRect();
// Check that a resize happened, but aspect ratio is not kept.
CPPUNIT_ASSERT_EQUAL(aShapeBefore.getWidth(), aShapeAfter.getWidth());
-#if !defined(MACOSX) // FIXME
CPPUNIT_ASSERT_EQUAL(aShapeBefore.getHeight() + 1000, aShapeAfter.getHeight());
-#endif
}
void SwTiledRenderingTest::testResetSelection()
@@ -323,7 +304,6 @@ void SwTiledRenderingTest::testResetSelection()
CPPUNIT_ASSERT(!pWrtShell->IsSelFrmMode());
}
-#if !(defined WNT || defined MACOSX)
void lcl_search(bool bBackward)
{
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
@@ -333,11 +313,9 @@ void lcl_search(bool bBackward)
}));
comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
}
-#endif
void SwTiledRenderingTest::testSearch()
{
-#if !defined(WNT) && !defined(MACOSX)
comphelper::LibreOfficeKit::setActive();
SwXTextDocument* pXTextDocument = createDoc("search.odt");
@@ -378,12 +356,10 @@ void SwTiledRenderingTest::testSearch()
CPPUNIT_ASSERT_EQUAL(nNode + 1, nActual);
comphelper::LibreOfficeKit::setActive(false);
-#endif
}
void SwTiledRenderingTest::testSearchViewArea()
{
-#if !defined(WNT) && !defined(MACOSX)
SwXTextDocument* pXTextDocument = createDoc("search.odt");
SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
// Go to the second page, 1-based.
@@ -405,12 +381,10 @@ void SwTiledRenderingTest::testSearchViewArea()
comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
// This was just "Heading", i.e. SwView::SearchAndWrap() did not search from only the top of the second page.
CPPUNIT_ASSERT_EQUAL(OUString("Heading on second page"), pShellCrsr->GetPoint()->nNode.GetNode().GetTextNode()->GetText());
-#endif
}
void SwTiledRenderingTest::testSearchTextFrame()
{
-#if !defined(WNT) && !defined(MACOSX)
comphelper::LibreOfficeKit::setActive();
SwXTextDocument* pXTextDocument = createDoc("search.odt");
@@ -425,12 +399,10 @@ void SwTiledRenderingTest::testSearchTextFrame()
CPPUNIT_ASSERT(!m_aTextSelection.isEmpty());
comphelper::LibreOfficeKit::setActive(false);
-#endif
}
void SwTiledRenderingTest::testSearchTextFrameWrapAround()
{
-#if !defined(WNT) && !defined(MACOSX)
SwXTextDocument* pXTextDocument = createDoc("search.odt");
pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
@@ -443,12 +415,10 @@ void SwTiledRenderingTest::testSearchTextFrameWrapAround()
comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
// This failed, i.e. the second time 'not found' was reported, instead of wrapping around.
CPPUNIT_ASSERT(m_bFound);
-#endif
}
void SwTiledRenderingTest::testDocumentSizeChanged()
{
-#if !defined(WNT) && !defined(MACOSX)
// Get the current document size.
SwXTextDocument* pXTextDocument = createDoc("2-pages.odt");
pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
@@ -463,12 +433,10 @@ void SwTiledRenderingTest::testDocumentSizeChanged()
CPPUNIT_ASSERT_EQUAL(aSize.getWidth(), m_aDocumentSize.getWidth());
// Document height should be smaller now.
CPPUNIT_ASSERT(aSize.getHeight() > m_aDocumentSize.getHeight());
-#endif
}
void SwTiledRenderingTest::testSearchAll()
{
-#if !defined(WNT) && !defined(MACOSX)
comphelper::LibreOfficeKit::setActive();
SwXTextDocument* pXTextDocument = createDoc("search.odt");
@@ -486,8 +454,8 @@ void SwTiledRenderingTest::testSearchAll()
CPPUNIT_ASSERT_EQUAL(0, m_aSearchResultPart[0]);
comphelper::LibreOfficeKit::setActive(false);
-#endif
}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest);
CPPUNIT_PLUGIN_IMPLEMENT();
commit bd05cc9a5093bbf5d2e136a6589be612df81d27e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Nov 14 15:10:18 2015 +0100
gtktiledviewer: add toolbar buttons to insert / delete comments
Change-Id: Ia566e983548a89d974c133823da2f07d5c2e35e4
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 8ec5ddf..c65e4a1 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -1094,6 +1094,23 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
gtk_toolbar_insert(GTK_TOOLBAR(pLowerToolbar), rWindow.m_pJustifypara, -1);
g_signal_connect(G_OBJECT(rWindow.m_pJustifypara), "toggled", G_CALLBACK(toggleToolItem), NULL);
lcl_registerToolItem(rWindow, rWindow.m_pJustifypara, ".uno:JustifyPara");
+ gtk_toolbar_insert(GTK_TOOLBAR(pLowerToolbar), gtk_separator_tool_item_new(), -1);
+
+ // Insert/delete comments.
+ GtkToolItem* pInsertAnnotation = gtk_tool_button_new(nullptr, nullptr);
+ gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(pInsertAnnotation), "changes-allow-symbolic");
+ gtk_tool_item_set_tooltip_text(pInsertAnnotation, "Insert Comment");
+ gtk_toolbar_insert(GTK_TOOLBAR(pLowerToolbar), pInsertAnnotation, -1);
+ g_signal_connect(G_OBJECT(pInsertAnnotation), "clicked", G_CALLBACK(toggleToolItem), NULL);
+ lcl_registerToolItem(rWindow, pInsertAnnotation, ".uno:InsertAnnotation");
+
+ GtkToolItem* pDeleteComment = gtk_tool_button_new(nullptr, nullptr);
+ gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(pDeleteComment), "changes-prevent-symbolic");
+ gtk_tool_item_set_tooltip_text(pDeleteComment, "Delete Comment");
+ gtk_toolbar_insert(GTK_TOOLBAR(pLowerToolbar), pDeleteComment, -1);
+ g_signal_connect(G_OBJECT(pDeleteComment), "clicked", G_CALLBACK(toggleToolItem), NULL);
+ lcl_registerToolItem(rWindow, pDeleteComment, ".uno:DeleteComment");
+
// Formula bar
GtkToolItem* pFormulaEntryContainer = gtk_tool_item_new();
rWindow.m_pFormulabarEntry = gtk_entry_new();
commit 9caca9fe23ac8e193f89a11503d92b058669a660
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Nov 14 15:05:33 2015 +0100
gtktiledviewer: the formula bar is calc-only
Change-Id: Ib989a23e5ece49b6eb16b25bb1fb6f635df25829
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index c16a87b..8ec5ddf 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -303,6 +303,7 @@ gboolean TiledRowColumnBar::docConfigureEvent(GtkWidget* pDocView, GdkEventConfi
}
gtk_widget_show(rWindow.m_pColumnBar->m_pDrawingArea);
gtk_widget_queue_draw(rWindow.m_pColumnBar->m_pDrawingArea);
+ gtk_widget_show(rWindow.m_pFormulabarEntry);
}
return TRUE;
@@ -1188,6 +1189,7 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
gtk_widget_hide(rWindow.m_pCornerButton->m_pDrawingArea);
gtk_widget_hide(rWindow.m_pRowBar->m_pDrawingArea);
gtk_widget_hide(rWindow.m_pColumnBar->m_pDrawingArea);
+ gtk_widget_hide(rWindow.m_pFormulabarEntry);
// Hide the non-progressbar children of the status bar by default.
gtk_widget_hide(rWindow.m_pStatusbarLabel);
gtk_widget_hide(rWindow.m_pZoomLabel);
commit b3dc0d7c72c2bb997bfceaeaf25dc9153ceca244
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Nov 14 14:42:26 2015 +0100
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
diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index bda077b..4d88b46 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 ca7271a..7142898 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 22bb863..867cd2b 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 98aac51..59c11be 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 7999818..69b220b 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) )
More information about the Libreoffice-commits
mailing list