summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-12 16:10:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-16 13:46:01 +0100
commit36b3b357fe2a882db6a5f5a006239e16200fb847 (patch)
treedb2a4887f6ef25dcaf3fd2c00998b6e3645592e7 /avmedia
parentdbbb5569b45ede85af7f2ee53496f28762cbf371 (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 'avmedia')
-rw-r--r--avmedia/source/framework/MediaControlBase.cxx5
1 files changed, 2 insertions, 3 deletions
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 ) );
}
}