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 /sw/source/filter/ww8 | |
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 'sw/source/filter/ww8')
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 51fad2582a4e..5257679489ed 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -675,7 +675,7 @@ void MSWordStyles::OutputStylesTable() // so simply if there are more styles, don't export those // Implementing check for all exports DOCX, DOC, RTF sal_uInt16 nLimit = MSWORD_MAX_STYLES_LIMIT; - m_nUsedSlots = (nLimit > m_nUsedSlots)? m_nUsedSlots : nLimit; + m_nUsedSlots = std::min(nLimit, m_nUsedSlots); for ( n = 0; n < m_nUsedSlots; n++ ) { diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c5f1429262f7..cfc7123e3673 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3125,7 +3125,7 @@ namespace sal_uInt8 in[WW_BLOCKSIZE]; for (std::size_t nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock) { - std::size_t nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI; + std::size_t nBS = std::min(nLen - nI, WW_BLOCKSIZE); nBS = rIn.ReadBytes(in, nBS); rCtx.InitCipher(nBlock); rCtx.Encode(in, nBS, in, nBS); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index e875205ae5c9..50f57141a9ab 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5478,7 +5478,7 @@ namespace sal_uInt8 in[WW_BLOCKSIZE]; for (std::size_t nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock) { - std::size_t nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI; + std::size_t nBS = std::min<size_t>(nLen - nI, WW_BLOCKSIZE); nBS = rIn.ReadBytes(in, nBS); rCtx.InitCipher(nBlock); rCtx.Decode(in, nBS, in, nBS); @@ -5499,7 +5499,7 @@ namespace sal_uInt8 in[0x4096]; for (std::size_t nI = nSt; nI < nLen; nI += 0x4096) { - std::size_t nBS = (nLen - nI > 0x4096 ) ? 0x4096 : nLen - nI; + std::size_t nBS = std::min<size_t>(nLen - nI, 0x4096 ); nBS = rIn.ReadBytes(in, nBS); rCtx.Decode(in, nBS); rOut.WriteBytes(in, nBS); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index a881fab5be0c..0ab07dfcadce 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -7471,7 +7471,7 @@ WW8Dop::WW8Dop(SvStream& rSt, sal_Int16 nFib, sal_Int32 nPos, sal_uInt32 nSize) std::unique_ptr<sal_uInt8[]> pDataPtr( new sal_uInt8[ nMaxDopSize ] ); sal_uInt8* pData = pDataPtr.get(); - sal_uInt32 nRead = nMaxDopSize < nSize ? nMaxDopSize : nSize; + sal_uInt32 nRead = std::min(nMaxDopSize, nSize); if (nSize < 2 || !checkSeek(rSt, nPos) || nRead != rSt.ReadBytes(pData, nRead)) nDopError = ERR_SWG_READ_ERROR; // report error else |