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 /chart2 | |
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 'chart2')
-rw-r--r-- | chart2/source/controller/dialogs/DataBrowser.cxx | 2 | ||||
-rw-r--r-- | chart2/source/view/charttypes/GL3DBarChart.cxx | 2 | ||||
-rw-r--r-- | chart2/source/view/charttypes/Splines.cxx | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 31372feab01a..6a615ad7b409 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -297,7 +297,7 @@ void SeriesHeader::SetSeriesName( const OUString & rName ) void SeriesHeader::SetRange( sal_Int32 nStartCol, sal_Int32 nEndCol ) { m_nStartCol = nStartCol; - m_nEndCol = (nEndCol > nStartCol) ? nEndCol : nStartCol; + m_nEndCol = std::max(nEndCol, nStartCol); m_spSeriesName->setStartColumn( nStartCol ); } diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index a7a3f2feae20..e3e8db81d140 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -1479,7 +1479,7 @@ void GL3DBarChart::processAutoFly(sal_uInt32 nId, sal_uInt32 nColor) maRenderEvent = EVENT_AUTO_FLY; mnSelectBarId = nColorRate > mnColorRate ? nId : mnSelectBarId; mnPreSelectBarId = mnSelectBarId; - mnColorRate = nColorRate > mnColorRate ? nColorRate : mnColorRate; + mnColorRate = std::max(nColorRate, mnColorRate); } } diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx index fa31a609c61e..4ff16718f242 100644 --- a/chart2/source/view/charttypes/Splines.cxx +++ b/chart2/source/view/charttypes/Splines.cxx @@ -420,7 +420,7 @@ bool createParameterT(const tPointVecType& rUniquePoints, double* t) dx = rUniquePoints[i].first - rUniquePoints[i-1].first; dy = rUniquePoints[i].second - rUniquePoints[i-1].second; // scaling to avoid underflow or overflow - fDiffMax = (fabs(dx)>fabs(dy)) ? fabs(dx) : fabs(dy); + fDiffMax = std::max(fabs(dx), fabs(dy)); if (fDiffMax == 0.0) { bIsSuccessful = false; @@ -446,7 +446,7 @@ bool createParameterT(const tPointVecType& rUniquePoints, double* t) { dx = rUniquePoints[i].first - rUniquePoints[i-1].first; dy = rUniquePoints[i].second - rUniquePoints[i-1].second; - fDiffMax = (fabs(dx)>fabs(dy)) ? fabs(dx) : fabs(dy); + fDiffMax = std::max(fabs(dx), fabs(dy)); // same as above, so should not be zero dx /= fDiffMax; dy /= fDiffMax; |