[Libreoffice-commits] core.git: sw/qa writerfilter/source
Mark Hung
marklh9 at gmail.com
Wed Jan 4 12:19:53 UTC 2017
sw/qa/extras/rtfexport/data/tdf104085.rtf |binary
sw/qa/extras/rtfexport/rtfexport.cxx | 16 ++++++++++++++++
writerfilter/source/rtftok/rtfdispatchflag.cxx | 4 ++--
3 files changed, 18 insertions(+), 2 deletions(-)
New commits:
commit 289d42c8e24946ca099462fc5f71d0a46d3a8ad5
Author: Mark Hung <marklh9 at gmail.com>
Date: Sat Dec 24 00:06:34 2016 +0800
tdf#104085 Replace number format code literal with ooxml enumeration.
Liberals of Number format code (NFC) were no longer recognized
by dmapper after it had been removed in
d30a8ec448bcd08c6a52a37d6ae41a4b71c235da.
Replace them with enumeration.
Change-Id: I3ed1e09d9f3987fce95bd708b9c0b0568d3f15f9
Reviewed-on: https://gerrit.libreoffice.org/32527
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Mark Hung <marklh9 at gmail.com>
diff --git a/sw/qa/extras/rtfexport/data/tdf104085.rtf b/sw/qa/extras/rtfexport/data/tdf104085.rtf
new file mode 100755
index 0000000..7deda53
Binary files /dev/null and b/sw/qa/extras/rtfexport/data/tdf104085.rtf differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 1e353dc..4288d3f 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1142,6 +1142,22 @@ DECLARE_RTFEXPORT_TEST(testTdf104228, "tdf104228.rtf")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xParagraph, "ParaLeftMargin"));
}
+
+DECLARE_RTFEXPORT_TEST(testTdf104085, "tdf104085.rtf")
+{
+ uno::Reference<text::XTextRange> xPara(getParagraph(1));
+ uno::Reference< beans::XPropertySet > properties( xPara, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xLevels( properties->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aProps;
+ xLevels->getByIndex(0) >>= aProps;
+ for (int i = 0; i < aProps.getLength(); ++i)
+ {
+ if (aProps[i].Name == "BulletChar")
+ return;
+ }
+ CPPUNIT_FAIL("no BulletChar property");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx b/writerfilter/source/rtftok/rtfdispatchflag.cxx
index aa3c41c..98b212b 100644
--- a/writerfilter/source/rtftok/rtfdispatchflag.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx
@@ -969,14 +969,14 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
break;
case RTF_PNDEC:
{
- auto pValue = std::make_shared<RTFValue>(0); // decimal, same as \levelnfc0
+ auto pValue = std::make_shared<RTFValue>(NS_ooxml::LN_Value_ST_NumberFormat_decimal);
m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Lvl_numFmt, pValue);
}
break;
case RTF_PNLVLBLT:
{
m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_AbstractNum_nsid, std::make_shared<RTFValue>(1));
- m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Lvl_numFmt, std::make_shared<RTFValue>(23)); // bullets, same as \levelnfc23
+ m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Lvl_numFmt, std::make_shared<RTFValue>(NS_ooxml::LN_Value_ST_NumberFormat_bullet));
}
break;
case RTF_LANDSCAPE:
More information about the Libreoffice-commits
mailing list