summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-01-11 15:26:59 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-11 20:25:08 +0100
commit27cd397b1a1a8a39843c093eff68c5ea6cb249e7 (patch)
treeecf63804421b12987ae070a24a6ed967f29de1d8 /svgio
parent5b19be032c51e0f7489b29c2c98e484587ed0865 (diff)
Drop o3tl/clamp.hxx, use C++17 std::clamp instead
Change-Id: I5043c787dcc3b78bc7fdff130564801194e39f46 Reviewed-on: https://gerrit.libreoffice.org/66177 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svgio')
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index fd17e3ee3241..b0c45fb90372 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -19,7 +19,8 @@
#include <sal/config.h>
-#include <o3tl/clamp.hxx>
+#include <algorithm>
+
#include <svgstyleattributes.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
@@ -1330,7 +1331,7 @@ namespace svgio
setFill(aSvgPaint);
if(aOpacity.isSet())
{
- setOpacity(SvgNumber(o3tl::clamp(aOpacity.getNumber(), 0.0, 1.0)));
+ setOpacity(SvgNumber(std::clamp(aOpacity.getNumber(), 0.0, 1.0)));
}
}
else if(!aURL.isEmpty())
@@ -1357,7 +1358,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
- maFillOpacity = SvgNumber(o3tl::clamp(aNum.getNumber(), 0.0, 1.0), aNum.getUnit(), aNum.isSet());
+ maFillOpacity = SvgNumber(std::clamp(aNum.getNumber(), 0.0, 1.0), aNum.getUnit(), aNum.isSet());
}
break;
}
@@ -1387,7 +1388,7 @@ namespace svgio
maStroke = aSvgPaint;
if(aOpacity.isSet())
{
- setOpacity(SvgNumber(o3tl::clamp(aOpacity.getNumber(), 0.0, 1.0)));
+ setOpacity(SvgNumber(std::clamp(aOpacity.getNumber(), 0.0, 1.0)));
}
}
else if(!aURL.isEmpty())
@@ -1500,7 +1501,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
- maStrokeOpacity = SvgNumber(o3tl::clamp(aNum.getNumber(), 0.0, 1.0), aNum.getUnit(), aNum.isSet());
+ maStrokeOpacity = SvgNumber(std::clamp(aNum.getNumber(), 0.0, 1.0), aNum.getUnit(), aNum.isSet());
}
break;
}
@@ -1528,7 +1529,7 @@ namespace svgio
maStopColor = aSvgPaint;
if(aOpacity.isSet())
{
- setOpacity(SvgNumber(o3tl::clamp(aOpacity.getNumber(), 0.0, 1.0)));
+ setOpacity(SvgNumber(std::clamp(aOpacity.getNumber(), 0.0, 1.0)));
}
}
break;
@@ -1841,7 +1842,7 @@ namespace svgio
maColor = aSvgPaint;
if(aOpacity.isSet())
{
- setOpacity(SvgNumber(o3tl::clamp(aOpacity.getNumber(), 0.0, 1.0)));
+ setOpacity(SvgNumber(std::clamp(aOpacity.getNumber(), 0.0, 1.0)));
}
}
break;
@@ -1852,7 +1853,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
- setOpacity(SvgNumber(o3tl::clamp(aNum.getNumber(), 0.0, 1.0), aNum.getUnit(), aNum.isSet()));
+ setOpacity(SvgNumber(std::clamp(aNum.getNumber(), 0.0, 1.0), aNum.getUnit(), aNum.isSet()));
}
break;
}