summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-11-22 17:04:19 -0500
committerAndras Timar <andras.timar@collabora.com>2017-02-17 12:29:12 +0100
commit1c08313e1ef7fe3d753634fccdfcda31cc88691e (patch)
tree0e576f53513c6e13bbd2020570e96437ab8e6bc8 /sw
parent9d4177da27650c963caf0a4880dc5ffb8e4468bc (diff)
Lok: invalidate Writer comments correctly
Because notifications to all views were disabled (to avoid moving the cursors of everyone when someone adds a comment) invalidation was also broken. The issue was observed when a comment crossed tile boundaries, the other tile was not redrawn. This forces invalidation so tiles are rendered correctly, fixing this regression. One small issue remains in that invalidating a comment only invalidates the text-area and not the complete PostIt (specifically, the author and date are not invalidated). This means that they can still get trimmed when crossing tile boundaries. That will be addressed separately, as it was an existing issue before the regression this patch fixes. Change-Id: Ic8173e4873d58836883b897f735fc627bb0572ee Reviewed-on: https://gerrit.libreoffice.org/31091 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit 9d2f30911de2f9d87cebb1a360fabe0bf9c05294)
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/SidebarWin.hxx1
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx8
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx3
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx14
4 files changed, 22 insertions, 4 deletions
diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index 579a97432022..adfb47c16118 100644
--- a/sw/inc/SidebarWin.hxx
+++ b/sw/inc/SidebarWin.hxx
@@ -119,6 +119,7 @@ class SwSidebarWin : public vcl::Window
void ShowAnchorOnly(const Point &aPoint);
void ShowNote();
void HideNote();
+ void InvalidateControl();
void ResetAttributes();
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 7b441d67648a..19a40665d2df 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -1506,6 +1506,14 @@ void SwTiledRenderingTest::testCommentEndTextEdit()
// of the comment.
CPPUNIT_ASSERT(!aView1.m_bOwnCursorAtOrigin);
+ // Hit enter and expect invalidation.
+ Scheduler::ProcessEventsToIdle();
+ aView1.m_bTilesInvalidated = false;
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RETURN);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
+
mxComponent->dispose();
mxComponent.clear();
comphelper::LibreOfficeKit::setActive(false);
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 0cacd24fdfba..625d6425feea 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -742,7 +742,10 @@ void SwPostItMgr::LayoutPostIts()
comphelper::LibreOfficeKit::setTiledPainting(!(*i)->HasChildPathFocus());
(*i)->ShowNote();
if (!bTiledPainting)
+ {
comphelper::LibreOfficeKit::setTiledPainting(bTiledPainting);
+ (*i)->InvalidateControl();
+ }
}
else
{
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 9d8e7d640ebd..a1a8224c8342 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -1199,10 +1199,7 @@ void SwSidebarWin::ShowNote()
mpAnchor->setVisible(true);
// Invalidate.
- mpSidebarTextControl->Push(PushFlags::MAPMODE);
- lcl_translateTwips(EditWin(), *mpSidebarTextControl, nullptr);
- mpSidebarTextControl->Invalidate();
- mpSidebarTextControl->Pop();
+ InvalidateControl();
}
void SwSidebarWin::HideNote()
@@ -1220,6 +1217,15 @@ void SwSidebarWin::HideNote()
mpShadow->setVisible(false);
}
+void SwSidebarWin::InvalidateControl()
+{
+ // Invalidate.
+ mpSidebarTextControl->Push(PushFlags::MAPMODE);
+ lcl_translateTwips(EditWin(), *mpSidebarTextControl, nullptr);
+ mpSidebarTextControl->Invalidate();
+ mpSidebarTextControl->Pop();
+}
+
void SwSidebarWin::ActivatePostIt()
{
mrMgr.AssureStdModeAtShell();