summaryrefslogtreecommitdiff
path: root/oox/source/drawingml
diff options
context:
space:
mode:
authorekuiitr <jhaekansh80@gmail.com>2018-06-06 13:00:27 +0530
committerJan Holesovsky <kendy@collabora.com>2018-06-08 18:36:52 +0200
commitcf7b97d1328ec2f2c8254abb9ce67d63d9c54c80 (patch)
tree89e7629fb85bbf6866f92511e0b437e4e35d431e /oox/source/drawingml
parent0d0716411e3d66e8beb9093ebe94fb5545106fbf (diff)
Support autoTxRot parameter in Text algorithm
Specifies how text is oriented relative to the shape, according to values: none, upright(default) and gravity. Change-Id: I3fcaa545965a9e2853943e4dc8215fa66576ac39 Reviewed-on: https://gerrit.libreoffice.org/55359 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 366759581bc0..c085fb6daa7f 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -544,8 +544,25 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
break;
}
- if (rShape->getRotation())
- pTextBody->getTextProperties().moRotation = -rShape->getRotation();
+ const sal_Int32 nautoTxRot = maMap.count(XML_autoTxRot) ? maMap.find(XML_autoTxRot)->second : XML_upr;
+
+ switch(nautoTxRot)
+ {
+ case XML_upr:
+ {
+ if (rShape->getRotation())
+ pTextBody->getTextProperties().moRotation = -F_PI180*90*rShape->getRotation();
+ }
+ break;
+ case XML_grav:
+ {
+ if (rShape->getRotation()==90*F_PI180 || rShape->getRotation()==180*F_PI180)
+ pTextBody->getTextProperties().moRotation = 180*F_PI180;
+ }
+ break;
+ case XML_none:
+ break;
+ }
// text centered vertically by default
pTextBody->getTextProperties().meVA = css::drawing::TextVerticalAdjust_CENTER;