diff options
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/layoutmanager/toolbarlayoutmanager.cxx | 17 | ||||
-rw-r--r-- | framework/source/uielement/progressbarwrapper.cxx | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index afafbd1d8830..912675147086 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -2714,8 +2714,8 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( { if ( bHorizontalDockArea ) { - sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32( aContainerWinSize.Width() - aWindowRect.Left() ), - sal_Int32( aTrackingRect.getWidth() ))); + sal_Int32 nSize = std::clamp( sal_Int32(aContainerWinSize.Width() - aWindowRect.Left()), + sal_Int32(0), sal_Int32(aTrackingRect.getWidth()) ); if ( nSize == 0 ) nSize = aWindowRect.getWidth(); @@ -2728,9 +2728,8 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( } else { - sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32( - nTopDockingAreaSize + nMaxLeftRightDockAreaSize - aWindowRect.Top() ), - sal_Int32( aTrackingRect.getHeight() ))); + sal_Int32 nSize = std::clamp( sal_Int32(nTopDockingAreaSize + nMaxLeftRightDockAreaSize - aWindowRect.Top()), + sal_Int32(0), sal_Int32(aTrackingRect.getHeight()) ); if ( nSize == 0 ) nSize = aWindowRect.getHeight(); @@ -2751,8 +2750,8 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( { if ( bHorizontalDockArea ) { - sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32(( aContainerWinSize.Width() ) - aWindowRect.Right() ), - sal_Int32( aTrackingRect.getWidth() ))); + sal_Int32 nSize = ::std::clamp( sal_Int32(aContainerWinSize.Width() - aWindowRect.Right()), + sal_Int32(0), sal_Int32(aTrackingRect.getWidth()) ); if ( nSize == 0 ) { aUIElementRect.SetPos( ::Point( aContainerWinSize.Width() - aTrackingRect.getWidth(), aWindowRect.Top() )); @@ -2772,8 +2771,8 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( } else { - sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32( nTopDockingAreaSize + nMaxLeftRightDockAreaSize - aWindowRect.Bottom() ), - sal_Int32( aTrackingRect.getHeight() ))); + sal_Int32 nSize = std::clamp( sal_Int32(nTopDockingAreaSize + nMaxLeftRightDockAreaSize - aWindowRect.Bottom()), + sal_Int32(0), sal_Int32(aTrackingRect.getHeight()) ); aUIElementRect.SetPos( ::Point( aWindowRect.Left(), aWindowRect.Bottom() )); aUIElementRect.SetSize( ::Size( aWindowRect.getWidth(), nSize )); diff --git a/framework/source/uielement/progressbarwrapper.cxx b/framework/source/uielement/progressbarwrapper.cxx index 537129b9632b..68e0220fb1bb 100644 --- a/framework/source/uielement/progressbarwrapper.cxx +++ b/framework/source/uielement/progressbarwrapper.cxx @@ -203,7 +203,7 @@ void ProgressBarWrapper::setValue( ::sal_Int32 nValue ) if ( m_nRange > 0 ) { fVal = ( double( nValue ) / double( m_nRange )) * 100; - fVal = std::max( double( 0 ), std::min( fVal, double( 100 ))); + fVal = std::clamp( fVal, 0.0, 100.0 ); } if ( m_nValue != sal_Int32( fVal )) |