[Libreoffice-commits] .: sw/qa writerfilter/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Mon May 7 00:50:17 PDT 2012


 sw/qa/extras/rtftok/data/fdo38786.rtf          |    2 ++
 sw/qa/extras/rtftok/rtftok.cxx                 |   13 +++++++++++++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    9 +++++++++
 3 files changed, 24 insertions(+)

New commits:
commit 116016d5160302413d5c2c97c436c5e4f6383338
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon May 7 09:50:02 2012 +0200

    fdo#38786 implement RTF_CHPGN
    
    Change-Id: I0ae693193b4fc8ed155e2d71b06daa80d46da47c

diff --git a/sw/qa/extras/rtftok/data/fdo38786.rtf b/sw/qa/extras/rtftok/data/fdo38786.rtf
new file mode 100644
index 0000000..6397cee
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo38786.rtf
@@ -0,0 +1,2 @@
+{\rtf1\chpgn
+\par}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 137062a..1f340b5 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -92,6 +92,7 @@ public:
     void testFdo44211();
     void testFdo48037();
     void testFdo47764();
+    void testFdo38786();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -122,6 +123,7 @@ public:
     CPPUNIT_TEST(testFdo44211);
     CPPUNIT_TEST(testFdo48037);
     CPPUNIT_TEST(testFdo47764);
+    CPPUNIT_TEST(testFdo38786);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -676,6 +678,17 @@ void Test::testFdo47764()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue);
 }
 
+void Test::testFdo38786()
+{
+    load("fdo38786.rtf");
+
+    uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+    uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+    // \chpgn was ignored, so exception was thrown
+    xFields->nextElement();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index d8fa4c3..16ca2ec 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1552,6 +1552,15 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
                     parBreak();
             }
             break;
+        case RTF_CHPGN:
+            {
+                OUString aStr("PAGE");
+                singleChar(0x13);
+                text(aStr);
+                singleChar(0x14);
+                singleChar(0x15);
+            }
+            break;
         default:
             SAL_INFO("writerfilter", OSL_THIS_FUNC << ": TODO handle symbol '" << lcl_RtfToString(nKeyword) << "'");
             aSkip.setParsed(false);


More information about the Libreoffice-commits mailing list