diff options
Diffstat (limited to 'basegfx/source')
-rw-r--r-- | basegfx/source/color/makefile.mk | 2 | ||||
-rw-r--r-- | basegfx/source/matrix/b2dhommatrixtools.cxx | 2 | ||||
-rw-r--r-- | basegfx/source/pixel/makefile.mk | 2 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolygontools.cxx | 34 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygonrasterconverter.cxx | 3 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dsvgpolypolygon.cxx | 2 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dtrapezoid.cxx | 4 | ||||
-rw-r--r-- | basegfx/source/tools/keystoplerp.cxx | 3 |
8 files changed, 32 insertions, 20 deletions
diff --git a/basegfx/source/color/makefile.mk b/basegfx/source/color/makefile.mk index eec507899c4c..3627f8244d10 100644 --- a/basegfx/source/color/makefile.mk +++ b/basegfx/source/color/makefile.mk @@ -29,6 +29,8 @@ PRJ=..$/.. PRJNAME=basegfx TARGET=color +ENABLE_EXCEPTIONS=TRUE + # --- Settings ---------------------------------- .INCLUDE : settings.mk diff --git a/basegfx/source/matrix/b2dhommatrixtools.cxx b/basegfx/source/matrix/b2dhommatrixtools.cxx index 8c4b2d68a79b..5c24aaec973d 100644 --- a/basegfx/source/matrix/b2dhommatrixtools.cxx +++ b/basegfx/source/matrix/b2dhommatrixtools.cxx @@ -95,7 +95,7 @@ namespace basegfx break; default: - OSL_ENSURE( false, "createSinCos: Impossible case reached" ); + OSL_FAIL( "createSinCos: Impossible case reached" ); } } else diff --git a/basegfx/source/pixel/makefile.mk b/basegfx/source/pixel/makefile.mk index ab3c9a590ace..2766b7c06c8b 100644 --- a/basegfx/source/pixel/makefile.mk +++ b/basegfx/source/pixel/makefile.mk @@ -29,6 +29,8 @@ PRJ=..$/.. PRJNAME=basegfx TARGET=pixel +ENABLE_EXCEPTIONS=TRUE + # --- Settings ---------------------------------- .INCLUDE : settings.mk diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 5f053b4b22e2..eb96cec171e9 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -32,6 +32,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <osl/diagnose.h> #include <rtl/math.hxx> +#include <rtl/instance.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/range/b2drange.hxx> @@ -1836,22 +1837,31 @@ namespace basegfx return aRetval; } - B2DPolygon createUnitPolygon() + namespace { - static B2DPolygon aRetval; - - if(!aRetval.count()) + struct theUnitPolygon : + public rtl::StaticWithInit<B2DPolygon, theUnitPolygon> { - aRetval.append( B2DPoint( 0.0, 0.0 ) ); - aRetval.append( B2DPoint( 1.0, 0.0 ) ); - aRetval.append( B2DPoint( 1.0, 1.0 ) ); - aRetval.append( B2DPoint( 0.0, 1.0 ) ); + B2DPolygon operator () () + { + B2DPolygon aRetval; - // close - aRetval.setClosed( true ); - } + aRetval.append( B2DPoint( 0.0, 0.0 ) ); + aRetval.append( B2DPoint( 1.0, 0.0 ) ); + aRetval.append( B2DPoint( 1.0, 1.0 ) ); + aRetval.append( B2DPoint( 0.0, 1.0 ) ); - return aRetval; + // close + aRetval.setClosed( true ); + + return aRetval; + } + }; + } + + B2DPolygon createUnitPolygon() + { + return theUnitPolygon::get(); } B2DPolygon createPolygonFromCircle( const B2DPoint& rCenter, double fRadius ) diff --git a/basegfx/source/polygon/b2dpolypolygonrasterconverter.cxx b/basegfx/source/polygon/b2dpolypolygonrasterconverter.cxx index d6e1dee3fe6c..95c310b7dcc9 100644 --- a/basegfx/source/polygon/b2dpolypolygonrasterconverter.cxx +++ b/basegfx/source/polygon/b2dpolypolygonrasterconverter.cxx @@ -591,8 +591,7 @@ namespace basegfx switch( eFillRule ) { default: - OSL_ENSURE(false, - "B2DPolyPolygonRasterConverter::rasterConvert(): Unexpected fill rule"); + OSL_FAIL("B2DPolyPolygonRasterConverter::rasterConvert(): Unexpected fill rule"); return; case FillRule_EVEN_ODD: diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx index c42ea4d8b65b..50a04dbaa075 100644 --- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx +++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx @@ -826,7 +826,7 @@ namespace basegfx default: { - OSL_ENSURE(false, "importFromSvgD(): skipping tags in svg:d element (unknown)!"); + OSL_FAIL("importFromSvgD(): skipping tags in svg:d element (unknown)!"); OSL_TRACE("importFromSvgD(): skipping tags in svg:d element (unknown: \"%c\")!", aCurrChar); ++nPos; break; diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index 60f45f98d020..ad9c2dbecce4 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -622,7 +622,7 @@ namespace basegfx // to not have an endless loop and start next. During development // i constantly had breakpoints here, so i am sure enough to add an // assertion here - OSL_ENSURE(false, "Trapeziod decomposer in illegal state (!)"); + OSL_FAIL("Trapeziod decomposer in illegal state (!)"); maTrDeEdgeEntries.pop_front(); continue; } @@ -636,7 +636,7 @@ namespace basegfx // line; consume the single edge to not have an endless loop and start // next. During development i constantly had breakpoints here, so i am // sure enough to add an assertion here - OSL_ENSURE(false, "Trapeziod decomposer in illegal state (!)"); + OSL_FAIL("Trapeziod decomposer in illegal state (!)"); maTrDeEdgeEntries.pop_front(); continue; } diff --git a/basegfx/source/tools/keystoplerp.cxx b/basegfx/source/tools/keystoplerp.cxx index 8dc22c4e79e9..ef2ae11b4b0a 100644 --- a/basegfx/source/tools/keystoplerp.cxx +++ b/basegfx/source/tools/keystoplerp.cxx @@ -45,8 +45,7 @@ static void validateInput(const std::vector<double>& rKeyStops) for( ::std::size_t i=1, len=rKeyStops.size(); i<len; ++i ) { if( rKeyStops[i-1] > rKeyStops[i] ) - OSL_ENSURE( false, - "KeyStopLerp::KeyStopLerp(): time vector is not sorted in ascending order!" ); + OSL_FAIL( "KeyStopLerp::KeyStopLerp(): time vector is not sorted in ascending order!" ); } #endif } |