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

Miklos Vajna vmiklos at kemper.freedesktop.org
Thu May 10 01:53:18 PDT 2012


 sw/qa/extras/rtftok/data/fdo49692.rtf   |   17 +++++++++++++++++
 sw/qa/extras/rtftok/rtftok.cxx          |   25 +++++++++++++++++++++++++
 writerfilter/source/rtftok/rtfvalue.cxx |    6 +++---
 writerfilter/source/rtftok/rtfvalue.hxx |    2 +-
 4 files changed, 46 insertions(+), 4 deletions(-)

New commits:
commit f55c92211630b4e90531645dbd8ae3350fd9a437
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu May 10 10:35:47 2012 +0200

    fdo#49692 RTFValue::Clone(): copy m_bForceString as well
    
    Change-Id: Ib8f06ff33fd9c01ea4a1e47c97cfa12f2ced7318

diff --git a/sw/qa/extras/rtftok/data/fdo49692.rtf b/sw/qa/extras/rtftok/data/fdo49692.rtf
new file mode 100644
index 0000000..bcd7004
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo49692.rtf
@@ -0,0 +1,17 @@
+{\rtf1
+{\*\listtable
+{\list\listtemplateid1
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0
+{\leveltext \'00;}
+{\levelnumbers;}
+\fi0\li0}
+\listid1}
+}
+{\listoverridetable
+{\listoverride\listid1\listoverridecount0\ls1}
+}
+\ilvl0
+\ls1
+EULA
+\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 92f722c..bff076a 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -91,6 +91,7 @@ public:
     void testN757651();
     void testFdo49501();
     void testFdo49271();
+    void testFdo49692();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -125,6 +126,7 @@ public:
     CPPUNIT_TEST(testN757651);
     CPPUNIT_TEST(testFdo49501);
     CPPUNIT_TEST(testFdo49271);
+    CPPUNIT_TEST(testFdo49692);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -696,6 +698,29 @@ void Test::testFdo49271()
     CPPUNIT_ASSERT_EQUAL(25.f, fValue);
 }
 
+void Test::testFdo49692()
+{
+    load("fdo49692.rtf");
+
+    uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
+    uno::Sequence<beans::PropertyValue> aProps;
+    xLevels->getByIndex(0) >>= aProps; // 1st level
+
+    for (int i = 0; i < aProps.getLength(); ++i)
+    {
+        const beans::PropertyValue& rProp = aProps[i];
+
+        if (rProp.Name == "Suffix")
+        {
+            rtl::OUString sValue;
+            rProp.Value >>= sValue;
+
+            CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength());
+        }
+    }
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfvalue.cxx b/writerfilter/source/rtftok/rtfvalue.cxx
index 530bb1c..13613fa 100644
--- a/writerfilter/source/rtftok/rtfvalue.cxx
+++ b/writerfilter/source/rtftok/rtfvalue.cxx
@@ -35,12 +35,12 @@ using rtl::OUString;
 
 RTFValue::RTFValue(int nValue, rtl::OUString sValue, RTFSprms rAttributes,
         RTFSprms rSprms, uno::Reference<drawing::XShape> xShape,
-        uno::Reference<io::XInputStream> xStream)
+        uno::Reference<io::XInputStream> xStream, bool bForceString)
     : m_nValue(nValue),
     m_sValue(sValue),
     m_xShape(xShape),
     m_xStream(xStream),
-    m_bForceString(false)
+    m_bForceString(bForceString)
 {
     m_pAttributes.reset(new RTFSprms(rAttributes));
     m_pSprms.reset(new RTFSprms(rSprms));
@@ -176,7 +176,7 @@ std::string RTFValue::toString() const
 
 RTFValue* RTFValue::Clone()
 {
-    return new RTFValue(m_nValue, m_sValue, *m_pAttributes, *m_pSprms, m_xShape, m_xStream);
+    return new RTFValue(m_nValue, m_sValue, *m_pAttributes, *m_pSprms, m_xShape, m_xStream, m_bForceString);
 }
 
 RTFSprms& RTFValue::getAttributes()
diff --git a/writerfilter/source/rtftok/rtfvalue.hxx b/writerfilter/source/rtftok/rtfvalue.hxx
index c2ad524..d5c6b3e 100644
--- a/writerfilter/source/rtftok/rtfvalue.hxx
+++ b/writerfilter/source/rtftok/rtfvalue.hxx
@@ -41,7 +41,7 @@ namespace writerfilter {
             public:
                 typedef boost::shared_ptr<RTFValue> Pointer_t;
                 RTFValue(int nValue, rtl::OUString sValue, RTFSprms rAttributes, RTFSprms rSprms, uno::Reference<drawing::XShape> rShape,
-                        uno::Reference<io::XInputStream> rStream);
+                        uno::Reference<io::XInputStream> rStream, bool bForceString);
                 RTFValue(int nValue);
                 RTFValue(rtl::OUString sValue, bool bForce = false);
                 RTFValue(RTFSprms rAttributes);


More information about the Libreoffice-commits mailing list