summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2015-11-19 11:37:56 +0100
committerAndras Timar <andras.timar@collabora.com>2015-11-19 22:45:18 +0000
commit11b7a2c89b8e155bf1da79107878f066847b46eb (patch)
treeadc833e3c5e9af0c356d9c4f831dfeb2e3fb81eb /oox
parentff522704109078a0cde844c74d608137b7c70f42 (diff)
tdf#92527 construct default Segments sequence, when there is none
Change-Id: I78ddbef3ac96f10f334c45a467dafb95bb9e3453 Reviewed-on: https://gerrit.libreoffice.org/20051 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index ea875f559834..8c90ffaa982b 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -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 )
{