diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-01-14 15:12:16 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-01-15 01:59:40 +0100 |
commit | 35ea8fc24ae749b8a87b7ddb5df22ecc4f58cfd3 (patch) | |
tree | 28d1d641397ed51cacb5fae7543e9a2ad6a8aec4 /sw | |
parent | 423d70f7e45749fad680b3dfe0ccdaed1c1afb19 (diff) |
tdf#122186: Fix broken Input list after RT in DOCX format
We should not write out the text of the field, because it
confuses the import code and it's unneeded anyway.
Change-Id: Id114f74c5d135e9fe6cb059e25ebf324464c8362
Reviewed-on: https://gerrit.libreoffice.org/66338
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw')
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/tdf122186_input_list.odt | bin | 0 -> 8068 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf122186_input_list.odt b/sw/qa/extras/ooxmlexport/data/tdf122186_input_list.odt Binary files differnew file mode 100755 index 000000000000..76a6289f7045 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf122186_input_list.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index dac93371abb6..1f59e1c4db0a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -86,6 +86,17 @@ DECLARE_OOXMLEXPORT_TEST(testDateControl, "empty-date-control.odt") assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", u" "); } + +DECLARE_OOXMLEXPORT_TEST(testInputListExport, "tdf122186_input_list.odt") +{ + // We need to make sure we don't export the text itself next to the input list field + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r", 5); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:t", 0); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index e845fe0655c7..00e6249d6faa 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2030,7 +2030,7 @@ void DocxAttributeOutput::EndField_Impl( const SwTextNode* pNode, sal_Int32 nPos sExpand = static_cast<SwAuthorityField const*>(rInfos.pField.get()) ->ExpandCitation(AUTH_FIELD_TITLE, nullptr); } - else + else if(rInfos.eType != ww::eFORMDROPDOWN) { sExpand = rInfos.pField->ExpandField(true, nullptr); } |