diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2022-07-21 10:51:47 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2022-07-21 12:41:01 +0200 |
commit | c6965c5bcc95430c2a2d01051791d23f2c2f5a5b (patch) | |
tree | d8536d6bb5a64ab259e57746ceb8ece2903385cc /oox/source | |
parent | 9426e90c2c339b16487c48cd885a3e4586e1e1f3 (diff) |
tdf#145528 add round1Rect to SmartArt text area corrections
Some SmartArt types use text area rectangles different from defaults.
The new rectangle is available in element <txXfrm>. This patch adds the
needed corrections for type round1Rect. It is four times used in
SmartArt 'Titled Matrix' with rotations 0deg, 90deg, 180deg and 270deg.
Change-Id: I8c82b446a982ad93026e976b2a47d509b858858d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137287
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/drawingml/transform2dcontext.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx index 446acf4ef07b..ade77ad0e4fa 100644 --- a/oox/source/drawingml/transform2dcontext.cxx +++ b/oox/source/drawingml/transform2dcontext.cxx @@ -199,6 +199,22 @@ bool ConstructPresetTextRectangle(Shape& rShape, awt::Rectangle& rRect) rRect.Height = nHeight - 2 * nTextTop; return true; } + case XML_round1Rect: + { + sal_Int32 nWidth = rShape.getSize().Width; + sal_Int32 nHeight = rShape.getSize().Height; + if (nWidth == 0 || nHeight == 0) + return false; + auto aAdjGdList = rShape.getCustomShapeProperties()->getAdjustmentGuideList(); + double fAdj = aAdjGdList.empty() ? 16667.0 : aAdjGdList[0].maFormula.toDouble(); + std::clamp<double>(fAdj, 0.0, 50000.0); + double fDx = std::min(nWidth, nHeight) * fAdj / 100000.0 * 0.29289; + rRect.X = rShape.getPosition().X; + rRect.Y = rShape.getPosition().Y; + rRect.Width = nWidth - fDx; + rRect.Height = nHeight; + return true; + } default: return false; } |