summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-07-30 09:11:35 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-07-30 09:17:09 +0200
commit780dd8c1cf5302ca503cf7b55357dace4d69beb9 (patch)
tree23c2b5e06dffafdc1242d4de3ac305741870a5a2 /sw/qa/extras/uiwriter
parentcebfe56ae5f9cee4b403370774040f35a17d223c (diff)
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. Change-Id: Ic2673a1a41146ff547262ba681b34a63f41aa8ff
Diffstat (limited to 'sw/qa/extras/uiwriter')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf89720.odtbin0 -> 11283 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx19
2 files changed, 19 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf89720.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 8c06b0d22068..7a8d399e4df2 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -37,6 +37,9 @@
#include <unocrsrhelper.hxx>
#include <unotbl.hxx>
#include <pagedesc.hxx>
+#include <postithelper.hxx>
+#include <PostItMgr.hxx>
+#include <SidebarWin.hxx>
#include "com/sun/star/text/XDefaultNumberingProvider.hpp"
#include "com/sun/star/awt/FontUnderline.hpp"
@@ -138,6 +141,7 @@ public:
void testShapeAnchorUndo();
void testDde();
void testTdf89954();
+ void testTdf89720();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -200,6 +204,7 @@ public:
CPPUNIT_TEST(testShapeAnchorUndo);
CPPUNIT_TEST(testDde);
CPPUNIT_TEST(testTdf89954);
+ CPPUNIT_TEST(testTdf89720);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2063,6 +2068,20 @@ void SwUiWriterTest::testTdf89954()
CPPUNIT_ASSERT_EQUAL(aExpected, aNodeIndex.GetNode().GetTextNode()->GetText());
}
+void SwUiWriterTest::testTdf89720()
+{
+ 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());
+ }
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();