summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-12 15:38:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-16 07:53:49 +0100
commitbf4bbc3c2174b21577b8878bc3197923ba44a029 (patch)
tree22ec4b4da1bc2b86b6b27776fd64fd2b89a9ed3e /sc/source/ui/dbgui
parentb977a8786ff39f1348bafdbf2dd83e7008ed3086 (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 'sc/source/ui/dbgui')
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx2
-rw-r--r--sc/source/ui/dbgui/csvruler.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 056bf4022a11..1fd2cea6de69 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -929,7 +929,7 @@ bool ScCsvGrid::MouseMove( const MouseEvent& rMEvt )
sal_Int32 nPos = (rMEvt.GetPosPixel().X() - GetFirstX()) / GetCharWidth() + GetFirstVisPos();
// on mouse tracking: keep position valid
- nPos = std::max( std::min( nPos, GetPosCount() - sal_Int32( 1 ) ), sal_Int32( 0 ) );
+ nPos = std::clamp( nPos, sal_Int32(0), GetPosCount() - 1 );
Execute( CSVCMD_MAKEPOSVISIBLE, nPos );
sal_uInt32 nColIx = GetColumnFromPos( nPos );
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index 94e733ee7c1b..95e042290185 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -432,7 +432,7 @@ bool ScCsvRuler::MouseMove( const MouseEvent& rMEvt )
if( mbTracking )
{
// on mouse tracking: keep position valid
- nPos = std::max( std::min( nPos, GetPosCount() - sal_Int32( 1 ) ), sal_Int32( 1 ) );
+ nPos = std::clamp( nPos, sal_Int32(1), GetPosCount() - 1 );
MoveMouseTracking( nPos );
}
else