diff options
author | nikki <nikkic@epoq.co.uk> | 2017-04-12 16:52:49 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-07-04 11:29:34 +0200 |
commit | 9ad9c5183f348384b62ec88459a3a5922e423d83 (patch) | |
tree | e5cf9c500dea78d20f6bdd461f12c03c4d1d0015 /sw | |
parent | 469076317d27e545449ea5a5688a468d02558451 (diff) |
Fix tdf#106029 - Add setting XML_doNotExpandShiftReturn when exporting to docx
Change-Id: Ie8ffb0f2d5444c6ead13bdc894715c5a2e6d0baa
Reviewed-on: https://gerrit.libreoffice.org/36485
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo106029.docx | bin | 0 -> 4336 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 10 |
3 files changed, 15 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo106029.docx b/sw/qa/extras/ooxmlexport/data/fdo106029.docx Binary files differnew file mode 100644 index 000000000000..b19d63d4c218 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo106029.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 3a84b313b15c..4287154d76d6 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -336,6 +336,14 @@ DECLARE_OOXMLEXPORT_TEST(testFdo73541,"fdo73541.docx") assertXPath(pXmlDoc, "/w:settings/w:mirrorMargins"); } +DECLARE_OOXMLEXPORT_TEST(testFdo106029,"fdo106029.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/settings.xml"); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "/w:settings/w:compat/w:doNotExpandShiftReturn"); +} + DECLARE_OOXMLEXPORT_TEST(testFDO74106, "FDO74106.docx") { xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index d03aee27b4c0..6ff65f09db50 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -885,7 +885,13 @@ void DocxExport::WriteSettings() { pFS->singleElementNS( XML_w, XML_documentProtection, FSNS(XML_w, XML_edit), "forms", FSNS(XML_w, XML_enforcement), "1", FSEND ); } - + // Do not justify lines with manual break + if( m_pDoc->getIDocumentSettingAccess().get( DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK )) + { + pFS->startElementNS( XML_w, XML_compat, FSEND ); + pFS->singleElementNS( XML_w, XML_doNotExpandShiftReturn, FSEND ); + pFS->endElementNS( XML_w, XML_compat ); + } // Automatic hyphenation: it's a global setting in Word, it's a paragraph setting in Writer. // Use the setting from the default style. SwTextFormatColl* pColl = m_pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD, /*bRegardLanguage=*/false); @@ -969,7 +975,6 @@ void DocxExport::WriteSettings() FSNS( XML_w, XML_val ), OUStringToOString(aValue, RTL_TEXTENCODING_UTF8).getStr(), FSEND); } - pFS->endElementNS( XML_w, XML_compat ); } } @@ -983,7 +988,6 @@ void DocxExport::WriteSettings() FSNS( XML_w, XML_edit ), "forms", FSEND ); } - pFS->endElementNS( XML_w, XML_settings ); } |