diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-04-08 14:39:54 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-04-08 14:45:53 +0200 |
commit | 85c8252e13e9234253494f96ffd70df35be056dc (patch) | |
tree | 7ecd60144a3b48e45bd05b79a0e28041733e3692 | |
parent | 5c0f6c6f6d3a708a82e80820f53870cb8a490e37 (diff) |
test RtfAttributeOutput::StartURL()
Change-Id: I66f527ff7463852f65e1a3f02ddcea60d329147a
-rw-r--r-- | sw/qa/extras/rtfexport/data/hyperlink.rtf | 9 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/hyperlink.rtf b/sw/qa/extras/rtfexport/data/hyperlink.rtf new file mode 100644 index 000000000000..90708a3de743 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/hyperlink.rtf @@ -0,0 +1,9 @@ +{\rtf1 +Hello +{\field +{\*\fldinst HYPERLINK "http://en.wikipedia.org/wiki/World" } +{\fldrslt world} +} +!} +\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index ed6b74c5ddee..ba8defd3a117 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -76,6 +76,7 @@ public: void testMnor(); void testI120928(); void testBookmark(); + void testHyperlink(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -126,6 +127,7 @@ void Test::run() {"mnor.rtf", &Test::testMnor}, {"i120928.rtf", &Test::testI120928}, {"bookmark.rtf", &Test::testBookmark}, + {"hyperlink.rtf", &Test::testHyperlink}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -548,6 +550,13 @@ void Test::testBookmark() CPPUNIT_ASSERT_EQUAL(OUString("Hello"), xBookmark->getAnchor()->getString()); } +void Test::testHyperlink() +{ + CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(getRun(getParagraph(1), 1, "Hello"), "HyperLinkURL")); + CPPUNIT_ASSERT_EQUAL(OUString("http://en.wikipedia.org/wiki/World"), getProperty<OUString>(getRun(getParagraph(1), 2, "world"), "HyperLinkURL")); + CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(getRun(getParagraph(1), 3, "!"), "HyperLinkURL")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |