summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-12 15:38:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-16 07:53:49 +0100
commitbf4bbc3c2174b21577b8878bc3197923ba44a029 (patch)
tree22ec4b4da1bc2b86b6b27776fd64fd2b89a9ed3e /starmath
parentb977a8786ff39f1348bafdbf2dd83e7008ed3086 (diff)
replace std::max(std::min()) with std::clamp
Change-Id: I890d19f5e2177294dc1175c90c98b964347f9e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105751 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/view.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 638a41b2daa2..9bf6a3080399 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -976,7 +976,7 @@ Size SmViewShell::GetTextSize(OutputDevice const & rDevice, const OUString& rTex
aLine = aLine.replaceAt(0, m, "");
aSize = GetTextLineSize(rDevice, aText);
aTextSize.AdjustHeight(aSize.Height() );
- aTextSize.setWidth( std::max(aTextSize.Width(), std::min(aSize.Width(), MaxWidth)) );
+ aTextSize.setWidth( std::clamp(aSize.Width(), aTextSize.Width(), MaxWidth) );
aLine = comphelper::string::stripStart(aLine, ' ');
aLine = comphelper::string::stripStart(aLine, '\t');
@@ -1193,7 +1193,7 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri
sal_uInt16 nZ = sal::static_int_cast<sal_uInt16>(std::min(tools::Long(Fraction(OutputSize.Width() * 100, GraphicSize.Width())),
tools::Long(Fraction(OutputSize.Height() * 100, GraphicSize.Height()))));
nZ -= 10;
- Fraction aFraction (std::max(MINZOOM, std::min(MAXZOOM, nZ)), 100);
+ Fraction aFraction (std::clamp(nZ, MINZOOM, sal_uInt16(100)));
OutputMapMode = MapMode(MapUnit::Map100thMM, Point(), aFraction, aFraction);
}