summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2012-01-10 13:08:39 +0100
committerRadek Doulik <rodo@novell.com>2012-01-10 13:38:52 +0100
commit15a19d71f357d1d929cd5d19af7e882e3d589341 (patch)
treeb61885adb03880c162bbf64bb42d8b76e13983ff
parente596df57b54bcb4f67dfa1242d47dda0f1e0f6aa (diff)
pptx: custom shapes import, ignore close segment after moveto segment
-rw-r--r--oox/source/drawingml/customshapegeometry.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx
index 3c7a15cf1e46..d9e2aa7433d5 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -1034,10 +1034,13 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
{
case A_TOKEN( close ) :
{
- EnhancedCustomShapeSegment aNewSegment;
- aNewSegment.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
- aNewSegment.Count = 0;
- mrSegments.push_back( aNewSegment );
+ // ignore close after move to (ppt does seems to do the same, see accentCallout2 preset for example)
+ if ( mrSegments.empty() || ( mrSegments.back().Command != EnhancedCustomShapeSegmentCommand::MOVETO ) ) {
+ EnhancedCustomShapeSegment aNewSegment;
+ aNewSegment.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
+ aNewSegment.Count = 0;
+ mrSegments.push_back( aNewSegment );
+ }
}
break;
case A_TOKEN( moveTo ) :