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 /starmath | |
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 'starmath')
-rw-r--r-- | starmath/source/view.cxx | 2 | ||||
-rw-r--r-- | starmath/source/visitors.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 0a5ef6970b07..21e3e619a978 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -912,7 +912,7 @@ void SmViewShell::QueryObjAreaPixel( tools::Rectangle& rRect ) const void SmViewShell::SetZoomFactor( const Fraction &rX, const Fraction &rY ) { - const Fraction &rFrac = rX < rY ? rX : rY; + const Fraction &rFrac = std::min(rX, rY); GetGraphicWindow().SetZoom(sal::static_int_cast<sal_uInt16>(long(rFrac * Fraction( 100, 1 )))); //To avoid rounding errors base class regulates crooked values too diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index a9d090251368..004c153bfdc4 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -674,7 +674,7 @@ void SmSetSelectionVisitor::Visit( SmTextNode* pNode ) { long start, end; pNode->SetSelected(true); if( i1 != -1 && i2 != -1 ) { - start = i1 < i2 ? i1 : i2; //MIN + start = std::min(i1, i2); end = std::max(i1, i2); } else if( mbSelecting && i1 != -1 ) { start = 0; |