Kaydet (Commit) c72a1a74 authored tarafından Miklos Vajna's avatar Miklos Vajna

Related: tdf#112211 DOCX import: fix handling of missing first ind in <w:lvl>

Usually a DOCX numbering definition has multiple levels, each level
containing a <w:ind ... w:hanging="..."/> element. When this is missing,
we should default to the Word default, not to the Writer one.

This makes the DOCX version of tdf#106953 imported correctly, in
preparation of dropping the original fix that helped RTF only.

[ The DOC version of the bugdoc is still not imported correctly. ]

Change-Id: Ib7fc1de55316a73188c023665a585ac7056341f7
Reviewed-on: https://gerrit.libreoffice.org/42447Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst f00ca5f2
......@@ -845,6 +845,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf44986, "tdf44986.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength());
}
DECLARE_OOXMLEXPORT_TEST(testTdf106953, "tdf106953.docx")
{
uno::Reference<container::XIndexAccess> xRules = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules");
// This was -635, so the tab of the numbering expanded to a small value instead of matching Word's larger value.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), comphelper::SequenceAsHashMap(xRules->getByIndex(0))["FirstLineIndent"].get<sal_Int32>());
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -304,6 +304,9 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( )
boost::optional<PropertyMap::Property> aProp = getProperty(rReadId);
if (aProp)
aNumberingProperties.emplace_back( getPropertyName(aProp->first), 0, aProp->second, beans::PropertyState_DIRECT_VALUE );
else if (rReadId == PROP_FIRST_LINE_INDENT)
// Writer default is -360 twips, Word default seems to be 0.
aNumberingProperties.emplace_back("FirstLineIndent", 0, uno::makeAny(static_cast<sal_Int32>(0)), beans::PropertyState_DIRECT_VALUE);
}
boost::optional<PropertyMap::Property> aPropFont = getProperty(PROP_CHAR_FONT_NAME);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment