[Libreoffice-commits] core.git: oox/source
ekuiitr
jhaekansh80 at gmail.com
Fri Jun 8 16:37:16 UTC 2018
oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 21 ++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
New commits:
commit cf7b97d1328ec2f2c8254abb9ce67d63d9c54c80
Author: ekuiitr <jhaekansh80 at gmail.com>
Date: Wed Jun 6 13:00:27 2018 +0530
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 at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
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;
More information about the Libreoffice-commits
mailing list