summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-12 16:10:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-16 13:46:01 +0100
commit36b3b357fe2a882db6a5f5a006239e16200fb847 (patch)
treedb2a4887f6ef25dcaf3fd2c00998b6e3645592e7 /basegfx
parentdbbb5569b45ede85af7f2ee53496f28762cbf371 (diff)
replace std::min(std::max()) with std::clamp
Change-Id: I76e34e8020d98292e8ffde387542b7029f85a42d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/polygon/b3dpolypolygontools.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/basegfx/source/polygon/b3dpolypolygontools.cxx b/basegfx/source/polygon/b3dpolypolygontools.cxx
index 3badd683d248..ad2dd5bb7979 100644
--- a/basegfx/source/polygon/b3dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolypolygontools.cxx
@@ -221,7 +221,7 @@ namespace basegfx::utils
}
// min/max limitations
- nHorSeg = std::min(nMaxSegments, std::max(nMinSegments, nHorSeg));
+ nHorSeg = std::clamp(nHorSeg, nMinSegments, nMaxSegments);
if(!nVerSeg)
{
@@ -229,7 +229,7 @@ namespace basegfx::utils
}
// min/max limitations
- nVerSeg = std::min(nMaxSegments, std::max(nMinSegments, nVerSeg));
+ nVerSeg = std::clamp(nVerSeg, nMinSegments, nMaxSegments);
// create constants
const double fVerDiffPerStep((fVerStop - fVerStart) / static_cast<double>(nVerSeg));
@@ -320,7 +320,7 @@ namespace basegfx::utils
}
// min/max limitations
- nHorSeg = std::min(nMaxSegments, std::max(nMinSegments, nHorSeg));
+ nHorSeg = std::clamp(nHorSeg, nMinSegments, nMaxSegments);
if(!nVerSeg)
{
@@ -328,7 +328,7 @@ namespace basegfx::utils
}
// min/max limitations
- nVerSeg = std::min(nMaxSegments, std::max(nMinSegments, nVerSeg));
+ nVerSeg = std::clamp(nVerSeg, nMinSegments, nMaxSegments);
// vertical loop
for(sal_uInt32 a(0); a < nVerSeg; a++)