From 63430f70664a39ecfb900e6919c19d00661aeb61 Mon Sep 17 00:00:00 2001 From: Vasily Melenchuk Date: Fri, 26 Nov 2021 14:03:22 +0300 Subject: docx export: preserve spaces in field instructions MS Word is putting spaces between field mark and field instruction text. Writer preserves these spaces, but without xml:space="preserve" they are not displayed by Word later. Conflicts: sw/source/filter/ww8/docxattributeoutput.cxx Change-Id: I480e6febf0ee278b56e9dfc6e0430c5fd5bdfd71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125875 Tested-by: Jenkins Reviewed-by: Thorsten Behrens --- sw/source/filter/ww8/docxattributeoutput.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 366670f86974..be3d70f4a036 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1772,7 +1772,7 @@ void DocxAttributeOutput::DoWriteCmd( const OUString& rCmd ) m_aSeqBookmarksNames[sSeqName].push_back(m_sLastOpenedBookmark); } // Write the Field command - m_pSerializer->startElementNS( XML_w, XML_instrText, FSEND ); + m_pSerializer->startElementNS( XML_w, XML_instrText, FSNS(XML_xml, XML_space), "preserve" ); m_pSerializer->writeEscaped( rCmd ); m_pSerializer->endElementNS( XML_w, XML_instrText ); -- cgit