summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-11 08:47:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-15 07:26:17 +0100
commit7d8e94444d989d0ac4a4055b207726708e9ec0da (patch)
treece3e4a09ed7932496c4d901360ff23787c8f6e24 /slideshow
parent80fb8d406ced47e6a2089f0c8ba5c103d2fec91f (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 'slideshow')
-rw-r--r--slideshow/source/engine/opengl/TransitionImpl.cxx4
-rw-r--r--slideshow/source/engine/transitions/spiralwipe.cxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/slideshow/source/engine/opengl/TransitionImpl.cxx b/slideshow/source/engine/opengl/TransitionImpl.cxx
index bb6557f4638f..927e0d72130d 100644
--- a/slideshow/source/engine/opengl/TransitionImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionImpl.cxx
@@ -1094,9 +1094,9 @@ float fdiv(int a, int b)
glm::vec2 vec(float x, float y, float nx, float ny)
{
x = x < 0.0 ? 0.0 : x;
- x = x > nx ? nx : x;
+ x = std::min(x, nx);
y = y < 0.0 ? 0.0 : y;
- y = y > ny ? ny : y;
+ y = std::min(y, ny);
return glm::vec2(fdiv(x, nx), fdiv(y, ny));
}
diff --git a/slideshow/source/engine/transitions/spiralwipe.cxx b/slideshow/source/engine/transitions/spiralwipe.cxx
index 216c513ff470..6ecad1712ed4 100644
--- a/slideshow/source/engine/transitions/spiralwipe.cxx
+++ b/slideshow/source/engine/transitions/spiralwipe.cxx
@@ -58,7 +58,7 @@ SpiralWipe::SpiralWipe( sal_Int32 nElements, bool flipOnYAxis )
sal_Int32 len = static_cast<sal_Int32>( (e - (edge /2)) * edge1 * 4 );
double w = M_PI_2;
while (len > 0) {
- const sal_Int32 alen = (len > edge1 ? edge1 : len);
+ const sal_Int32 alen = std::min(len, edge1);
len -= alen;
poly = createUnitRect();
aTransform = basegfx::utils::createScaleB2DHomMatrix(