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 /sc/inc/address.hxx | |
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 'sc/inc/address.hxx')
-rw-r--r-- | sc/inc/address.hxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index 0c4610d98474..2be0ff1ccb7b 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -121,17 +121,17 @@ SAL_WARN_UNUSED_RESULT inline bool ValidColRowTab( SCCOL nCol, SCROW nRow, SCTAB SAL_WARN_UNUSED_RESULT inline SCCOL SanitizeCol( SCCOL nCol ) { - return nCol < 0 ? 0 : (nCol > MAXCOL ? MAXCOL : nCol); + return nCol < 0 ? 0 : std::min(nCol, MAXCOL); } SAL_WARN_UNUSED_RESULT inline SCROW SanitizeRow( SCROW nRow ) { - return nRow < 0 ? 0 : (nRow > MAXROW ? MAXROW : nRow); + return nRow < 0 ? 0 : std::min(nRow, MAXROW); } SAL_WARN_UNUSED_RESULT inline SCTAB SanitizeTab( SCTAB nTab ) { - return nTab < 0 ? 0 : (nTab > MAXTAB ? MAXTAB : nTab); + return nTab < 0 ? 0 : std::min(nTab, MAXTAB); } // The result of ConvertRef() is a bit group of the following: |