summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-09-29 17:48:01 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-29 17:48:55 +0200
commit1415082606ffd1df8dc5890124e94516de503d4d (patch)
treee988769e7dce61598f1c3ec1ee3c7720e45bb6a0 /oox
parent09196ca6ca9347a214ca4e73d02eda0eb6385c29 (diff)
drawingML export: fix remaining rotation / flip combinations
With this, each rotation = 0 / 90 / 180 / 270 and flip = none / horizontal / vertical / horizontal+vertical combination (16 cases) are exported perfectly. Also, this matches what the (binary) [MS-ODRAW] export does, see ImplEESdrWriter::ImplWriteShape(). Change-Id: I04030c8c6819c35c06ce97400eb7e2f1f7389a5f
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx17
1 files changed, 4 insertions, 13 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 066049858a4b..99d636d2f588 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1166,19 +1166,10 @@ void DrawingML::WriteShapeTransformation( Reference< XShape > rXShape, sal_Int32
aPos.X-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Width/2-facsin*sin(nRotation*F_PI18000)*aSize.Height/2;
aPos.Y-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Height/2+facsin*sin(nRotation*F_PI18000)*aSize.Width/2;
}
- }
- if (!bSuppressRotation)
- {
- // See SdrObjCustomShape::NbcRotate().
- int nSwap = 0;
- if (bFlipH)
- nSwap ^= 1;
- if (bFlipV)
- nSwap ^= 1;
- if (nSwap)
- {
- nRotation=(nRotation+18000)%36000;
- }
+
+ // The RotateAngle property's value is independent from any flipping, and that's exactly what we need here.
+ uno::Reference<beans::XPropertySet> xPropertySet(rXShape, uno::UNO_QUERY);
+ xPropertySet->getPropertyValue("RotateAngle") >>= nRotation;
}
WriteTransformation( Rectangle( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) ), nXmlNamespace, bFlipH, bFlipV, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation) );
}