diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo58577.odt | bin | 0 -> 9427 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 15 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 2 |
4 files changed, 18 insertions, 9 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo58577.odt b/sw/qa/extras/ooxmlexport/data/fdo58577.odt Binary files differnew file mode 100644 index 000000000000..4c8656d7eb8c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo58577.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index dc5b2152d1cb..4a58bf1b7b08 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -71,6 +71,7 @@ public: void testFdo48557(); void testI120928(); void testN822175(); + void testFdo58577(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -119,6 +120,7 @@ void Test::run() {"fdo48557.odt", &Test::testFdo48557}, {"i120928.docx", &Test::testI120928}, {"n822175.odt", &Test::testN822175}, + {"fdo58577.odt", &Test::testFdo58577}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -684,6 +686,14 @@ void Test::testN822175() CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(xFrame, "Surround")); } +void Test::testFdo58577() +{ + // The second frame was simply missing, so let's check if both frames were imported back. + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 803fe03b7ac5..153580cda321 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -290,10 +290,13 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT m_pSerializer->mergeTopMarks(); // Write the anchored frame if any - if ( m_pParentFrame ) + // Make a copy and clear the original early, as this method is called + // recursively for in-frame paragraphs + std::vector<sw::Frame> aParentFrames = m_aParentFrames; + m_aParentFrames.clear(); + for (size_t i = 0; i < aParentFrames.size(); ++i) { - sw::Frame *pParentFrame = m_pParentFrame; - m_pParentFrame = NULL; + sw::Frame* pParentFrame = &aParentFrames[i]; const SwFrmFmt& rFrmFmt = pParentFrame->GetFrmFmt( ); const SwNodeIndex* pNodeIndex = rFrmFmt.GetCntnt().GetCntntIdx(); @@ -353,8 +356,6 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT m_rExport.RestoreData(); m_rExport.mpParentFrame = NULL; - - delete pParentFrame; } m_pSerializer->endElementNS( XML_w, XML_p ); @@ -2601,7 +2602,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po case sw::Frame::eTxtBox: { // The frame output is postponed to the end of the anchor paragraph - m_pParentFrame = new sw::Frame(rFrame); + m_aParentFrames.push_back(sw::Frame(rFrame)); } break; case sw::Frame::eOle: @@ -4921,7 +4922,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_nTableDepth( 0 ), m_bParagraphOpened( false ), m_nColBreakStatus( COLBRK_NONE ), - m_pParentFrame( NULL ), m_bTextFrameSyntax( false ), m_closeHyperlinkInThisRun( false ), m_closeHyperlinkInPreviousRun( false ), @@ -4951,7 +4951,6 @@ DocxAttributeOutput::~DocxAttributeOutput() delete m_pEndnotesList, m_pEndnotesList = NULL; delete m_pTableWrt, m_pTableWrt = NULL; - delete m_pParentFrame; } DocxExport& DocxAttributeOutput::GetExport() diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index d120f3048aa6..0854e46ea662 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -618,7 +618,7 @@ private: // beginning of the next paragraph DocxColBreakStatus m_nColBreakStatus; - sw::Frame *m_pParentFrame; + std::vector<sw::Frame> m_aParentFrames; bool m_bTextFrameSyntax; OStringBuffer m_aTextFrameStyle; // close of hyperlink needed |