summaryrefslogtreecommitdiff
path: root/starmath/source
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 /starmath/source
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 'starmath/source')
-rw-r--r--starmath/source/edit.cxx2
-rw-r--r--starmath/source/visitors.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 84094839b961..e6bf5138fd06 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -284,7 +284,7 @@ void SmEditWindow::Resize()
if (pEditView->GetVisArea().Top() > nMaxVisAreaStart)
{
tools::Rectangle aVisArea(pEditView->GetVisArea() );
- aVisArea.Top() = (nMaxVisAreaStart > 0 ) ? nMaxVisAreaStart : 0;
+ aVisArea.Top() = std::max<long>(nMaxVisAreaStart, 0);
aVisArea.SetSize(pEditView->GetOutputArea().GetSize());
pEditView->SetVisArea(aVisArea);
pEditView->ShowCursor();
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 510b4d0b2e37..a9d090251368 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -675,7 +675,7 @@ void SmSetSelectionVisitor::Visit( SmTextNode* pNode ) {
pNode->SetSelected(true);
if( i1 != -1 && i2 != -1 ) {
start = i1 < i2 ? i1 : i2; //MIN
- end = i1 > i2 ? i1 : i2; //MAX
+ end = std::max(i1, i2);
} else if( mbSelecting && i1 != -1 ) {
start = 0;
end = i1;