summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2016-12-24 00:06:34 +0800
committerMark Hung <marklh9@gmail.com>2017-01-04 12:19:31 +0000
commit289d42c8e24946ca099462fc5f71d0a46d3a8ad5 (patch)
treeddf1071be6abcabd553f0e17029b894835c92158
parent1677faabbf7ae56e233205251b78b77d28937c35 (diff)
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@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
-rwxr-xr-xsw/qa/extras/rtfexport/data/tdf104085.rtfbin0 -> 348 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx16
-rw-r--r--writerfilter/source/rtftok/rtfdispatchflag.cxx4
3 files changed, 18 insertions, 2 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf104085.rtf b/sw/qa/extras/rtfexport/data/tdf104085.rtf
new file mode 100755
index 000000000000..7deda534eaee
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf104085.rtf
Binary files differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 1e353dc2a99d..4288d3fb7dcf 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 aa3c41ce05db..98b212b48386 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: