summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-08-22 09:10:04 +0300
committerJustin Luth <justin_luth@sil.org>2018-08-23 06:24:01 +0200
commit352efa5b3cb7d025b9a299e2fcade5f7822ed043 (patch)
treea1ead612c50546afdd58dc06dd385b7b4f96c0b2 /sw
parent2d0b1b9dec9a2f72269a7bc6cc8d47e080c54dc1 (diff)
related tdf#76683 docx export: use firstLine, not hanging
for negative first line indents. TwipMeasure must be positive even though contrary to their documentation, Microsoft still uses the negative number. So this should have no noticable impact, other than making the output valid. Change-Id: Iafd9411c748f086dde3165c2ac7229b17a2312ab Reviewed-on: https://gerrit.libreoffice.org/59423 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx7
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx3
2 files changed, 9 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 57955e46e7f1..51287c7035cd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -1148,6 +1148,13 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXOptionButtonGroup, "activex_option_button_gr
DECLARE_OOXMLEXPORT_TEST(tdf112169, "tdf112169.odt")
{
// LO crashed while export because of character background color handling
+
+ //tdf76683 - Cannot be negative number - use firstLine instead of hanging
+ xmlDocPtr pXmlDoc = parseExport("word/numbering.xml");
+ if (!pXmlDoc)
+ return;
+ assertXPathNoAttribute(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w:ind", "hanging");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w:ind", "firstLine","360");
}
DECLARE_OOXMLEXPORT_TEST(testTdf103090, "tdf103090.odt")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 00412096bbde..845763404813 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6635,9 +6635,10 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
}
sal_Int32 nToken = ecmaDialect ? XML_left : XML_start;
+ sal_Int32 nIndentToken = nFirstLineIndex > 0 ? XML_firstLine : XML_hanging;
m_pSerializer->singleElementNS( XML_w, XML_ind,
FSNS( XML_w, nToken ), OString::number( nIndentAt ).getStr(),
- FSNS( XML_w, XML_hanging ), OString::number( -nFirstLineIndex ).getStr(),
+ FSNS( XML_w, nIndentToken ), OString::number( abs(nFirstLineIndex) ).getStr(),
FSEND );
m_pSerializer->endElementNS( XML_w, XML_pPr );