sw/qa/extras/uiwriter/data/tdf89720.odt |binary sw/qa/extras/uiwriter/uiwriter.cxx | 21 +++++++++++++++++++++ sw/source/uibase/docvw/SidebarWin.cxx | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-)
New commits: commit 545a0c19494a7d55e514831b9a4d81197ab01c57 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Jul 30 09:11:35 2015 +0200 tdf#89720 sw: do not create text range overlay for reply annotations Regression from commit 0761f81643a6890457e9ef7d913ab5c88c2593a4 (123792: complete annotations on text ranges feature, 2013-12-19), the problem was that in case a comment had a reply, then both comments produced its range overlay, and this repeated semi-transparent overlay resulted in dark color. Go back to the old behavior of just painting the overlay for the non-reply comment; for real, partly overlapping comments showing the exact boundaries of the overlapping overlays still makes sense. (cherry picked from commit 780dd8c1cf5302ca503cf7b55357dace4d69beb9) Conflicts: sw/qa/extras/uiwriter/uiwriter.cxx Change-Id: Ic2673a1a41146ff547262ba681b34a63f41aa8ff Reviewed-on: https://gerrit.libreoffice.org/17669 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/extras/uiwriter/data/tdf89720.odt b/sw/qa/extras/uiwriter/data/tdf89720.odt new file mode 100644 index 0000000..0b86ec5 Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf89720.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 1fc636c..6b8b053 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -33,6 +33,9 @@ #include <editeng/acorrcfg.hxx> #include <unotools/streamwrap.hxx> #include <test/mtfxmldump.hxx> +#include <postithelper.hxx> +#include <PostItMgr.hxx> +#include <SidebarWin.hxx> #include <svx/svdpage.hxx> #include <svx/svdview.hxx> @@ -98,6 +101,7 @@ public: void testTdf90883TableBoxGetCoordinates(); void testDde(); void testTdf89954(); + void testTdf89720(); CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST(testReplaceForward); @@ -137,6 +141,7 @@ public: CPPUNIT_TEST(testTdf90883TableBoxGetCoordinates); CPPUNIT_TEST(testDde); CPPUNIT_TEST(testTdf89954); + CPPUNIT_TEST(testTdf89720); CPPUNIT_TEST_SUITE_END(); @@ -1044,6 +1049,22 @@ void SwUiWriterTest::testTdf89954() CPPUNIT_ASSERT_EQUAL(aExpected, aNodeIndex.GetNode().GetTextNode()->GetText()); } +void SwUiWriterTest::testTdf89720() +{ +#ifndef MACOSX + SwDoc* pDoc = createDoc("tdf89720.odt"); + SwView* pView = pDoc->GetDocShell()->GetView(); + SwPostItMgr* pPostItMgr = pView->GetPostItMgr(); + for (SwSidebarItem* pItem : *pPostItMgr) + { + if (pItem->pPostIt->IsFollow()) + // This was non-0: reply comments had a text range overlay, + // resulting in unexpected dark color. + CPPUNIT_ASSERT(!pItem->pPostIt->TextRange()); + } +#endif +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index 6b81496..9825839 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -703,8 +703,9 @@ void SwSidebarWin::SetPosAndSize() mpTextRangeOverlay->HideSolidBorder(); } } - else + else if (!IsFollow()) { + // This window is not a reply, then draw its range overlay. mpTextRangeOverlay = sw::overlay::OverlayRanges::CreateOverlayRange( DocView(),
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits