[Libreoffice-commits] core.git: sw/qa

Miklos Vajna vmiklos at suse.cz
Mon Apr 8 05:46:13 PDT 2013


 sw/qa/extras/rtfexport/data/hyperlink.rtf |    9 +++++++++
 sw/qa/extras/rtfexport/rtfexport.cxx      |    9 +++++++++
 2 files changed, 18 insertions(+)

New commits:
commit 85c8252e13e9234253494f96ffd70df35be056dc
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Apr 8 14:39:54 2013 +0200

    test RtfAttributeOutput::StartURL()
    
    Change-Id: I66f527ff7463852f65e1a3f02ddcea60d329147a

diff --git a/sw/qa/extras/rtfexport/data/hyperlink.rtf b/sw/qa/extras/rtfexport/data/hyperlink.rtf
new file mode 100644
index 0000000..90708a3
--- /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 ed6b74c..ba8defd 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();


More information about the Libreoffice-commits mailing list