Author: jsc
Date: Fri Mar 28 10:52:29 2014
New Revision: 1582688

URL: http://svn.apache.org/r1582688
Log:
#124453# merge from aoo410 branch, check if the resulting polygon has already 
exceeded the number of points (2^16) that can be handled by a tools polygon

Modified:
    openoffice/trunk/main/tools/source/generic/poly.cxx

Modified: openoffice/trunk/main/tools/source/generic/poly.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/tools/source/generic/poly.cxx?rev=1582688&r1=1582687&r2=1582688&view=diff
==============================================================================
--- openoffice/trunk/main/tools/source/generic/poly.cxx (original)
+++ openoffice/trunk/main/tools/source/generic/poly.cxx Fri Mar 28 10:52:29 2014
@@ -1076,6 +1076,19 @@ void Polygon::AdaptiveSubdivide( Polygon
             }
 
             *aPointIter++ = mpImplPolygon->mpPointAry[ i++ ];
+
+            if (aPoints.size() >= SAL_MAX_UINT16)
+            {
+                OSL_ENSURE(aPoints.size() < SAL_MAX_UINT16,
+                    "Polygon::AdapativeSubdivision created polygon too many 
points;"
+                    " using original polygon instead");
+
+                // The resulting polygon can not hold all the points
+                // that we have created so far.  Stop the subdivision
+                // and return a copy of the unmodified polygon.
+                rResult = *this;
+                return;
+            }
                }
 
                // fill result polygon


Reply via email to