Kaydet (Commit) 85c8252e authored tarafından Miklos Vajna's avatar Miklos Vajna

test RtfAttributeOutput::StartURL()

Change-Id: I66f527ff7463852f65e1a3f02ddcea60d329147a
üst 5c0f6c6f
{\rtf1
Hello
{\field
{\*\fldinst HYPERLINK "http://en.wikipedia.org/wiki/World" }
{\fldrslt world}
}
!}
\par
}
...@@ -76,6 +76,7 @@ public: ...@@ -76,6 +76,7 @@ public:
void testMnor(); void testMnor();
void testI120928(); void testI120928();
void testBookmark(); void testBookmark();
void testHyperlink();
CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT) #if !defined(MACOSX) && !defined(WNT)
...@@ -126,6 +127,7 @@ void Test::run() ...@@ -126,6 +127,7 @@ void Test::run()
{"mnor.rtf", &Test::testMnor}, {"mnor.rtf", &Test::testMnor},
{"i120928.rtf", &Test::testI120928}, {"i120928.rtf", &Test::testI120928},
{"bookmark.rtf", &Test::testBookmark}, {"bookmark.rtf", &Test::testBookmark},
{"hyperlink.rtf", &Test::testHyperlink},
}; };
// Don't test the first import of these, for some reason those tests fail // Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = { const char* aBlacklist[] = {
...@@ -548,6 +550,13 @@ void Test::testBookmark() ...@@ -548,6 +550,13 @@ void Test::testBookmark()
CPPUNIT_ASSERT_EQUAL(OUString("Hello"), xBookmark->getAnchor()->getString()); 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_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment