From 166b875b073388a09b517e973c4deff37ceabc3a Mon Sep 17 00:00:00 2001 From: Katarina Machalkova Date: Tue, 19 Oct 2010 16:39:22 +0200 Subject: Merged oox-drawingml-fix-shapes-map-crash.diff from ooo-build --- sd/source/filter/pptx/epptooxml.hxx | 4 +++- sd/source/filter/pptx/pptx-epptooxml.cxx | 15 +++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'sd') diff --git a/sd/source/filter/pptx/epptooxml.hxx b/sd/source/filter/pptx/epptooxml.hxx index 2c850bd03f0b..02d39301599d 100644 --- a/sd/source/filter/pptx/epptooxml.hxx +++ b/sd/source/filter/pptx/epptooxml.hxx @@ -3,7 +3,7 @@ #include #include - +#include #include "epptbase.hxx" namespace com { namespace sun { namespace star { @@ -125,6 +125,8 @@ private: sal_Bool mbCreateNotes; static sal_Int32 nStyleLevelToken[5]; + + ::oox::drawingml::ShapeExport::ShapeHashMap maShapeMap; }; } diff --git a/sd/source/filter/pptx/pptx-epptooxml.cxx b/sd/source/filter/pptx/pptx-epptooxml.cxx index b813166226ae..014294d167f6 100644 --- a/sd/source/filter/pptx/pptx-epptooxml.cxx +++ b/sd/source/filter/pptx/pptx-epptooxml.cxx @@ -79,7 +79,7 @@ class PowerPointShapeExport : public ShapeExport PageType mePageType; sal_Bool mbMaster; public: - PowerPointShapeExport( FSHelperPtr pFS, PowerPointExport* pFB ); + PowerPointShapeExport( FSHelperPtr pFS, ShapeHashMap* pShapeMap, PowerPointExport* pFB ); void SetMaster( sal_Bool bMaster ); void SetPageType( PageType ePageType ); ShapeExport& WriteNonVisualProperties( Reference< XShape > xShape ); @@ -92,8 +92,8 @@ public: sal_Bool WritePlaceholder( Reference< XShape > xShape, PlaceholderType ePlaceholder, sal_Bool bMaster ); }; -PowerPointShapeExport::PowerPointShapeExport( FSHelperPtr pFS, PowerPointExport* pFB ) - : ShapeExport( XML_p, pFS, pFB ) + PowerPointShapeExport::PowerPointShapeExport( FSHelperPtr pFS, ShapeHashMap* pShapeMap, PowerPointExport* pFB ) + : ShapeExport( XML_p, pFS, pShapeMap, pFB ) , mrExport( *pFB ) { } @@ -218,6 +218,7 @@ bool PowerPointExport::importDocument() throw() bool PowerPointExport::exportDocument() throw() { DrawingML::ResetCounters(); + maShapeMap.clear (); addRelation( US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ), S( "ppt/presentation.xml" ) ); @@ -250,6 +251,8 @@ bool PowerPointExport::exportDocument() throw() commit(); + maShapeMap.clear (); + return true; } @@ -274,7 +277,7 @@ void PowerPointExport::ImplWriteBackground( FSHelperPtr pFS, Reference< XPropert pFS->startElementNS( XML_p, XML_bg, FSEND ); pFS->startElementNS( XML_p, XML_bgPr, FSEND ); - PowerPointShapeExport( pFS, this ).WriteFill( rXPropSet ); + PowerPointShapeExport( pFS, &maShapeMap, this ).WriteFill( rXPropSet ); pFS->endElementNS( XML_p, XML_bgPr ); pFS->endElementNS( XML_p, XML_bg ); @@ -631,7 +634,7 @@ void PowerPointExport::WriteAnimationTarget( FSHelperPtr pFS, Any aTarget ) if( rXShape.is() ) { pFS->startElementNS( XML_p, XML_tgtEl, FSEND ); pFS->singleElementNS( XML_p, XML_spTgt, - XML_spid, I32S( ShapeExport::GetShapeID( rXShape ) ), + XML_spid, I32S( ShapeExport::GetShapeID( rXShape, &maShapeMap ) ), FSEND ); pFS->endElementNS( XML_p, XML_tgtEl ); } @@ -1440,7 +1443,7 @@ void PowerPointExport::ImplWriteLayout( sal_Int32 nOffset, sal_uInt32 nMasterNum void PowerPointExport::WriteShapeTree( FSHelperPtr pFS, PageType ePageType, sal_Bool bMaster ) { - PowerPointShapeExport aDML( pFS, this ); + PowerPointShapeExport aDML( pFS, &maShapeMap, this ); aDML.SetMaster( bMaster ); aDML.SetPageType( ePageType ); sal_uInt32 nShapes; -- cgit v1.2.3