sw/qa/extras/rtfexport/data/bookmark.rtf | 7 +++++++ sw/qa/extras/rtfexport/rtfexport.cxx | 9 +++++++++ 2 files changed, 16 insertions(+)
New commits: commit 7b515a57eb6a644860715018656ac0b843b62baf Author: Miklos Vajna <vmik...@suse.cz> Date: Mon Apr 8 12:19:23 2013 +0200 test RTF_BKMKSTART and RTF_BKMKEND Change-Id: I00b258ef3ed89db3b9b8c97bea5ad6673b006398 diff --git a/sw/qa/extras/rtfexport/data/bookmark.rtf b/sw/qa/extras/rtfexport/data/bookmark.rtf new file mode 100644 index 0000000..05b3d42 --- /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 6d8fd6f..ed6b74c 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits