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 /editeng | |
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 'editeng')
-rw-r--r-- | editeng/source/uno/unoedhlp.cxx | 2 | ||||
-rw-r--r-- | editeng/source/uno/unotext2.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx index ee34063b5a67..3c86fddc35dc 100644 --- a/editeng/source/uno/unoedhlp.cxx +++ b/editeng/source/uno/unoedhlp.cxx @@ -165,7 +165,7 @@ bool SvxEditSourceHelper::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nE nClosestEndIndex_s = nCurrIndex; } } - sal_Int32 nClosestEndIndex = nClosestEndIndex_s < nClosestEndIndex_e ? nClosestEndIndex_s : nClosestEndIndex_e; + sal_Int32 nClosestEndIndex = std::min(nClosestEndIndex_s, nClosestEndIndex_e); nStartIndex = nClosestStartIndex; nEndIndex = nClosestEndIndex; diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 77405e435fa8..5adb8f73d3ae 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -58,7 +58,7 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase if( currentPara == maSelection.nStartPara ) nStartPos = std::max(nStartPos, maSelection.nStartPos); if( currentPara == maSelection.nEndPara ) - nEndPos = nEndPos<maSelection.nEndPos ? nEndPos : maSelection.nEndPos; + nEndPos = std::min(nEndPos, maSelection.nEndPos); ESelection aCurrentParaSel = ESelection( currentPara, nStartPos, currentPara, nEndPos ); for( auto aIter = rRanges.begin(); (aIter != rRanges.end()) && (pContent == nullptr); ++aIter ) { @@ -400,7 +400,7 @@ SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rTe continue; nStartPos = std::max<int>(nStartPos, mnSel.nStartPos); - nEndPos = nEndPos<mnSel.nEndPos ? nEndPos : mnSel.nEndPos; + nEndPos = std::min<sal_uInt16>(nEndPos, mnSel.nEndPos); ESelection aSel( mnParagraph, nStartPos, mnParagraph, nEndPos ); const SvxUnoTextRangeBaseList& rRanges( mpEditSource->getRanges() ); |