summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/tbxctrls/Palette.cxx6
-rw-r--r--svx/source/unogallery/unogaltheme.cxx6
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;