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

bnc#939996 tdf#93919 DOCX import: fix left-from-style and first-from-direct

With this, <w:ind w:hanging="..."/> as direct paragraph formatting and
<w:ind w:left="..." w:hanging="..."/> as a numbering level formatting is
properly merged, i.e. w:left is not lost, defaulting to 0.

Change-Id: If5534fbd9ee6d41139b0ed3a3df9d0cc5aad3239
üst 827e78fc
......@@ -2846,6 +2846,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf90153, "tdf90153.docx")
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
}
DECLARE_OOXMLIMPORT_TEST(testTdf93919, "tdf93919.docx")
{
// This was 0, left margin was not inherited from the list style.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin"));
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -480,6 +480,11 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
sal_Int32 nValue = ConversionHelper::convertTwipToMM100( nIntValue );
m_pImpl->GetTopContext()->Insert(
PROP_PARA_FIRST_LINE_INDENT, uno::makeAny( - nValue ));
// See above, need to inherit left margin from list style when first is set.
sal_Int32 nParaLeftMargin = m_pImpl->getCurrentNumberingProperty("IndentAt");
if (nParaLeftMargin != 0)
m_pImpl->GetTopContext()->Insert(PROP_PARA_LEFT_MARGIN, uno::makeAny(nParaLeftMargin), /*bOverwrite=*/false);
}
break;
case NS_ooxml::LN_CT_Ind_firstLine:
......
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