diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-11 08:47:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-15 07:26:17 +0100 |
commit | 7d8e94444d989d0ac4a4055b207726708e9ec0da (patch) | |
tree | ce3e4a09ed7932496c4d901360ff23787c8f6e24 /svx | |
parent | 80fb8d406ced47e6a2089f0c8ba5c103d2fec91f (diff) |
convert a<b?a:b to std::min(a,b)
with something like
git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx
Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23
Note: we also convert a>b?b:a
Reviewed-on: https://gerrit.libreoffice.org/47736
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/gallery2/galbrws2.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv2.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index d713593d9bff..18e9c814f47b 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -896,7 +896,7 @@ void GalleryBrowser2::ImplUpdateViews( sal_uInt16 nSelectionId ) mpIconView->InsertItem( static_cast<sal_uInt16>(i) ); } - ImplSelectItemId( ( nSelectionId > mpCurTheme->GetObjectCount() ) ? mpCurTheme->GetObjectCount() : nSelectionId ); + ImplSelectItemId( std::min<sal_uInt16>( nSelectionId, mpCurTheme->GetObjectCount() ) ); } switch( GetMode() ) diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 1ebde1442249..430b987db155 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -717,8 +717,8 @@ basegfx::B2DPolygon SdrEditView::ImpCombineToSinglePolygon(const basegfx::B2DPol const double fRBCA(basegfx::B2DVector(aCA - aRB).getLength()); const double fRBCB(basegfx::B2DVector(aCB - aRB).getLength()); - const double fSmallestRA(fRACA < fRACB ? fRACA : fRACB); - const double fSmallestRB(fRBCA < fRBCB ? fRBCA : fRBCB); + const double fSmallestRA(std::min(fRACA, fRACB)); + const double fSmallestRB(std::min(fRBCA, fRBCB)); if(fSmallestRA < fSmallestRB) { @@ -726,8 +726,8 @@ basegfx::B2DPolygon SdrEditView::ImpCombineToSinglePolygon(const basegfx::B2DPol aRetval.flip(); } - const double fSmallestCA(fRACA < fRBCA ? fRACA : fRBCA); - const double fSmallestCB(fRACB < fRBCB ? fRACB : fRBCB); + const double fSmallestCA(std::min(fRACA, fRBCA)); + const double fSmallestCB(std::min(fRACB, fRBCB)); if(fSmallestCB < fSmallestCA) { diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index ad591651b37e..391196740508 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -899,7 +899,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) } } // check if there are defaulted adjustment values that should be filled the hard coded defaults (pDefValue) - sal_Int32 nCount = nAdjustmentValues > nAdjustmentDefaults ? nAdjustmentDefaults : nAdjustmentValues; + sal_Int32 nCount = std::min(nAdjustmentValues, nAdjustmentDefaults); for ( i = 0; i < nCount; i++ ) { if ( seqAdjustmentValues[ i ].State != css::beans::PropertyState_DIRECT_VALUE ) |