incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1402041 - /incubator/ooo/trunk/main/vcl/source/gdi/region.cxx
Date Thu, 25 Oct 2012 09:36:03 GMT
Author: alg
Date: Thu Oct 25 09:36:02 2012
New Revision: 1402041

URL: http://svn.apache.org/viewvc?rev=1402041&view=rev
Log:
#121237# Corrected Region export, was missing to write an end marker when RegionBand was empty

Modified:
    incubator/ooo/trunk/main/vcl/source/gdi/region.cxx

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=1402041&r1=1402040&r2=1402041&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/region.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/region.cxx Thu Oct 25 09:36:02 2012
@@ -1389,8 +1389,7 @@ bool Region::IsInside( const Point& rPoi
     //}
 
     // ensure RegionBand existance
-    const_cast< Region* >(this)->GetAsRegionBand();
-    const RegionBand* pRegionBand = getRegionBand();
+    const RegionBand* pRegionBand = GetAsRegionBand();
 
     if(pRegionBand)
     {
@@ -1673,6 +1672,14 @@ SvStream& operator<<( SvStream& rOStrm, 
     {
         pRegionBand->save(rOStrm);
     }
+    else
+    {
+        // for compatibility, write an empty RegionBand (will only write 
+        // the end marker STREAMENTRY_END, but this *is* needed)
+        const RegionBand aRegionBand;
+
+        aRegionBand.save(rOStrm);
+    }
 
     // write polypolygon if available
     const sal_Bool bHasPolyPolygon(rRegion.HasPolyPolygonOrB2DPolyPolygon());
@@ -1696,8 +1703,7 @@ void Region::GetRegionRectangles(Rectang
     rTarget.clear();
 
     // ensure RegionBand existance
-    const_cast< Region* >(this)->GetAsRegionBand();
-    const RegionBand* pRegionBand = getRegionBand();
+    const RegionBand* pRegionBand = GetAsRegionBand();
 
     if(pRegionBand)
     {



Mime
View raw message