[Libreoffice-commits] .: sw/qa

Miklos Vajna vmiklos at kemper.freedesktop.org
Mon Mar 19 02:56:29 PDT 2012


 sw/qa/extras/rtftok/data/n751020.rtf |    8 ++++++++
 sw/qa/extras/rtftok/rtftok.cxx       |   15 +++++++++++++++
 2 files changed, 23 insertions(+)

New commits:
commit 9415e8c6c3089be3c4c78e3878163eda3e2bd873
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Mar 19 10:45:28 2012 +0100

    testcase for n#751020

diff --git a/sw/qa/extras/rtftok/data/n751020.rtf b/sw/qa/extras/rtftok/data/n751020.rtf
new file mode 100644
index 0000000..66175cf
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/n751020.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+{\stylesheet
+{Normal;}
+}
+\linkstyles
+first\par
+second\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index c376779..7483634 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -67,6 +67,7 @@ public:
     void testN750757();
     void testFdo45563();
     void testFdo43965();
+    void testN751020();
 
     CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX) && !defined(WNT)
@@ -80,6 +81,7 @@ public:
     CPPUNIT_TEST(testN750757);
     CPPUNIT_TEST(testFdo45563);
     CPPUNIT_TEST(testFdo43965);
+    CPPUNIT_TEST(testN751020);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -374,6 +376,19 @@ void RtfModelTest::testFdo43965()
     CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor->getPage());
 }
 
+void RtfModelTest::testN751020()
+{
+    load(OUString(RTL_CONSTASCII_USTRINGPARAM("n751020.rtf")));
+    uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+    uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+    CPPUNIT_ASSERT(xParaEnum->hasMoreElements());
+    uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
+    sal_Int32 nValue = 0;
+    xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaBottomMargin"))) >>= nValue;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(200)), nValue);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list