update ooo310-m15
[ooovba.git] / applied_patches / 0847-pptx-fix-connector-crash.diff
blob58998ecae65de5811095aa9a4dca6d28ec030f4b
1 Fix for crashing on un-connected connectors
3 From: Thorsten Behrens <thb@openoffice.org>
6 ---
8 oox/source/export/drawingml.cxx | 18 ++++++++++--------
9 oox/source/export/shapes.cxx | 6 ++++++
10 2 files changed, 16 insertions(+), 8 deletions(-)
13 diff --git oox/source/export/drawingml.cxx oox/source/export/drawingml.cxx
14 index 1d29513..338a40f 100644
15 --- oox/source/export/drawingml.cxx
16 +++ oox/source/export/drawingml.cxx
17 @@ -1329,14 +1329,16 @@ void DrawingML::WritePolyPolygon( const PolyPolygon& rPolyPolygon )
19 void DrawingML::WriteConnectorConnections( EscherConnectorListEntry& rConnectorEntry, sal_Int32 nStartID, sal_Int32 nEndID )
21 - mpFS->singleElementNS( XML_a, XML_stCxn,
22 - XML_id, I32S( nStartID ),
23 - XML_idx, I64S( rConnectorEntry.GetConnectorRule( TRUE ) ),
24 - FSEND );
25 - mpFS->singleElementNS( XML_a, XML_endCxn,
26 - XML_id, I32S( nEndID ),
27 - XML_idx, I64S( rConnectorEntry.GetConnectorRule( FALSE ) ),
28 - FSEND );
29 + if( nStartID != -1 )
30 + mpFS->singleElementNS( XML_a, XML_stCxn,
31 + XML_id, I32S( nStartID ),
32 + XML_idx, I64S( rConnectorEntry.GetConnectorRule( TRUE ) ),
33 + FSEND );
34 + if( nEndID != -1 )
35 + mpFS->singleElementNS( XML_a, XML_endCxn,
36 + XML_id, I32S( nEndID ),
37 + XML_idx, I64S( rConnectorEntry.GetConnectorRule( FALSE ) ),
38 + FSEND );
41 // from sw/source/filter/ww8/wrtw8num.cxx for default bullets to export to MS intact
42 diff --git oox/source/export/shapes.cxx oox/source/export/shapes.cxx
43 index 08d0e0d..aae6d67 100644
44 --- oox/source/export/shapes.cxx
45 +++ oox/source/export/shapes.cxx
46 @@ -979,6 +979,9 @@ size_t ShapeExport::ShapeHash::operator()( const ::com::sun::star::uno::Referenc
48 sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape > rXShape )
50 + if( !rXShape.is() )
51 + return -1;
53 sal_Int32 nID = GetFB()->GetUniqueId();
55 maShapeMap[ rXShape ] = nID;
56 @@ -988,6 +991,9 @@ sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape > rXShape )
58 sal_Int32 ShapeExport::GetShapeID( const Reference< XShape > rXShape )
60 + if( !rXShape.is() )
61 + return -1;
63 ShapeHashMap::const_iterator aIter = maShapeMap.find( rXShape );
65 if( aIter == maShapeMap.end() )