diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-26 18:34:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-26 19:06:50 +0200 |
commit | 7f9b242331327c5c1b137b91861a6bb57bfb0ecc (patch) | |
tree | 14a2f24b8cc08a5d22054a84cd6c1b655aa9de5c /oox | |
parent | ef58e10844dff60cd218306b059ec81d8421f961 (diff) |
DOCX drawingML import: fix remaining rotation / flip combinations
With this, each rotation = 0 / 90 / 180 / 270 and flip = none /
horizontal / vertical / horizontal+vertical combination (16 cases) are
imported perfectly.
Also adjust a few testcases -- now that in many cases we only set the
position in oox, some rounding errors went away.
Change-Id: I5567a7d6964775f2caf10a0e539f3eb84d10461e
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 11 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 1276c9743a33..534317298501 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -418,7 +418,9 @@ Reference< XShape > Shape::createAndInsert( aServiceName == "com.sun.star.drawing.ConnectorShape" ); bool bUseRotationTransform = ( !mbWps || aServiceName == "com.sun.star.drawing.LineShape" || - aServiceName == "com.sun.star.drawing.GroupShape" ); + aServiceName == "com.sun.star.drawing.GroupShape" || + mbFlipH || + mbFlipV ); basegfx::B2DHomMatrix aTransformation; @@ -458,7 +460,10 @@ Reference< XShape > Shape::createAndInsert( if( maPosition.X != 0 || maPosition.Y != 0) { // if global position is used, add it to transformation - aTransformation.translate( maPosition.X, maPosition.Y ); + if (mbWps && aParentTransformation.isIdentity()) + aTransformation.translate( maPosition.X * 360, maPosition.Y * 360); + else + aTransformation.translate( maPosition.X, maPosition.Y ); } aTransformation = aParentTransformation*aTransformation; @@ -986,7 +991,7 @@ Reference< XShape > Shape::createAndInsert( // These can have a custom geometry, so position should be set here, // after creation but before custom shape handling, using the position // we got from the caller. - if (mbWps && aServiceName != "com.sun.star.text.TextFrame") + if (mbWps && aServiceName == "com.sun.star.drawing.LineShape") mxShape->setPosition(maPosition); if( bIsCustomShape ) diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 0ca30540dc0e..066049858a4b 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1169,7 +1169,13 @@ void DrawingML::WriteShapeTransformation( Reference< XShape > rXShape, sal_Int32 } if (!bSuppressRotation) { + // See SdrObjCustomShape::NbcRotate(). + int nSwap = 0; + if (bFlipH) + nSwap ^= 1; if (bFlipV) + nSwap ^= 1; + if (nSwap) { nRotation=(nRotation+18000)%36000; } |