diff options
author | Radek Doulik <rodo@novell.com> | 2009-07-14 18:45:55 +0200 |
---|---|---|
committer | Radek Doulik <rodo@novell.com> | 2009-07-14 18:45:55 +0200 |
commit | 884a1181765880e9e61171bd7850a07d8f03cee0 (patch) | |
tree | da60d42190653f5f15872444c00ee40d71d9d79f | |
parent | 5c355b068f9fc37d7ba124ae424f6a6817c4fdde (diff) |
redo the fix for shape map crash
* make the shapes map non-static
* allow to pass own shapes map
* let pptx export use its own shape map and pass it to ShapeExport class
* update xlsx
* enable animations export
* update pptx-fix-connector-crash.diff patch
* patches/dev300/apply:
* patches/dev300/oox-drawingml-fix-shapes-map-crash.diff:
* patches/dev300/pptx-export-disable-animations.diff:
* patches/dev300/pptx-fix-connector-crash.diff:
* patches/dev300/pptx-fix-dtor-crash.diff:
-rw-r--r-- | patches/dev300/apply | 6 | ||||
-rw-r--r-- | patches/dev300/oox-drawingml-fix-shapes-map-crash.diff | 215 | ||||
-rw-r--r-- | patches/dev300/pptx-export-disable-animations.diff | 20 | ||||
-rw-r--r-- | patches/dev300/pptx-fix-connector-crash.diff | 8 | ||||
-rw-r--r-- | patches/dev300/pptx-fix-dtor-crash.diff | 97 |
5 files changed, 220 insertions, 126 deletions
diff --git a/patches/dev300/apply b/patches/dev300/apply index 1358d17c3..1589a4cc0 100644 --- a/patches/dev300/apply +++ b/patches/dev300/apply @@ -3100,11 +3100,6 @@ pptx-export-empty-animations-node-and-groupshape-fix.diff, rodo # ugly temp fix to make GraphicShapeContext recognise layout pptx-gfx-layout-fix.diff, thorsten -pptx-fix-dtor-crash.diff, thorsten -pptx-export-disable-animations.diff, rodo -# ^^^ for Mick, try to disable last two to test -# animations export - # handles case where a connector shape is not connected pptx-fix-connector-crash.diff, n#499129, thorsten @@ -3271,6 +3266,7 @@ oox-pptx-export-hyperlinks.diff, n#499124, rodo oox-pptx-export-vertical-text.diff, n#498737, rodo oox-pptx-export-para-linespacing.diff, n#498737, rodo oox-pptx-export-fix-action-button-presets.diff, n#497570, rodo +oox-drawingml-fix-shapes-map-crash.diff, rodo [ CrossWin32Patches ] # Experimental patches to crosscompile OOo for Win32 diff --git a/patches/dev300/oox-drawingml-fix-shapes-map-crash.diff b/patches/dev300/oox-drawingml-fix-shapes-map-crash.diff new file mode 100644 index 000000000..a69f5829b --- /dev/null +++ b/patches/dev300/oox-drawingml-fix-shapes-map-crash.diff @@ -0,0 +1,215 @@ +diff -rup sc-orig/source/filter/xlsx/xlsx-xcl97rec.cxx sc/source/filter/xlsx/xlsx-xcl97rec.cxx +--- sc-orig/source/filter/xlsx/xlsx-xcl97rec.cxx 2009-07-14 17:32:13.000000000 +0200 ++++ sc/source/filter/xlsx/xlsx-xcl97rec.cxx 2009-07-14 17:35:50.000000000 +0200 +@@ -1162,7 +1162,7 @@ void XclObjAny::SaveXml( XclExpXmlStream + + sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream(); + +- ShapeExport aDML( XML_xdr, pDrawing, &rStrm, DrawingML::DOCUMENT_XLSX ); ++ ShapeExport aDML( XML_xdr, pDrawing, NULL, &rStrm, DrawingML::DOCUMENT_XLSX ); + + pDrawing->startElement( FSNS( XML_xdr, XML_twoCellAnchor ), // OOXTODO: oneCellAnchor, absoluteAnchor + XML_editAs, GetEditAs( *this ), +diff -rup sd-orig/source/filter/pptx/epptooxml.hxx sd/source/filter/pptx/epptooxml.hxx +--- sd-orig/source/filter/pptx/epptooxml.hxx 2009-07-14 15:44:07.000000000 +0200 ++++ sd/source/filter/pptx/epptooxml.hxx 2009-07-14 17:21:34.000000000 +0200 +@@ -3,7 +3,7 @@ + + #include <oox/core/xmlfilterbase.hxx> + #include <oox/helper/zipstorage.hxx> +- ++#include <oox/export/shapes.hxx> + #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 -rup sd-orig/source/filter/pptx/pptx-epptooxml.cxx sd/source/filter/pptx/pptx-epptooxml.cxx +--- sd-orig/source/filter/pptx/pptx-epptooxml.cxx 2009-07-14 15:44:07.000000000 +0200 ++++ sd/source/filter/pptx/pptx-epptooxml.cxx 2009-07-14 17:27:36.000000000 +0200 +@@ -79,7 +79,7 @@ class PowerPointShapeExport : public Sha + 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() + bool PowerPointExport::exportDocument() throw() + { + DrawingML::ResetCounters(); ++ maShapeMap.clear (); + + addRelation( US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ), S( "ppt/presentation.xml" ) ); + +@@ -250,7 +251,9 @@ bool PowerPointExport::exportDocument() + + commit(); + +- return true; ++ maShapeMap.clear (); ++ ++ return true; + } + + //------------------------------------------------------------------------------------------------------------------------------------------------------------------ +@@ -274,7 +277,7 @@ void PowerPointExport::ImplWriteBackgrou + 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::WriteAnimationTar + 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( + + 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; +diff -rup oox-orig/inc/oox/export/shapes.hxx oox/inc/oox/export/shapes.hxx +--- oox-orig/inc/oox/export/shapes.hxx 2009-07-14 15:43:57.000000000 +0200 ++++ oox/inc/oox/export/shapes.hxx 2009-07-14 17:27:03.000000000 +0200 +@@ -52,16 +52,7 @@ namespace oox { namespace drawingml { + + class OOX_DLLPUBLIC ShapeExport : public DrawingML { + +-protected: +- sal_Int32 mnShapeIdMax, mnPictureIdMax; +- + private: +- sal_Int32 mnXmlNamespace; +- Fraction maFraction; +- MapMode maMapModeSrc, maMapModeDest; +- +- ::com::sun::star::awt::Size MapSize( const ::com::sun::star::awt::Size& ) const; +- + struct ShapeCheck + { + bool operator()( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> s1, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> s2 ) const +@@ -77,11 +68,25 @@ private: + size_t operator()( const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > ) const; + }; + ++public: + typedef std::hash_map< const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>, sal_Int32, ShapeHash, ShapeCheck> ShapeHashMap; +- static ShapeHashMap saShapeMap; ++ ++protected: ++ sal_Int32 mnShapeIdMax, mnPictureIdMax; ++ ++private: ++ sal_Int32 mnXmlNamespace; ++ Fraction maFraction; ++ MapMode maMapModeSrc, maMapModeDest; ++ ++ ::com::sun::star::awt::Size MapSize( const ::com::sun::star::awt::Size& ) const; ++ ++ ShapeHashMap maShapeMap; ++ ShapeHashMap* mpShapeMap; + + public: +- ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX ); ++ ++ ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ShapeHashMap* pShapeMap = NULL, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX ); + virtual ~ShapeExport() {} + + sal_Int32 GetXmlNamespace() const; +@@ -160,8 +165,9 @@ public: + WriteUnknownShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ); + + sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape ); +- static sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ::oox::core::XmlFilterBase* pFB ); +- static sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape ); ++ sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ::oox::core::XmlFilterBase* pFB ); ++ sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape ); ++ static sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ShapeHashMap* pShapeMap ); + }; + + }} +diff -rup oox-orig/source/export/shapes.cxx oox/source/export/shapes.cxx +--- oox-orig/source/export/shapes.cxx 2009-07-14 15:44:00.000000000 +0200 ++++ oox/source/export/shapes.cxx 2009-07-14 17:26:27.000000000 +0200 +@@ -361,7 +361,7 @@ namespace oox { namespace drawingml { + if ( GETA(propName) ) \ + mAny >>= variable; + +-ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, XmlFilterBase* pFB, DocumentType eDocumentType ) ++ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, ShapeHashMap* pShapeMap, XmlFilterBase* pFB, DocumentType eDocumentType ) + : DrawingML( pFS, pFB, eDocumentType ) + , mnShapeIdMax( 1 ) + , mnPictureIdMax( 1 ) +@@ -369,6 +369,7 @@ ShapeExport::ShapeExport( sal_Int32 nXml + , maFraction( 1, 576 ) + , maMapModeSrc( MAP_100TH_MM ) + , maMapModeDest( MAP_INCH, Point(), maFraction, maFraction ) ++ , mpShapeMap( pShapeMap ? pShapeMap : &maShapeMap ) + { + } + +@@ -989,24 +990,27 @@ sal_Int32 ShapeExport::GetNewShapeID( co + + sal_Int32 nID = pFB->GetUniqueId(); + +- saShapeMap[ rXShape ] = nID; ++ (*mpShapeMap)[ rXShape ] = nID; + + return nID; + } + + sal_Int32 ShapeExport::GetShapeID( const Reference< XShape > rXShape ) + { ++ return GetShapeID( rXShape, mpShapeMap ); ++} ++ ++sal_Int32 ShapeExport::GetShapeID( const Reference< XShape > rXShape, ShapeHashMap* pShapeMap ) ++{ + if( !rXShape.is() ) + return -1; + +- ShapeHashMap::const_iterator aIter = saShapeMap.find( rXShape ); ++ ShapeHashMap::const_iterator aIter = pShapeMap->find( rXShape ); + +- if( aIter == saShapeMap.end() ) ++ if( aIter == pShapeMap->end() ) + return -1; + + return aIter->second; + } + +-ShapeExport::ShapeHashMap ShapeExport::saShapeMap; +- + } } diff --git a/patches/dev300/pptx-export-disable-animations.diff b/patches/dev300/pptx-export-disable-animations.diff deleted file mode 100644 index 9b67de1cb..000000000 --- a/patches/dev300/pptx-export-disable-animations.diff +++ /dev/null @@ -1,20 +0,0 @@ -# For the purpose of the 3.1 release, instead of sharing the binary and ooxml -# export, we introduce a separate sc/source/filter/xlsx that creates libxlsx - -# a filter for the XLSX files. After the release, the changes will be -# reverted so that the binary and ooxml are shared again. -# The changes include: -# sc/source/filter/eppt/* -> sc/source/filter/pptx/pptx-* -diff -rup sd/source/filter/eppt-orig/epptooxml.cxx sd/source/filter/eppt/epptooxml.cxx ---- sd/source/filter/pptx/pptx-epptooxml.cxx 2009-04-23 12:18:28.000000000 +0200 -+++ sd/source/filter/pptx/pptx-epptooxml.cxx 2009-04-23 12:19:57.000000000 +0200 -@@ -1124,7 +1124,8 @@ void PowerPointExport::ImplWriteSlide( s - pFS->endElementNS( XML_p, XML_cSld ); - - WriteTransition( pFS ); -- WriteAnimations( pFS ); -+ // disable these until there's time to iron it out -+ // WriteAnimations( pFS ); - - pFS->endElementNS( XML_p, XML_sld ); - -Only in sd/source/filter/eppt: epptooxml.cxx~ diff --git a/patches/dev300/pptx-fix-connector-crash.diff b/patches/dev300/pptx-fix-connector-crash.diff index 58998ecae..8d85cc001 100644 --- a/patches/dev300/pptx-fix-connector-crash.diff +++ b/patches/dev300/pptx-fix-connector-crash.diff @@ -50,9 +50,9 @@ index 08d0e0d..aae6d67 100644 + if( !rXShape.is() ) + return -1; + - sal_Int32 nID = GetFB()->GetUniqueId(); + sal_Int32 nID = pFB->GetUniqueId(); - maShapeMap[ rXShape ] = nID; + saShapeMap[ rXShape ] = nID; @@ -988,6 +991,9 @@ sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape > rXShape ) sal_Int32 ShapeExport::GetShapeID( const Reference< XShape > rXShape ) @@ -60,6 +60,6 @@ index 08d0e0d..aae6d67 100644 + if( !rXShape.is() ) + return -1; + - ShapeHashMap::const_iterator aIter = maShapeMap.find( rXShape ); + ShapeHashMap::const_iterator aIter = saShapeMap.find( rXShape ); - if( aIter == maShapeMap.end() ) + if( aIter == saShapeMap.end() ) diff --git a/patches/dev300/pptx-fix-dtor-crash.diff b/patches/dev300/pptx-fix-dtor-crash.diff deleted file mode 100644 index 8892eb9dd..000000000 --- a/patches/dev300/pptx-fix-dtor-crash.diff +++ /dev/null @@ -1,97 +0,0 @@ -Fix crash during pptx export (happens during app shutdown) - -From: Thorsten Behrens <thb@openoffice.org> - - ---- - - oox/inc/oox/export/shapes.hxx | 5 ++--- - oox/source/export/shapes.cxx | 15 ++++----------- - sd/source/filter/pptx/pptx-epptooxml.cxx | 4 +++- - 3 files changed, 9 insertions(+), 15 deletions(-) - - -diff --git oox/inc/oox/export/shapes.hxx oox/inc/oox/export/shapes.hxx -index fd8b229..e4c43b9 100644 ---- oox/inc/oox/export/shapes.hxx -+++ oox/inc/oox/export/shapes.hxx -@@ -78,7 +78,7 @@ private: - }; - - typedef std::hash_map< const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>, sal_Int32, ShapeHash, ShapeCheck> ShapeHashMap; -- static ShapeHashMap saShapeMap; -+ ShapeHashMap maShapeMap; - - public: - ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX ); -@@ -160,8 +160,7 @@ public: - WriteUnknownShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ); - - sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape ); -- static sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ::oox::core::XmlFilterBase* pFB ); -- static sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape ); -+ sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape ); - }; - - }} -diff --git oox/source/export/shapes.cxx oox/source/export/shapes.cxx -index 3cc0d52..08d0e0d 100644 ---- oox/source/export/shapes.cxx -+++ oox/source/export/shapes.cxx -@@ -979,28 +979,21 @@ size_t ShapeExport::ShapeHash::operator()( const ::com::sun::star::uno::Referenc - - sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape > rXShape ) - { -- return GetNewShapeID( rXShape, GetFB() ); --} -- --sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape > rXShape, XmlFilterBase* pFB ) --{ -- sal_Int32 nID = pFB->GetUniqueId(); -+ sal_Int32 nID = GetFB()->GetUniqueId(); - -- saShapeMap[ rXShape ] = nID; -+ maShapeMap[ rXShape ] = nID; - - return nID; - } - - sal_Int32 ShapeExport::GetShapeID( const Reference< XShape > rXShape ) - { -- ShapeHashMap::const_iterator aIter = saShapeMap.find( rXShape ); -+ ShapeHashMap::const_iterator aIter = maShapeMap.find( rXShape ); - -- if( aIter == saShapeMap.end() ) -+ if( aIter == maShapeMap.end() ) - return -1; - - return aIter->second; - } - --ShapeExport::ShapeHashMap ShapeExport::saShapeMap; -- - } } -diff --git sd/source/filter/pptx/pptx-epptooxml.cxx sd/source/filter/pptx/pptx-epptooxml.cxx -index e9c3e08..3f186ca 100644 ---- sd/source/filter/pptx/pptx-epptooxml.cxx -+++ sd/source/filter/pptx/pptx-epptooxml.cxx -@@ -624,16 +624,18 @@ void PowerPointExport::WriteAnimationAttributeName( FSHelperPtr pFS, const OUStr - pFS->endElementNS( XML_p, XML_attrNameLst ); - } - --void PowerPointExport::WriteAnimationTarget( FSHelperPtr pFS, Any aTarget ) -+void PowerPointExport::WriteAnimationTarget( FSHelperPtr /*pFS*/, Any aTarget ) - { - Reference< XShape > rXShape( aTarget, UNO_QUERY ); - - if( rXShape.is() ) { -+#if 0 - pFS->startElementNS( XML_p, XML_tgtEl, FSEND ); - pFS->singleElementNS( XML_p, XML_spTgt, - XML_spid, I32S( ShapeExport::GetShapeID( rXShape ) ), - FSEND ); - pFS->endElementNS( XML_p, XML_tgtEl ); -+#endif - } - } - |