diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf117805.odt | bin | 0 -> 14897 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 13 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 11 |
3 files changed, 22 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf117805.odt b/sw/qa/extras/ooxmlexport/data/tdf117805.odt Binary files differnew file mode 100644 index 000000000000..828384b3613d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf117805.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 87d35f8a300c..730765a8c9ff 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -191,6 +191,19 @@ DECLARE_OOXMLEXPORT_TEST(testSignatureLineShape, "signature-line-all-props-set.d CPPUNIT_ASSERT_EQUAL(OUString("Check the machines!"), aSigningInstructions); } +DECLARE_OOXMLEXPORT_TEST(testTdf117805, "tdf117805.odt") +{ + if (!mbExported) + return; + + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess + = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), + maTempFile.GetURL()); + // This failed, the header was lost. It's still referenced at an incorrect + // location in document.xml, though. + CPPUNIT_ASSERT(xNameAccess->hasByName("word/header1.xml")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf113183, "tdf113183.docx") { // The horizontal positioning of the star shape affected the positioning of diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 8acb92e3e9ac..b714481d0043 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -117,6 +117,13 @@ void lclMovePositionWithRotation(awt::Point& aPos, const Size& rSize, sal_Int64 aPos.X += nXDiff; aPos.Y += nYDiff; } + +/// Determines if the anchor is inside a paragraph. +bool IsAnchorTypeInsideParagraph(const ww8::Frame* pFrame) +{ + const SwFormatAnchor& rAnchor = pFrame->GetFrameFormat().GetAttrSet().GetAnchor(); + return rAnchor.GetAnchorId() != RndStdIds::FLY_AT_PAGE; +} } ExportDataSaveRestore::ExportDataSaveRestore(DocxExport& rExport, sal_uLong nStt, sal_uLong nEnd, @@ -1395,7 +1402,7 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho bool bTextBoxOnly) { bool bDMLAndVMLDrawingOpen = m_pImpl->m_bDMLAndVMLDrawingOpen; - m_pImpl->m_bDMLAndVMLDrawingOpen = true; + m_pImpl->m_bDMLAndVMLDrawingOpen = IsAnchorTypeInsideParagraph(pParentFrame); sax_fastparser::FSHelperPtr pFS = m_pImpl->m_pSerializer; const SwFrameFormat& rFrameFormat = pParentFrame->GetFrameFormat(); @@ -1690,7 +1697,7 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho void DocxSdrExport::writeVMLTextFrame(ww8::Frame const* pParentFrame, bool bTextBoxOnly) { bool bDMLAndVMLDrawingOpen = m_pImpl->m_bDMLAndVMLDrawingOpen; - m_pImpl->m_bDMLAndVMLDrawingOpen = true; + m_pImpl->m_bDMLAndVMLDrawingOpen = IsAnchorTypeInsideParagraph(pParentFrame); sax_fastparser::FSHelperPtr pFS = m_pImpl->m_pSerializer; const SwFrameFormat& rFrameFormat = pParentFrame->GetFrameFormat(); |