summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-02-11 12:59:49 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-02-11 13:27:47 +0100
commitbd505fdb9f669f365ff39b0ef46f0742c638e333 (patch)
tree5e8530c6de1dae3a3664b357c64b69cad37eefb4 /sw/qa
parent6865445a5ec90b49c5fde58531def4b9a64f26e8 (diff)
fdo#59573 position after fieldmark and before annotation anchor is read-only
Also revert "SwTxtPaintInfo::_DrawBackBrush: draw dark border around comment highlight" (commit 57c8c34fcdc2d594d2da3593eb9d86d0daf4e18c), as it draws confusing vertical lines inside the comment when it has multiple runs. Change-Id: If0f60e4a28878c2b31327ae3c04ae11470bc1f52
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/core/uwriter.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 189a25cf2476..5f94c84ba2dd 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -91,6 +91,7 @@ public:
void testUserPerceivedCharCount();
void testGraphicAnchorDeletion();
void testFdo57938();
+ void testFdo59573();
CPPUNIT_TEST_SUITE(SwDocTest);
CPPUNIT_TEST(randomTest);
@@ -102,6 +103,7 @@ public:
CPPUNIT_TEST(testUserPerceivedCharCount);
CPPUNIT_TEST(testGraphicAnchorDeletion);
CPPUNIT_TEST(testFdo57938);
+ CPPUNIT_TEST(testFdo59573);
CPPUNIT_TEST_SUITE_END();
private:
@@ -896,6 +898,26 @@ void SwDocTest::testFdo57938()
CPPUNIT_ASSERT_EQUAL(false, aPaM.HasReadonlySel(false));
}
+void SwDocTest::testFdo59573()
+{
+ SwNodeIndex aIdx(m_pDoc->GetNodes().GetEndOfContent(), -1);
+ SwPaM aPaM(aIdx);
+
+ // Insert "abc" and create a fieldmark around "b".
+ OUString aTest("abc");
+ m_pDoc->InsertString(aPaM, aTest);
+ aPaM.SetMark();
+ aPaM.GetPoint()->nContent = 1;
+ aPaM.GetMark()->nContent = 2;
+ IDocumentMarkAccess* pMarksAccess = m_pDoc->getIDocumentMarkAccess();
+ pMarksAccess->makeFieldBookmark(aPaM, "", ODF_COMMENTRANGE);
+ aPaM.GetPoint()->nContent = 4;
+ aPaM.GetMark()->nContent = 4;
+ // The problem was that the position after the fieldmark end and before the
+ // annotation anchor wasn't read-only.
+ CPPUNIT_ASSERT_EQUAL(true, aPaM.HasReadonlySel(false));
+}
+
void SwDocTest::setUp()
{
BootstrapFixture::setUp();