[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sw/inc sw/qa sw/source
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Fri Nov 25 14:07:16 UTC 2016
sw/inc/SidebarWin.hxx | 1 +
sw/qa/extras/tiledrendering/tiledrendering.cxx | 8 ++++++++
sw/source/uibase/docvw/PostItMgr.cxx | 3 +++
sw/source/uibase/docvw/SidebarWin.cxx | 14 ++++++++++----
4 files changed, 22 insertions(+), 4 deletions(-)
New commits:
commit b0b7d40c95363c8ca5d460fe603d6cb3e11729b8
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Tue Nov 22 17:04:19 2016 -0500
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 at libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
(cherry picked from commit 9d2f30911de2f9d87cebb1a360fabe0bf9c05294)
Reviewed-on: https://gerrit.libreoffice.org/31203
diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index c6738fa..626e4ee 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 eb64e9f..b787352 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -1507,6 +1507,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 62dd7cc..4509bee 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -743,7 +743,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 20cab03..83ea78d 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -1214,10 +1214,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()
@@ -1235,6 +1232,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();
More information about the Libreoffice-commits
mailing list