[Libreoffice-commits] .: sw/qa

Miklos Vajna vmiklos at kemper.freedesktop.org
Tue Mar 13 02:19:30 PDT 2012


 sw/qa/extras/rtftok/data/fdo45563.rtf |    5 +++++
 sw/qa/extras/rtftok/rtftok.cxx        |   17 +++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit e5823e8513eee31fd96549a4b0273063ed31b192
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Mar 13 10:16:27 2012 +0100

    testcase for fdo#45563

diff --git a/sw/qa/extras/rtftok/data/fdo45563.rtf b/sw/qa/extras/rtftok/data/fdo45563.rtf
new file mode 100644
index 0000000..3dd3fd0
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo45563.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+only n\
+only r\
both r and n\
+last\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index c11af26..95fc51b 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -63,6 +63,7 @@ public:
     void testFdo45187();
     void testFdo46662();
     void testN750757();
+    void testFdo45563();
 
     CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX) && !defined(WNT)
@@ -74,6 +75,7 @@ public:
     CPPUNIT_TEST(testFdo45187);
     CPPUNIT_TEST(testFdo46662);
     CPPUNIT_TEST(testN750757);
+    CPPUNIT_TEST(testFdo45563);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -322,6 +324,21 @@ void RtfModelTest::testN750757()
     CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue);
 }
 
+void RtfModelTest::testFdo45563()
+{
+    load(OUString(RTL_CONSTASCII_USTRINGPARAM("fdo45563.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();
+    int i = 0;
+    while (xParaEnum->hasMoreElements())
+    {
+        xParaEnum->nextElement();
+        i++;
+    }
+    CPPUNIT_ASSERT_EQUAL(4, i);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list