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
d30a8ec448.

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>
This commit is contained in:
Mark Hung
2016-12-24 00:06:34 +08:00
parent 1677faabbf
commit 289d42c8e2
3 changed files with 18 additions and 2 deletions

Binary file not shown.

View File

@@ -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: */

View File

@@ -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: