diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-04-20 11:21:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-20 11:39:48 +0100 |
commit | f517052783b232e31969e944bce565905fea8cf4 (patch) | |
tree | af0fe054d39172123c07061f4b862ac138453094 /sw/source | |
parent | f6a4f11afb7c4dcd72b52892f2e449478a3d7017 (diff) |
fix crash on export of abi9702-1.doc to docx
Change-Id: I3c0d7560d9a47123ca98f72c0319fcee97894913
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 15 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 4 |
2 files changed, 8 insertions, 11 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 263c72256cb8..797abe0e8e1c 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1188,7 +1188,9 @@ void DocxAttributeOutput::EndRun() m_pSerializer->mergeTopMarks(); - WritePostponedMath(); + for (std::vector<const SwOLENode*>::iterator it = m_aPostponedMaths.begin(); it != m_aPostponedMaths.end(); ++it) + WritePostponedMath(*it); + m_aPostponedMaths.clear(); for (std::vector<const SdrObject*>::iterator it = m_aPostponedFormControls.begin(); it != m_aPostponedFormControls.end(); ++it) WritePostponedFormControl(*it); @@ -4339,16 +4341,13 @@ bool DocxAttributeOutput::WriteOLEMath( const SdrObject*, const SwOLENode& rOLEN if( !SotExchange::IsMath(aObjName) ) return false; - assert( m_postponedMath == NULL ); // make it a list if there can be more inside one run - m_postponedMath = &rOLENode; + m_aPostponedMaths.push_back(&rOLENode); return true; } -void DocxAttributeOutput::WritePostponedMath() +void DocxAttributeOutput::WritePostponedMath(const SwOLENode* pPostponedMath) { - if( m_postponedMath == NULL ) - return; - uno::Reference < embed::XEmbeddedObject > xObj(const_cast<SwOLENode*>(m_postponedMath)->GetOLEObj().GetOleRef()); + uno::Reference < embed::XEmbeddedObject > xObj(const_cast<SwOLENode*>(pPostponedMath)->GetOLEObj().GetOleRef()); uno::Reference< uno::XInterface > xInterface( xObj->getComponent(), uno::UNO_QUERY ); // gcc4.4 (and 4.3 and possibly older) have a problem with dynamic_cast directly to the target class, // so help it with an intermediate cast. I'm not sure what exactly the problem is, seems to be unrelated @@ -4357,7 +4356,6 @@ void DocxAttributeOutput::WritePostponedMath() assert( formulaexport != NULL ); if (formulaexport) formulaexport->writeFormulaOoxml( m_pSerializer, GetExport().GetFilter().getVersion()); - m_postponedMath = NULL; } void DocxAttributeOutput::WritePostponedFormControl(const SdrObject* pObject) @@ -8295,7 +8293,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_nHyperLinkCount(0), m_nFieldsInHyperlink( 0 ), m_postponedDMLDrawing(NULL), - m_postponedMath( NULL ), m_postponedChart( NULL ), pendingPlaceholder( NULL ), m_postitFieldsMaxId( 0 ), diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index d0bf46c7e202..66964a557119 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -693,7 +693,7 @@ private: void DoWriteBookmarks( ); void DoWriteAnnotationMarks( ); void WritePostponedGraphic(); - void WritePostponedMath(); + void WritePostponedMath(const SwOLENode* pObject); void WritePostponedFormControl(const SdrObject* pObject); void WritePostponedDiagram(); void WritePostponedChart(); @@ -860,7 +860,7 @@ private: }; std::unique_ptr< std::list<PostponedOLE> > m_pPostponedOLEs; - const SwOLENode* m_postponedMath; + std::vector<const SwOLENode*> m_aPostponedMaths; const SdrObject* m_postponedChart; Size m_postponedChartSize; std::vector<const SdrObject*> m_aPostponedFormControls; |