diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-04-08 12:19:23 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-04-08 12:25:34 +0200 |
commit | 7b515a57eb6a644860715018656ac0b843b62baf (patch) | |
tree | e7ce8c20160720098d635f6492ebb0d87e598b13 /sw/qa/extras | |
parent | fc9a9166d59a0e7dd89145b7b9937ccf4a21a2b7 (diff) |
test RTF_BKMKSTART and RTF_BKMKEND
Change-Id: I00b258ef3ed89db3b9b8c97bea5ad6673b006398
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/rtfexport/data/bookmark.rtf | 7 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/bookmark.rtf b/sw/qa/extras/rtfexport/data/bookmark.rtf new file mode 100644 index 000000000000..05b3d4235a26 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/bookmark.rtf @@ -0,0 +1,7 @@ +{\rtf1 +{\*\bkmkstart firstword} +Hello +{\*\bkmkend firstword} + world! +\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 6d8fd6f3e12a..ed6b74c5ddee 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -75,6 +75,7 @@ public: void testPlaceholder(); void testMnor(); void testI120928(); + void testBookmark(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -124,6 +125,7 @@ void Test::run() {"placeholder.odt", &Test::testPlaceholder}, {"mnor.rtf", &Test::testMnor}, {"i120928.rtf", &Test::testI120928}, + {"bookmark.rtf", &Test::testBookmark}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -539,6 +541,13 @@ void Test::testI120928() CPPUNIT_ASSERT_EQUAL(true, bIsGraphic); } +void Test::testBookmark() +{ + uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextContent> xBookmark(xBookmarksSupplier->getBookmarks()->getByName("firstword"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Hello"), xBookmark->getAnchor()->getString()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |