From 36b3b357fe2a882db6a5f5a006239e16200fb847 Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 12 Nov 2020 16:10:56 +0200 Subject: 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 --- basegfx/source/polygon/b3dpolypolygontools.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'basegfx') 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(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++) -- cgit