summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-11 08:47:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-15 07:26:17 +0100
commit7d8e94444d989d0ac4a4055b207726708e9ec0da (patch)
treece3e4a09ed7932496c4d901360ff23787c8f6e24 /filter
parent80fb8d406ced47e6a2089f0c8ba5c103d2fec91f (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 'filter')
-rw-r--r--filter/source/msfilter/escherex.cxx2
-rw-r--r--filter/source/msfilter/svdfppt.cxx8
2 files changed, 5 insertions, 5 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index d3fc465bff20..1e3d9cb8e592 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -4121,7 +4121,7 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM
// record
while ( nBlipSize )
{
- sal_uInt32 nBytes = ( nBlipSize > nBuf ? nBuf : nBlipSize );
+ sal_uInt32 nBytes = std::min( nBlipSize, nBuf );
pMergePicStreamBSE->ReadBytes(pBuf.get(), nBytes);
rSt.WriteBytes(pBuf.get(), nBytes);
nBlipSize -= nBytes;
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 78d185bd0785..8900fd5a60fb 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -5425,7 +5425,7 @@ PPTPortionObj::PPTPortionObj( const PPTStyleSheet& rStyleSheet, TSS_Type nInstan
PPTCharPropSet ( 0 ),
mrStyleSheet ( rStyleSheet ),
mnInstance ( nInstance ),
- mnDepth ( ( nDepth > 4 ) ? 4 : nDepth )
+ mnDepth ( std::min<sal_uInt32>( nDepth, 4 ) )
{
}
@@ -5433,7 +5433,7 @@ PPTPortionObj::PPTPortionObj( const PPTCharPropSet& rCharPropSet, const PPTStyle
PPTCharPropSet ( rCharPropSet ),
mrStyleSheet ( rStyleSheet ),
mnInstance ( nInstance ),
- mnDepth ( ( nDepth > 4 ) ? 4 : nDepth )
+ mnDepth ( std::min<sal_uInt32>( nDepth, 4 ) )
{
}
@@ -7299,8 +7299,8 @@ void GetLinePositions( const SdrObject* pObj, const std::set< sal_Int32 >& rRows
else
nPosition |= aPt1.Y() < aPt2.Y() ? LinePositionBLTR : LinePositionTLBR;
- std::set< sal_Int32 >::const_iterator aRow( rRows.find( aPt1.Y() < aPt2.Y() ? aPt1.Y() : aPt2.Y() ) );
- std::set< sal_Int32 >::const_iterator aColumn( rColumns.find( aPt1.X() < aPt2.X() ? aPt1.X() : aPt2.X() ) );
+ std::set< sal_Int32 >::const_iterator aRow( rRows.find( std::min(aPt1.Y(), aPt2.Y() ) ) );
+ std::set< sal_Int32 >::const_iterator aColumn( rColumns.find( std::min(aPt1.X(), aPt2.X() ) ) );
if ( ( aRow != rRows.end() ) && ( aColumn != rColumns.end() ) )
{
nPosition |= ( std::distance( rRows.begin(), aRow ) * rColumns.size() ) + std::distance( rColumns.begin(), aColumn );