diff options
author | Tor Lillqvist <tlillqvist@novell.com> | 2010-11-05 18:32:42 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@hemulen.(none)> | 2010-11-13 12:24:10 +0200 |
commit | d93aa2c22b94204a9254fb6dae1f431e53cb1128 (patch) | |
tree | d7f0bc4e26d37a6633eb84c68d1fff99993e0c02 | |
parent | fd7e412d257632694936a972e493ed60cdf93e72 (diff) |
Apply pptx-fix-connector-crash.diff
-rw-r--r-- | oox/source/export/drawingml.cxx | 18 | ||||
-rw-r--r-- | oox/source/export/shapes.cxx | 6 |
2 files changed, 16 insertions, 8 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index a2e86b922..d90ef29fb 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1460,14 +1460,16 @@ void DrawingML::WritePolyPolygon( const PolyPolygon& rPolyPolygon ) void DrawingML::WriteConnectorConnections( EscherConnectorListEntry& rConnectorEntry, sal_Int32 nStartID, sal_Int32 nEndID ) { - mpFS->singleElementNS( XML_a, XML_stCxn, - XML_id, I32S( nStartID ), - XML_idx, I64S( rConnectorEntry.GetConnectorRule( TRUE ) ), - FSEND ); - mpFS->singleElementNS( XML_a, XML_endCxn, - XML_id, I32S( nEndID ), - XML_idx, I64S( rConnectorEntry.GetConnectorRule( FALSE ) ), - FSEND ); + if( nStartID != -1 ) + mpFS->singleElementNS( XML_a, XML_stCxn, + XML_id, I32S( nStartID ), + XML_idx, I64S( rConnectorEntry.GetConnectorRule( TRUE ) ), + FSEND ); + if( nEndID != -1 ) + mpFS->singleElementNS( XML_a, XML_endCxn, + XML_id, I32S( nEndID ), + XML_idx, I64S( rConnectorEntry.GetConnectorRule( FALSE ) ), + FSEND ); } // from sw/source/filter/ww8/wrtw8num.cxx for default bullets to export to MS intact diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 44da51d51..5296d15a5 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -975,6 +975,9 @@ sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape > rXShape ) sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape > rXShape, XmlFilterBase* pFB ) { + if( !rXShape.is() ) + return -1; + sal_Int32 nID = pFB->GetUniqueId(); saShapeMap[ rXShape ] = nID; @@ -984,6 +987,9 @@ sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape > rXShape, XmlFilt sal_Int32 ShapeExport::GetShapeID( const Reference< XShape > rXShape ) { + if( !rXShape.is() ) + return -1; + ShapeHashMap::const_iterator aIter = saShapeMap.find( rXShape ); if( aIter == saShapeMap.end() ) |