Kaydet (Commit) dbd0cea6 authored tarafından Andre Fischer's avatar Andre Fischer

#i120096# Detect empty polygon in Region constructor and set impl object accordingly.

Reported by: Du Jing
Fixed by: Andre Fischer
üst 2df66d39
...@@ -61,6 +61,7 @@ private: ...@@ -61,6 +61,7 @@ private:
SAL_DLLPRIVATE void ImplCopyData(); SAL_DLLPRIVATE void ImplCopyData();
SAL_DLLPRIVATE void ImplCreateRectRegion( const Rectangle& rRect ); SAL_DLLPRIVATE void ImplCreateRectRegion( const Rectangle& rRect );
SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly ); SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly );
SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const basegfx::B2DPolyPolygon& rPolyPoly );
SAL_DLLPRIVATE void ImplPolyPolyRegionToBandRegionFunc(); SAL_DLLPRIVATE void ImplPolyPolyRegionToBandRegionFunc();
SAL_DLLPRIVATE inline void ImplPolyPolyRegionToBandRegion(); SAL_DLLPRIVATE inline void ImplPolyPolyRegionToBandRegion();
SAL_DLLPRIVATE const ImplRegion* ImplGetImplRegion() const { return mpImplRegion; } SAL_DLLPRIVATE const ImplRegion* ImplGetImplRegion() const { return mpImplRegion; }
......
...@@ -1136,7 +1136,7 @@ Region::Region( const basegfx::B2DPolyPolygon& rPolyPoly ) ...@@ -1136,7 +1136,7 @@ Region::Region( const basegfx::B2DPolyPolygon& rPolyPoly )
DBG_CTOR( Region, ImplDbgTestRegion ); DBG_CTOR( Region, ImplDbgTestRegion );
DBG_CHKOBJ( &rPolyPoly, PolyPolygon, NULL ); DBG_CHKOBJ( &rPolyPoly, PolyPolygon, NULL );
mpImplRegion = new ImplRegion( rPolyPoly ); ImplCreatePolyPolyRegion( rPolyPoly );
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -1226,6 +1226,16 @@ void Region::ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly ) ...@@ -1226,6 +1226,16 @@ void Region::ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly )
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void Region::ImplCreatePolyPolyRegion( const basegfx::B2DPolyPolygon& rPolyPoly )
{
if (rPolyPoly.count()==0 || rPolyPoly.getB2DRange().isEmpty())
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
else
mpImplRegion = new ImplRegion( rPolyPoly );
}
// -----------------------------------------------------------------------
void Region::ImplPolyPolyRegionToBandRegionFunc() void Region::ImplPolyPolyRegionToBandRegionFunc()
{ {
// ensure to subdivide when bezier segemnts are used, it's going to // ensure to subdivide when bezier segemnts are used, it's going to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment