From 7ef02b34a47869a582dfd1dc6c1291e20c029eed Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 30 Jul 2015 09:11:35 +0200 Subject: tdf#89720 sw: do not create text range overlay for reply annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/17851 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/qa/extras/uiwriter/data/tdf89720.odt | Bin 0 -> 11283 bytes sw/qa/extras/uiwriter/uiwriter.cxx | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 sw/qa/extras/uiwriter/data/tdf89720.odt (limited to 'sw/qa') diff --git a/sw/qa/extras/uiwriter/data/tdf89720.odt b/sw/qa/extras/uiwriter/data/tdf89720.odt new file mode 100644 index 000000000000..0b86ec51a812 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 b7d0157149a8..e78dc8876e40 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -23,6 +23,9 @@ #include #include #include +#include +#include +#include #include #include @@ -61,6 +64,7 @@ public: void testBookmarkUndo(); void testCp1000115(); void testDde(); + void testTdf89720(); CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST(testReplaceForward); @@ -87,6 +91,7 @@ public: CPPUNIT_TEST(testBookmarkUndo); CPPUNIT_TEST(testCp1000115); CPPUNIT_TEST(testDde); + CPPUNIT_TEST(testTdf89720); CPPUNIT_TEST_SUITE_END(); @@ -679,6 +684,22 @@ void SwUiWriterTest::testDde() CPPUNIT_ASSERT(xField->getString().endsWith("asdf")); } +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(); -- cgit v1.2.3