summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ├╝rgen Schmidt <jsc@apache.org>2014-03-28 10:52:29 +0000
committerAndras Timar <andras.timar@collabora.com>2014-04-02 15:28:16 +0200
commit6ea4789e99c92994d083b13fd8efee8c35987561 (patch)
tree0b2e2cd03e96a6fa1b4572c07115f25286e19532
parent799f9805b761ff1930a9864a0d7f44966328906b (diff)
Resolves: #i124453# check if the resulting polygon...
has already exceeded the number of points (2^16) that can be handled by a tools polygon (cherry picked from commit 804e547d70552fd64e1344d538427f8898824b43) Change-Id: I437a84493e264f7b650561599170e831da20c9aa (cherry picked from commit a9582c05f854cad02710178ab7fa79498573269e) (cherry picked from commit ab71a4512557b7290cd7b1b4923463052acf164e)
-rw-r--r--tools/source/generic/poly.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 585e915799d5..6f2805b91e39 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -910,6 +910,19 @@ void Polygon::AdaptiveSubdivide( Polygon& rResult, const double d ) const
}
*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