Kaydet (Commit) 62031cd0 authored tarafından Andras Timar's avatar Andras Timar

DrawingML export crash fix

Change-Id: I777c6734a7f63240e9021152ecff0a86f530ff8f
Reviewed-on: https://gerrit.libreoffice.org/15951Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
Tested-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst 53a066b7
...@@ -2222,18 +2222,6 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape ) ...@@ -2222,18 +2222,6 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
} }
mpFS->startElementNS( XML_a, XML_custGeom, FSEND );
mpFS->singleElementNS( XML_a, XML_avLst, FSEND );
mpFS->singleElementNS( XML_a, XML_gdLst, FSEND );
mpFS->singleElementNS( XML_a, XML_ahLst, FSEND );
mpFS->singleElementNS( XML_a, XML_rect,
XML_l, "l",
XML_t, "t",
XML_r, "r",
XML_b, "b",
FSEND );
mpFS->startElementNS( XML_a, XML_pathLst, FSEND );
uno::Sequence< beans::PropertyValue > const * pGeometrySeq = uno::Sequence< beans::PropertyValue > const * pGeometrySeq =
static_cast<uno::Sequence< beans::PropertyValue > const *>(aAny.getValue()); static_cast<uno::Sequence< beans::PropertyValue > const *>(aAny.getValue());
...@@ -2251,7 +2239,6 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape ) ...@@ -2251,7 +2239,6 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aPairs; uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aPairs;
uno::Sequence<drawing::EnhancedCustomShapeSegment> aSegments; uno::Sequence<drawing::EnhancedCustomShapeSegment> aSegments;
uno::Sequence<awt::Size> aPathSize; uno::Sequence<awt::Size> aPathSize;
bool bHasSubViewSize = false;
for (int j = 0; j < aPathProp.getLength(); ++j ) for (int j = 0; j < aPathProp.getLength(); ++j )
{ {
const beans::PropertyValue& rPathProp = aPathProp[j]; const beans::PropertyValue& rPathProp = aPathProp[j];
...@@ -2260,13 +2247,21 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape ) ...@@ -2260,13 +2247,21 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
else if (rPathProp.Name == "Segments") else if (rPathProp.Name == "Segments")
rPathProp.Value >>= aSegments; rPathProp.Value >>= aSegments;
else if (rPathProp.Name == "SubViewSize") else if (rPathProp.Name == "SubViewSize")
{
rPathProp.Value >>= aPathSize; rPathProp.Value >>= aPathSize;
bHasSubViewSize = true;
}
} }
if ( bHasSubViewSize ) if ( !aPairs.hasElements() || !aSegments.hasElements() )
return;
mpFS->startElementNS( XML_a, XML_custGeom, FSEND );
mpFS->singleElementNS( XML_a, XML_avLst, FSEND );
mpFS->singleElementNS( XML_a, XML_gdLst, FSEND );
mpFS->singleElementNS( XML_a, XML_ahLst, FSEND );
mpFS->singleElementNS( XML_a, XML_rect, XML_l, "l", XML_t, "t",
XML_r, "r", XML_b, "b", FSEND );
mpFS->startElementNS( XML_a, XML_pathLst, FSEND );
if ( aPathSize.hasElements() )
{ {
mpFS->startElementNS( XML_a, XML_path, mpFS->startElementNS( XML_a, XML_path,
XML_w, I64S( aPathSize[0].Width ), XML_w, I64S( aPathSize[0].Width ),
...@@ -2395,13 +2390,12 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape ) ...@@ -2395,13 +2390,12 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
} }
} }
mpFS->endElementNS( XML_a, XML_path ); mpFS->endElementNS( XML_a, XML_path );
mpFS->endElementNS( XML_a, XML_pathLst );
mpFS->endElementNS( XML_a, XML_custGeom );
} }
} }
} }
mpFS->endElementNS( XML_a, XML_pathLst );
mpFS->endElementNS( XML_a, XML_custGeom );
} }
void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon ) void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment