summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-08 17:01:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-11 07:35:43 +0100
commitf14b9d30293f180500fc56d81e5390021758e7c1 (patch)
treea6cd0b853169203cfa0953230e6774e7b1dd81b4 /editeng
parentd11120b95ee27cb4b05db466ed07f7a996dda125 (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')
-rw-r--r--editeng/source/items/borderline.cxx2
-rw-r--r--editeng/source/uno/unoedhlp.cxx2
-rw-r--r--editeng/source/uno/unotext2.cxx4
3 files changed, 4 insertions, 4 deletions
diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index 3005e3161827..e62b15d4c73d 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -192,7 +192,7 @@ ConvertBorderWidthFromWord(SvxBorderLineStyle const eStyle, double const i_fWidt
case 2:
return (fWidth * 2.0); // thick
case 5: // fdo#55526: map 0 hairline width to > 0
- return (fWidth > 1.0) ? fWidth : 1.0;
+ return std::max(fWidth, 1.0);
default:
return fWidth;
}
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 );