diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-08 17:01:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-11 07:35:43 +0100 |
commit | f14b9d30293f180500fc56d81e5390021758e7c1 (patch) | |
tree | a6cd0b853169203cfa0953230e6774e7b1dd81b4 /editeng/source/uno | |
parent | d11120b95ee27cb4b05db466ed07f7a996dda125 (diff) |
convert (a>b?a:b) to std::max(a,b)
with something like:
git grep -nP '(.*)\s*>\s*(.*)\s*\?\s*\g1\s*:\s*\g2'
Change-Id: I60b9a3a2a09162bc0de4c13fdde2c209696e5413
Reviewed-on: https://gerrit.libreoffice.org/47602
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/uno')
-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 767a7c14b41f..ee34063b5a67 100644 --- a/editeng/source/uno/unoedhlp.cxx +++ b/editeng/source/uno/unoedhlp.cxx @@ -144,7 +144,7 @@ bool SvxEditSourceHelper::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nE nClosestStartIndex_e = nCurrIndex; } } - sal_Int32 nClosestStartIndex = nClosestStartIndex_s > nClosestStartIndex_e ? nClosestStartIndex_s : nClosestStartIndex_e; + sal_Int32 nClosestStartIndex = std::max(nClosestStartIndex_s, nClosestStartIndex_e); // find closest index behind of nIndex sal_Int32 nClosestEndIndex_s, nClosestEndIndex_e; diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 8e059941c0d2..ddd85b8f743f 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -56,7 +56,7 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase sal_Int32 nStartPos = 0; sal_Int32 nEndPos = mrText.GetEditSource()->GetTextForwarder()->GetTextLen( currentPara ); if( currentPara == maSelection.nStartPara ) - nStartPos = nStartPos>maSelection.nStartPos ? nStartPos : maSelection.nStartPos; + nStartPos = std::max(nStartPos, maSelection.nStartPos); if( currentPara == maSelection.nEndPara ) nEndPos = nEndPos<maSelection.nEndPos ? nEndPos : maSelection.nEndPos; ESelection aCurrentParaSel = ESelection( currentPara, nStartPos, currentPara, nEndPos ); @@ -399,7 +399,7 @@ SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rTe if( nEndPos < mnSel.nStartPos ) continue; - nStartPos = nStartPos>mnSel.nStartPos ? nStartPos : mnSel.nStartPos; + nStartPos = std::max<int>(nStartPos, mnSel.nStartPos); nEndPos = nEndPos<mnSel.nEndPos ? nEndPos : mnSel.nEndPos; ESelection aSel( mnParagraph, nStartPos, mnParagraph, nEndPos ); |