summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-05-10 10:35:47 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-05-10 10:53:20 +0200
commitf55c92211630b4e90531645dbd8ae3350fd9a437 (patch)
treea3a106bcac2529690988b902e2452939f14858ce
parenta9550f63cd7a7e064901b2c997375ed384781eea (diff)
fdo#49692 RTFValue::Clone(): copy m_bForceString as well
Change-Id: Ib8f06ff33fd9c01ea4a1e47c97cfa12f2ced7318
-rw-r--r--sw/qa/extras/rtftok/data/fdo49692.rtf17
-rw-r--r--sw/qa/extras/rtftok/rtftok.cxx25
-rw-r--r--writerfilter/source/rtftok/rtfvalue.cxx6
-rw-r--r--writerfilter/source/rtftok/rtfvalue.hxx2
4 files changed, 46 insertions, 4 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo49692.rtf b/sw/qa/extras/rtftok/data/fdo49692.rtf
new file mode 100644
index 000000000000..bcd7004e627d
--- /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 92f722c3a533..bff076a47954 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 530bb1c71d92..13613fa060c7 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 c2ad524f0fae..d5c6b3e7ae79 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);