summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/shape.cxx
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-02-18 17:28:05 +0100
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-02-18 17:31:01 +0100
commitc9b1fd63452325ee5cb6d003e9fc8315d1ca104e (patch)
tree193f8c513fae4d7c6dfb0d0737dca83233ef0f28 /oox/source/drawingml/shape.cxx
parent94af3bc2a4d729339486989fba67b17127e87329 (diff)
drawingML import: fix position of cildren in shape groups
Translate component of parent shapes' transformation have to be applied to children when there is no explicit child transformation. Note. Export also use this concept. Change-Id: I51bd3325fb53ee250402326ee361c8f07038ed07
Diffstat (limited to 'oox/source/drawingml/shape.cxx')
-rw-r--r--oox/source/drawingml/shape.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index fb17f5de4e93..b3020107a9ff 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -348,10 +348,19 @@ void Shape::addChildren(
aChildTransformation.scale(1/(maChSize.Width ? maChSize.Width : 1.0), 1/(maChSize.Height ? maChSize.Height : 1.0));
// Child position and size is typically non-zero, but it's allowed to have
- // it like that, and in that case Word ignores the parent transformation, it
- // seems.
+ // it like that, and in that case Word ignores the parent transformation
+ // (excluding translate component).
if (!mbWps || maChPosition.X || maChPosition.Y || maChSize.Width || maChSize.Height)
+ {
aChildTransformation *= aTransformation;
+ }
+ else
+ {
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ aTransformation.decompose(aScale, aTranslate, fRotate, fShearX);
+ aChildTransformation.translate(aTranslate.getX(), aTranslate.getY());
+ }
SAL_INFO("oox.drawingml", OSL_THIS_FUNC << "parent matrix:\n"
<< aChildTransformation.get(0, 0) << " "