summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-02-03 02:46:30 +0100
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-02-03 02:46:30 +0100
commit5c39b6b997ddc85e6848efc230a427a124b97264 (patch)
tree0a4faac2c991f3134a3f5963f5258e28d1931c3b /oox
parent72b2fafebfc44fa90f08cc198e2fa5fc26154c5b (diff)
drawingML export: custom geometry with cubic bezier curves
When the custom shape is not a preset shape then construct a PolyPolygon and use DrawingML::WritePolyPolygon() to export it. Change-Id: I6598976a475bfcb92305338af9016e09df4c9456
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx2
-rw-r--r--oox/source/export/shapes.cxx20
2 files changed, 15 insertions, 7 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 459b4253c984..3db4c04a10bc 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1671,7 +1671,7 @@ void DrawingML::WritePolyPolygon( const PolyPolygon& rPolyPolygon )
XML_y, I64S( rPoly[j].Y() - aRect.Top() ),
FSEND );
- if( ( flags == POLY_NORMAL || flags == POLY_SYMMTR ) && bBezier )
+ if( ( flags == POLY_NORMAL || flags == POLY_SYMMTR || j == rPoly.GetSize() - 1) && bBezier )
{
mpFS->endElementNS( XML_a, XML_cubicBezTo );
bBezier = sal_False;
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index e55c2f3c8f8a..90b7ffa7e268 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -353,14 +353,22 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
// visual shape properties
pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV, false);
- if( nAdjustmentValuesIndex != -1 )
+
+ if( sShapeType == "ooxml-non-primitive" ) // non-primitiv -> custom geometry
{
- sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0;
- WritePresetShape( sPresetShape, eShapeType, bPredefinedHandlesUsed,
- nAdjustmentsWhichNeedsToBeConverted, aGeometrySeq[ nAdjustmentValuesIndex ] );
+ WritePolyPolygon( EscherPropertyContainer::GetPolyPolygon( xShape ) );
+ }
+ else // preset geometry
+ {
+ if( nAdjustmentValuesIndex != -1 )
+ {
+ sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0;
+ WritePresetShape( sPresetShape, eShapeType, bPredefinedHandlesUsed,
+ nAdjustmentsWhichNeedsToBeConverted, aGeometrySeq[ nAdjustmentValuesIndex ] );
+ }
+ else
+ WritePresetShape( sPresetShape );
}
- else
- WritePresetShape( sPresetShape );
if( rXPropSet.is() )
{
WriteFill( rXPropSet );