diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index 15ed98f0990c..9fdf8c99a3c0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -1065,7 +1065,16 @@ DECLARE_OOXMLEXPORT_TEST(testFdo76249, "fdo76249.docx") xmlDocPtr pXmlDoc = parseExport("word/document.xml"); if (!pXmlDoc) return; - assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/lc:lockedCanvas[1]",1); + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + if (xIndexAccess->getCount()) + { + // TODO TextBox: remove this when TextBox is enabled by default + // This second run is a bug, should be the first ideally + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/lc:lockedCanvas[1]",1); + } + else + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/lc:lockedCanvas[1]",1); } DECLARE_OOXMLEXPORT_TEST(testFdo76979, "fdo76979.docx") diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 7646e00dfd76..e0da18cec8ef 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -1469,14 +1469,14 @@ void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame, bool bTextBoxOnly pFS->singleElementNS(XML_v, XML_stroke, xDashLineStyleAttr); } pFS->startElementNS(XML_v, XML_textbox, xTextboxAttrList); - pFS->startElementNS(XML_w, XML_txbxContent, FSEND); } + pFS->startElementNS(XML_w, XML_txbxContent, FSEND); m_pImpl->m_bFlyFrameGraphic = true; m_pImpl->m_rExport.WriteText(); m_pImpl->m_bFlyFrameGraphic = false; + pFS->endElementNS(XML_w, XML_txbxContent); if (!bTextBoxOnly) { - pFS->endElementNS(XML_w, XML_txbxContent); pFS->endElementNS(XML_v, XML_textbox); if (m_pImpl->m_pFlyWrapAttrList) |