tdf#95374 DOCX import: reset left indentation at disabled numbering

Paragraphs with disabled numbering using non-existent numId=0
haven't got inherited left indentation in MSO. Keeping them resulted
unnecessary indentation, moreover, missing (non-visible) text
in narrow table cells.

Change-Id: I46003031d36f578b0b260dea74d7d45e75905261
Reviewed-on: https://gerrit.libreoffice.org/82509
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
This commit is contained in:
László Németh
2019-11-12 13:33:46 +01:00
parent 1654152b5e
commit 21c29a756c
3 changed files with 13 additions and 0 deletions

Binary file not shown.

View File

@@ -929,6 +929,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf124604, "tdf124604.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "start", "0");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf95374, "tdf95374.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
// Numbering disabled by non-existent numId=0, disabling also inheritance of indentation of parent styles
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "hanging", "0");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "start", "1136");
}
DECLARE_OOXMLEXPORT_TEST(testTdf118691, "tdf118691.docx")
{
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);

View File

@@ -1295,7 +1295,12 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
}
else
{
// eg. disabled numbering using non-existent numId "0"
rContext->Insert( PROP_NUMBERING_STYLE_NAME, uno::makeAny( OUString() ) );
// disable inheritance of indentation of parent styles
rContext->Insert( PROP_PARA_LEFT_MARGIN, uno::makeAny( sal_Int32(0) ), /*bOverwrite=*/false);
rContext->Insert( PROP_PARA_FIRST_LINE_INDENT,
uno::makeAny( sal_Int32(0) ), /*bOverwrite=*/false);
}
}
}