diff options
author | nikki <nikkic@epoq.co.uk> | 2017-04-12 16:52:49 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-07-10 11:26:15 +0200 |
commit | 44655d5e8311196ec309bec267eaebd9828ee273 (patch) | |
tree | 7f08dd6d7258e48bb0b7b2dd981383d64c793bef /sw | |
parent | bc882e977144d60b850288045e3f6aab7cbad6f7 (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>
(cherry picked from commit 9ad9c5183f348384b62ec88459a3a5922e423d83)
Reviewed-on: https://gerrit.libreoffice.org/39735
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 1d94e25938aa..1097eddd5707 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -337,6 +337,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 67d96a7e362d..a72a0f251b44 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 ); } |