diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-12 16:10:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-16 13:46:01 +0100 |
commit | 36b3b357fe2a882db6a5f5a006239e16200fb847 (patch) | |
tree | db2a4887f6ef25dcaf3fd2c00998b6e3645592e7 /vcl | |
parent | dbbb5569b45ede85af7f2ee53496f28762cbf371 (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 'vcl')
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/bitmap.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index dd6c556b9a19..6d0252648d77 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -529,7 +529,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r MapMode aMap( MapUnit::Map100thInch ); sal_Int32 nDPI = rConfigItem.ReadInt32( "Resolution", 75 ); - Fraction aFrac( 1, std::min( std::max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) ); + Fraction aFrac( 1, std::clamp( nDPI, sal_Int32(75), sal_Int32(600) ) ); aMap.SetScaleX( aFrac ); aMap.SetScaleY( aFrac ); diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 7a6615fa4bac..7d3d6485d2e7 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -1361,7 +1361,7 @@ void OutputDevice::DrawTransformedBitmapEx( const Size& rOriginalSizePixel(rBitmapEx.GetSizePixel()); const double fOrigArea(rOriginalSizePixel.Width() * rOriginalSizePixel.Height() * 0.5); const double fOrigAreaScaled(fOrigArea * 1.44); - double fMaximumArea(std::min(4500000.0, std::max(1000000.0, fOrigAreaScaled))); + double fMaximumArea(std::clamp(fOrigAreaScaled, 1000000.0, 4500000.0)); // tdf#130768 CAUTION(!) using GetViewTransformation() is *not* enough here, it may // be that mnOutOffX/mnOutOffY is used - see AOO bug 75163, mentioned at // ImplGetDeviceTransformation declaration |