diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-04-26 15:08:36 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-04-26 17:04:01 +0200 |
commit | bdff0bb77b57def835fcaed3bded7519e69dc896 (patch) | |
tree | c330add464f566a32ebd82dd9ad29f91ba0d87f8 /basegfx | |
parent | 651527b4efe9700c8c8dff58ce5aa86ad5681f16 (diff) |
Use o3tl::make_unsigned in some places
...where a signed and an unsigned value are compared, and the signed value has
just been proven to be non-negative here
Change-Id: I9665e6c2c4c5557f2d4cf1bb646f9fffc7bd7d30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133442
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/tools/unopolypolygon.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/basegfx/source/tools/unopolypolygon.cxx b/basegfx/source/tools/unopolypolygon.cxx index 48b3372d5526..ce61a5d3451b 100644 --- a/basegfx/source/tools/unopolypolygon.cxx +++ b/basegfx/source/tools/unopolypolygon.cxx @@ -229,7 +229,7 @@ namespace basegfx::unotools const B2DPolygon& rPoly( maPolyPoly.getB2DPolygon( nPolygonIndex ) ); - if( nPointIndex < 0 || nPointIndex >= static_cast<sal_Int32>(rPoly.count()) ) + if( nPointIndex < 0 || o3tl::make_unsigned(nPointIndex) >= rPoly.count() ) throw lang::IndexOutOfBoundsException(); return unotools::point2DFromB2DPoint( rPoly.getB2DPoint( nPointIndex ) ); @@ -246,7 +246,7 @@ namespace basegfx::unotools B2DPolygon aPoly( maPolyPoly.getB2DPolygon( nPolygonIndex ) ); - if( nPointIndex < 0 || nPointIndex >= static_cast<sal_Int32>(aPoly.count()) ) + if( nPointIndex < 0 || o3tl::make_unsigned(nPointIndex) >= aPoly.count() ) throw lang::IndexOutOfBoundsException(); aPoly.setB2DPoint( nPointIndex, @@ -297,7 +297,7 @@ namespace basegfx::unotools const B2DPolygon& rPoly( maPolyPoly.getB2DPolygon( nPolygonIndex ) ); const sal_uInt32 nPointCount(rPoly.count()); - if( nPointIndex < 0 || nPointIndex >= static_cast<sal_Int32>(nPointCount) ) + if( nPointIndex < 0 || o3tl::make_unsigned(nPointIndex) >= nPointCount ) throw lang::IndexOutOfBoundsException(); const B2DPoint& rPt( rPoly.getB2DPoint( nPointIndex ) ); @@ -323,7 +323,7 @@ namespace basegfx::unotools B2DPolygon aPoly( maPolyPoly.getB2DPolygon( nPolygonIndex ) ); const sal_uInt32 nPointCount(aPoly.count()); - if( nPointIndex < 0 || nPointIndex >= static_cast<sal_Int32>(nPointCount) ) + if( nPointIndex < 0 || o3tl::make_unsigned(nPointIndex) >= nPointCount ) throw lang::IndexOutOfBoundsException(); aPoly.setB2DPoint( nPointIndex, |