incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1359641 - in /incubator/ooo/branches/AOO34: ./ main/ main/vcl/inc/vcl/region.hxx main/vcl/source/gdi/region.cxx
Date Tue, 10 Jul 2012 12:46:09 GMT
Author: af
Date: Tue Jul 10 12:46:09 2012
New Revision: 1359641

URL: http://svn.apache.org/viewvc?rev=1359641&view=rev
Log:
#i120096# Detect empty polygon in Region constructor and set impl object accordingly.
          (Merged from trunk)
          Reported by: Du Jing
          Fixed by: Andre Fischer

Modified:
    incubator/ooo/branches/AOO34/   (props changed)
    incubator/ooo/branches/AOO34/main/   (props changed)
    incubator/ooo/branches/AOO34/main/vcl/inc/vcl/region.hxx
    incubator/ooo/branches/AOO34/main/vcl/source/gdi/region.cxx

Propchange: incubator/ooo/branches/AOO34/
------------------------------------------------------------------------------
  Merged /incubator/ooo/trunk:r1357698

Propchange: incubator/ooo/branches/AOO34/main/
------------------------------------------------------------------------------
  Merged /incubator/ooo/trunk/main:r1357698

Modified: incubator/ooo/branches/AOO34/main/vcl/inc/vcl/region.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/AOO34/main/vcl/inc/vcl/region.hxx?rev=1359641&r1=1359640&r2=1359641&view=diff
==============================================================================
--- incubator/ooo/branches/AOO34/main/vcl/inc/vcl/region.hxx (original)
+++ incubator/ooo/branches/AOO34/main/vcl/inc/vcl/region.hxx Tue Jul 10 12:46:09 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/branches/AOO34/main/vcl/source/gdi/region.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/AOO34/main/vcl/source/gdi/region.cxx?rev=1359641&r1=1359640&r2=1359641&view=diff
==============================================================================
--- incubator/ooo/branches/AOO34/main/vcl/source/gdi/region.cxx (original)
+++ incubator/ooo/branches/AOO34/main/vcl/source/gdi/region.cxx Tue Jul 10 12:46:09 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



Mime
View raw message