[Libreoffice-commits] .: sw/qa

Miklos Vajna vmiklos at kemper.freedesktop.org
Mon Feb 13 12:56:35 PST 2012


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

New commits:
commit c26d9befbab1f60b5b8c191c883569eae3d08c2d
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Feb 13 21:54:18 2012 +0100

    testcase for fdo#45543

diff --git a/sw/qa/extras/rtftok/data/fdo45543.rtf b/sw/qa/extras/rtftok/data/fdo45543.rtf
new file mode 100644
index 0000000..43a8c89
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo45543.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+{\fonttbl
+{\fdbminor\f31505\fbidi \froman\fcharset128\fprq1\'82\'6c\'82\'72 \'96\'be\'92\'a9;}
+}
+\pard\plain
+\f31505 \'82\'b1\'82\'cc\'95\'b6\'8f\'91\'82\'cd
+\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 2c2252e..df2966f 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -49,11 +49,13 @@ public:
     virtual void tearDown();
     void testFdo45553();
     void testN192129();
+    void testFdo45543();
 
     CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX) && !defined(WNT)
     CPPUNIT_TEST(testFdo45553);
     CPPUNIT_TEST(testN192129);
+    CPPUNIT_TEST(testFdo45543);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -136,6 +138,27 @@ void RtfModelTest::testN192129()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height);
 }
 
+void RtfModelTest::testFdo45543()
+{
+    load(OUString(RTL_CONSTASCII_USTRINGPARAM("fdo45543.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();
+    OUStringBuffer aBuf;
+    while (xParaEnum->hasMoreElements())
+    {
+        uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+        uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
+        while (xRangeEnum->hasMoreElements())
+        {
+            uno::Reference<text::XTextRange> xRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
+            aBuf.append(xRange->getString());
+        }
+    }
+    CPPUNIT_ASSERT_EQUAL(5, aBuf.getLength());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list