diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo83044.docx | bin | 0 -> 25970 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 14 |
3 files changed, 17 insertions, 6 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo83044.docx b/sw/qa/extras/ooxmlexport/data/fdo83044.docx Binary files differnew file mode 100644 index 000000000000..01d32bfdb833 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo83044.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index f843c24b8d27..3cda4ce31328 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -201,6 +201,15 @@ DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooter, "first-header-footer.docx") CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"), parseDump("/root/page[6]/footer/txt/text()")); } +DECLARE_OOXMLEXPORT_TEST(testFDO83044, "fdo83044.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + + if (!pXmlDoc) + return; + + assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:text", 1); +} 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 3e78a1a97bff..b4587e82fe4d 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -632,12 +632,14 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, pSdtPrTokenAttributes = 0; } - uno::Sequence<xml::FastAttribute> aChildren = pSdtPrTokenChildren->getFastAttributes(); - for( sal_Int32 i=0; i < aChildren.getLength(); ++i ) - m_pSerializer->singleElement( aChildren[i].Token, - FSNS(XML_w, XML_val), - rtl::OUStringToOString( aChildren[i].Value, RTL_TEXTENCODING_UTF8 ).getStr(), - FSEND ); + if (nSdtPrToken == FSNS( XML_w, XML_date ) || nSdtPrToken == FSNS( XML_w, XML_docPartObj ) || nSdtPrToken == FSNS( XML_w, XML_docPartList ) || nSdtPrToken == FSNS( XML_w14, XML_checkbox )) { + uno::Sequence<xml::FastAttribute> aChildren = pSdtPrTokenChildren->getFastAttributes(); + for( sal_Int32 i=0; i < aChildren.getLength(); ++i ) + m_pSerializer->singleElement( aChildren[i].Token, + FSNS(XML_w, XML_val), + rtl::OUStringToOString( aChildren[i].Value, RTL_TEXTENCODING_UTF8 ).getStr(), + FSEND ); + } m_pSerializer->endElement( nSdtPrToken ); } |