summaryrefslogtreecommitdiff
path: root/embeddedobj
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 /embeddedobj
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 'embeddedobj')
-rw-r--r--embeddedobj/source/commonembedding/embedobj.cxx4
-rw-r--r--embeddedobj/source/msole/ownview.cxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index 32c5085232dc..9aefab91ae79 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -65,8 +65,8 @@ awt::Rectangle GetRectangleInterception( const awt::Rectangle& aRect1, const awt
sal_Int32 nBottom1 = aRect1.Y + aRect1.Height;
sal_Int32 nRight2 = aRect2.X + aRect2.Width;
sal_Int32 nBottom2 = aRect2.Y + aRect2.Height;
- aResult.Width = ( nRight1 < nRight2 ? nRight1 : nRight2 ) - aResult.X;
- aResult.Height = ( nBottom1 < nBottom2 ? nBottom1 : nBottom2 ) - aResult.Y;
+ aResult.Width = std::min( nRight1, nRight2 ) - aResult.X;
+ aResult.Height = std::min( nBottom1, nBottom2 ) - aResult.Y;
return aResult;
}
diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx
index cff8b66ea56b..9ab6cc0f1654 100644
--- a/embeddedobj/source/msole/ownview.cxx
+++ b/embeddedobj/source/msole/ownview.cxx
@@ -330,7 +330,7 @@ bool OwnView_Impl::ReadContentsAndGenerateTempFile( const uno::Reference< io::XI
sal_uInt32 nRead = 0;
while ( nRead < nDataSize )
{
- sal_uInt32 nToRead = ( nDataSize - nRead > 32000 ) ? 32000 : nDataSize - nRead;
+ sal_uInt32 nToRead = std::min<sal_uInt32>( nDataSize - nRead, 32000 );
sal_uInt32 nLocalRead = xInStream->readBytes( aReadSeq, nToRead );