diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo79540.docx | bin | 0 -> 26279 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 17 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 8 |
3 files changed, 24 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo79540.docx b/sw/qa/extras/ooxmlexport/data/fdo79540.docx Binary files differnew file mode 100644 index 000000000000..ce843d6616a1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo79540.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 4b5de65f3c5d..30f748033d48 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3510,6 +3510,23 @@ DECLARE_OOXMLEXPORT_TEST(testfdo76934, "fdo76934.docx") assertXPath ( pXmlDoc, "/w:styles[1]/w:style[36]/w:pPr[1]/w:spacing[1]", "beforeAutospacing", "1" ); } +DECLARE_OOXMLEXPORT_TEST(testfdo79540, "fdo79540.docx") +{ + /* Issue was, <w:drawing> was getting written inside <w:drawing>. + * So Postone the writing of Inner Drawing tag. + * MS Office does not allow Nestimg of drawing tags. + */ + + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + + if (!pXmlDoc) + return; + + // Ensure that two separate w:drawing tags are written after the code changes. + assertXPath ( pXmlDoc, "/w:document/w:body/w:p/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing",1); + assertXPath ( pXmlDoc, "/w:document/w:body/w:p/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing",1); +} + DECLARE_OOXMLEXPORT_TEST(testFDO79062, "fdo79062.docx") { xmlDocPtr pXmlFootNotes = parseExport("word/footnotes.xml"); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 645688f74713..7e7c4a01fca9 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4390,7 +4390,13 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po if ( m_postponedDMLDrawing == NULL ) { if ( IsAlternateContentChoiceOpen() ) - m_rExport.SdrExporter().writeDMLDrawing( pSdrObj, &rFrame.GetFrmFmt(), m_anchorId++); + { + // Do not write w:drawing inside w:drawing. Instead Postpone the Inner Drawing. + if( m_rExport.SdrExporter().IsDrawingOpen() ) + m_postponedCustomShape->push_back(PostponedDrawing(pSdrObj, &(rFrame.GetFrmFmt()), &rNdTopLeft)); + else + m_rExport.SdrExporter().writeDMLDrawing( pSdrObj, &rFrame.GetFrmFmt(), m_anchorId++); + } else m_rExport.SdrExporter().writeDMLAndVMLDrawing( pSdrObj, rFrame.GetFrmFmt(), rNdTopLeft, m_anchorId++); |