summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-07-20 12:44:23 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-07-21 08:41:40 +0200
commitcf69bb4f503eb8b3966d5caf825e0c05264a369e (patch)
tree7f795e2d6fbc0ce8dd8cb71c83d3c65ed25bb45a /oox
parenteea7038c182cc1f6cd792359053ea2561a200026 (diff)
-Werror,-Wunused-result
...when building against a recent libc++ that marks std::clamp [[nodiscard]], in code newly introduced in 7e23cbdbb6ec0247a29ed8a8f744c01e10963ea0 "tdf#149551 separate TextRotateAngle from TextPreRotateAngle" Change-Id: Ifdce627b5d76fac269f1403e7bb98d4576dfa682 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137257 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/transform2dcontext.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx
index d583c8f32c3b..446acf4ef07b 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -83,7 +83,7 @@ bool ConstructPresetTextRectangle(Shape& rShape, awt::Rectangle& rRect)
if (nWidth == 0 || nHeight == 0)
return false;
double fMaxAdj = 50000.0 * nWidth / std::min(nWidth, nHeight);
- std::clamp<double>(fAdj, 0, fMaxAdj);
+ fAdj = std::clamp<double>(fAdj, 0, fMaxAdj);
sal_Int32 nTextLeft = std::min(nWidth, nHeight) * fAdj / 100000.0 * 0.29289;
sal_Int32 nTextTop = nTextLeft;
rRect.X = rShape.getPosition().X + nTextLeft;
@@ -101,7 +101,7 @@ bool ConstructPresetTextRectangle(Shape& rShape, awt::Rectangle& rRect)
if (nWidth == 0 || nHeight == 0)
return false;
double fMaxAdj = 50000.0 * nWidth / std::min(nWidth, nHeight);
- std::clamp<double>(fAdj, 0, fMaxAdj);
+ fAdj = std::clamp<double>(fAdj, 0, fMaxAdj);
sal_Int32 nTextLeft = nWidth / 3.0 * fAdj / fMaxAdj;
sal_Int32 nTextTop = nHeight / 3.0 * fAdj / fMaxAdj;
rRect.X = rShape.getPosition().X + nTextLeft;
@@ -145,8 +145,8 @@ bool ConstructPresetTextRectangle(Shape& rShape, awt::Rectangle& rRect)
{
a1 = aAdjGdList[0].maFormula.toDouble();
a2 = aAdjGdList[1].maFormula.toDouble();
- std::clamp<double>(a1, 0, 20000);
- std::clamp<double>(a2, 0, 5358);
+ a1 = std::clamp<double>(a1, 0, 20000);
+ a2 = std::clamp<double>(a2, 0, 5358);
}
double th = std::min(w, h) * a1 / 100000.0;
double l2 = std::min(w, h) * a2 / 100000.0 / 2.0;
@@ -189,7 +189,7 @@ bool ConstructPresetTextRectangle(Shape& rShape, awt::Rectangle& rRect)
if (nWidth == 0 || nHeight == 0)
return false;
double fMaxAdj = 50000.0 * nWidth / std::min(nWidth, nHeight);
- std::clamp<double>(fAdj, 0, fMaxAdj);
+ fAdj = std::clamp<double>(fAdj, 0, fMaxAdj);
double fFactor = fAdj/fMaxAdj/6.0 + 1.0/12.0;
sal_Int32 nTextLeft = nWidth * fFactor;
sal_Int32 nTextTop = nHeight * fFactor;