diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-12 15:38:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-16 07:53:49 +0100 |
commit | bf4bbc3c2174b21577b8878bc3197923ba44a029 (patch) | |
tree | 22ec4b4da1bc2b86b6b27776fd64fd2b89a9ed3e /svx | |
parent | b977a8786ff39f1348bafdbf2dd83e7008ed3086 (diff) |
replace std::max(std::min()) with std::clamp
Change-Id: I890d19f5e2177294dc1175c90c98b964347f9e85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105751
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/Palette.cxx | 6 | ||||
-rw-r--r-- | svx/source/unogallery/unogaltheme.cxx | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/svx/source/tbxctrls/Palette.cxx b/svx/source/tbxctrls/Palette.cxx index ccfe7b81ed77..b83b206cbe5a 100644 --- a/svx/source/tbxctrls/Palette.cxx +++ b/svx/source/tbxctrls/Palette.cxx @@ -72,9 +72,9 @@ static void lcl_CMYKtoRGB( float fCyan, float fMagenta, float fYellow, float fKe fMagenta = (fMagenta * ( 1.0 - fKey )) + fKey; fYellow = (fYellow * ( 1.0 - fKey )) + fKey; - dR = std::max( std::min( ( 1.0 - fCyan ), 1.0), 0.0 ); - dG = std::max( std::min( ( 1.0 - fMagenta ), 1.0), 0.0 ); - dB = std::max( std::min( ( 1.0 - fYellow ), 1.0), 0.0 ); + dR = std::clamp( 1.0 - fCyan, 0.0, 1.0 ); + dG = std::clamp( 1.0 - fMagenta, 0.0, 1.0 ); + dB = std::clamp( 1.0 - fYellow, 0.0, 1.0 ); } void PaletteASE::LoadPalette() diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx index e2fa7b93bc12..39013c20ea4c 100644 --- a/svx/source/unogallery/unogaltheme.cxx +++ b/svx/source/unogallery/unogaltheme.cxx @@ -176,7 +176,7 @@ void SAL_CALL GalleryTheme::update( ) { const INetURLObject aURL( rURL ); - nIndex = ::std::max( ::std::min( nIndex, getCount() ), sal_Int32( 0 ) ); + nIndex = std::clamp( nIndex, sal_Int32(0), getCount() ); if( ( aURL.GetProtocol() != INetProtocol::NotValid ) && mpTheme->InsertURL( aURL, nIndex ) ) { @@ -207,7 +207,7 @@ void SAL_CALL GalleryTheme::update( ) { const Graphic aGraphic( rxGraphic ); - nIndex = ::std::max( ::std::min( nIndex, getCount() ), sal_Int32( 0 ) ); + nIndex = std::clamp( nIndex, sal_Int32(0), getCount() ); if( mpTheme->InsertGraphic( aGraphic, nIndex ) ) nRet = nIndex; @@ -234,7 +234,7 @@ void SAL_CALL GalleryTheme::update( ) if( pModel && dynamic_cast<const FmFormModel*>(pModel->GetDoc()) ) { // Here we're inserting something that's already a gallery theme drawing - nIndex = ::std::max( ::std::min( nIndex, getCount() ), sal_Int32( 0 ) ); + nIndex = std::clamp( nIndex, sal_Int32(0), getCount() ); if( mpTheme->InsertModel( *static_cast< FmFormModel* >( pModel->GetDoc() ), nIndex ) ) nRet = nIndex; |