summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-18 09:05:12 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-18 09:05:33 +0100
commit2608512056b706bab57e36765e15f5c00668577a (patch)
tree57950007dfd0db0e8d7b35213bc4f88e8514c22e /sw/qa/extras
parentdca29d672a7a908972fa2735a44fa51fc75c2e93 (diff)
fdo#86131 SwXTextField::getAnchor: handle postit field with annotation mark
Change-Id: I3881c4577375a2eda053f64800d0991de6f009ad
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 3165de755314..4fa1680239c2 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -443,6 +443,13 @@ void SwUiWriterTest::testCommentedWord()
SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false);
// This was 9, only "word", not "word<anchor character>" was selected.
CPPUNIT_ASSERT_EQUAL(sal_Int32(10), pShellCrsr->End()->nContent.GetIndex());
+
+ // Test that getAnchor() points to "word", not to an empty string.
+ uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+ uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+ uno::Reference<text::XTextContent> xField(xFields->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("word"), xField->getAnchor()->getString());
}