You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by af...@apache.org on 2012/07/05 17:49:30 UTC
svn commit: r1357698 - in /incubator/ooo/trunk/main/vcl: inc/vcl/region.hxx
source/gdi/region.cxx
Author: af
Date: Thu Jul 5 15:49:29 2012
New Revision: 1357698
URL: http://svn.apache.org/viewvc?rev=1357698&view=rev
Log:
#i120096# Detect empty polygon in Region constructor and set impl object accordingly.
Reported by: Du Jing
Fixed by: Andre Fischer
Modified:
incubator/ooo/trunk/main/vcl/inc/vcl/region.hxx
incubator/ooo/trunk/main/vcl/source/gdi/region.cxx
Modified: incubator/ooo/trunk/main/vcl/inc/vcl/region.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/inc/vcl/region.hxx?rev=1357698&r1=1357697&r2=1357698&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/inc/vcl/region.hxx (original)
+++ incubator/ooo/trunk/main/vcl/inc/vcl/region.hxx Thu Jul 5 15:49:29 2012
@@ -61,6 +61,7 @@ private:
SAL_DLLPRIVATE void ImplCopyData();
SAL_DLLPRIVATE void ImplCreateRectRegion( const Rectangle& rRect );
SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly );
+ SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const basegfx::B2DPolyPolygon& rPolyPoly );
SAL_DLLPRIVATE void ImplPolyPolyRegionToBandRegionFunc();
SAL_DLLPRIVATE inline void ImplPolyPolyRegionToBandRegion();
SAL_DLLPRIVATE const ImplRegion* ImplGetImplRegion() const { return mpImplRegion; }
Modified: incubator/ooo/trunk/main/vcl/source/gdi/region.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/region.cxx?rev=1357698&r1=1357697&r2=1357698&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/region.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/region.cxx Thu Jul 5 15:49:29 2012
@@ -1136,7 +1136,7 @@ Region::Region( const basegfx::B2DPolyPo
DBG_CTOR( Region, ImplDbgTestRegion );
DBG_CHKOBJ( &rPolyPoly, PolyPolygon, NULL );
- mpImplRegion = new ImplRegion( rPolyPoly );
+ ImplCreatePolyPolyRegion( rPolyPoly );
}
// -----------------------------------------------------------------------
@@ -1226,6 +1226,16 @@ void Region::ImplCreatePolyPolyRegion( c
// -----------------------------------------------------------------------
+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()
{
// ensure to subdivide when bezier segemnts are used, it's going to