summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2016-11-20 01:39:37 +0800
committerMark Hung <marklh9@gmail.com>2016-11-20 12:13:59 +0000
commite0a0b6e8294aa5fcdfb36e5f38783486db0f0b2a (patch)
treed52b66bdd475114a14d65eb09c4eb06c9389df13 /oox
parentd881f99c7a911a433ef624e891df3291886cf62b (diff)
tdf59046 oox: fix incorrectly combined shapes
1. Store the path of all polygons of a PolyPolygon in the same path element so it subtract overlapped area. 2. Set the size of the path as the bounding box of PolyPolygon so the points of the polygon scale and offset properly. Change-Id: If6e21d1ac0544b45ef68073cf14bcc08c1d7dbef Reviewed-on: https://gerrit.libreoffice.org/30982 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index deafd3477a7e..0951449950a3 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2556,16 +2556,19 @@ void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon )
mpFS->startElementNS( XML_a, XML_pathLst, FSEND );
+ const Rectangle aRect( rPolyPolygon.GetBoundRect() );
+
+ // Put all polygons of rPolyPolygon in the same path elemnt
+ // to subtract the overlapped areas.
+ mpFS->startElementNS( XML_a, XML_path,
+ XML_w, I64S( aRect.GetWidth() ),
+ XML_h, I64S( aRect.GetHeight() ),
+ FSEND );
+
for( sal_uInt16 i = 0; i < rPolyPolygon.Count(); i ++ )
{
const tools::Polygon& rPoly = rPolyPolygon[ i ];
- Rectangle aRect( rPoly.GetBoundRect() );
-
- mpFS->startElementNS( XML_a, XML_path,
- XML_w, I64S( aRect.GetWidth() ),
- XML_h, I64S( aRect.GetHeight() ),
- FSEND );
if( rPoly.GetSize() > 0 )
{
@@ -2611,9 +2614,8 @@ void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon )
mpFS->endElementNS( XML_a, XML_lnTo );
}
}
-
- mpFS->endElementNS( XML_a, XML_path );
}
+ mpFS->endElementNS( XML_a, XML_path );
mpFS->endElementNS( XML_a, XML_pathLst );