Kaydet (Commit) 11b7a2c8 authored tarafından Andras Timar's avatar Andras Timar

tdf#92527 construct default Segments sequence, when there is none

Change-Id: I78ddbef3ac96f10f334c45a467dafb95bb9e3453
Reviewed-on: https://gerrit.libreoffice.org/20051Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst ff522704
......@@ -2265,9 +2265,22 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
rPathProp.Value >>= aPathSize;
}
if ( !aPairs.hasElements() || !aSegments.hasElements() )
if ( !aPairs.hasElements() )
return;
if ( !aSegments.hasElements() )
{
aSegments = uno::Sequence<drawing::EnhancedCustomShapeSegment>(4);
aSegments[0].Count = 1;
aSegments[0].Command = drawing::EnhancedCustomShapeSegmentCommand::MOVETO;
aSegments[1].Count = (sal_Int16)std::min( aPairs.getLength() - 1, (sal_Int32)32767 );
aSegments[1].Command = drawing::EnhancedCustomShapeSegmentCommand::LINETO;
aSegments[2].Count = 0;
aSegments[2].Command = drawing::EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
aSegments[3].Count = 0;
aSegments[3].Command = drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH;
}
int nExpectedPairCount = 0;
for( int j = 0; j < aSegments.getLength(); ++j )
{
......
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