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 --- avmedia/source/framework/MediaControlBase.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'avmedia') diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx index 7c3450d802e1..60faa27cfc3f 100644 --- a/avmedia/source/framework/MediaControlBase.cxx +++ b/avmedia/source/framework/MediaControlBase.cxx @@ -27,7 +27,7 @@ using ::rtl::OUString; -#define AVMEDIA_DB_RANGE -40 +constexpr sal_Int32 AVMEDIA_DB_RANGE = -40; #define AVMEDIA_LINEINCREMENT 1.0 #define AVMEDIA_PAGEINCREMENT 10.0 @@ -64,8 +64,7 @@ void MediaControlBase::UpdateVolumeSlider( MediaItem const & aMediaItem ) { mxVolumeSlider->set_sensitive(true); const sal_Int32 nVolumeDB = aMediaItem.getVolumeDB(); - mxVolumeSlider->set_value( std::min( std::max( nVolumeDB, static_cast< sal_Int32 >( AVMEDIA_DB_RANGE ) ), - static_cast< sal_Int32 >( 0 ) ) ); + mxVolumeSlider->set_value( std::clamp( nVolumeDB, sal_Int32(0), AVMEDIA_DB_RANGE ) ); } } -- cgit