diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-08-03 12:30:51 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-08-03 12:30:51 +0000 |
commit | 4a086f0c27ea5fb5e0dbbb75711bfd992a8f9904 (patch) | |
tree | d8dec3ca0218923343276379437505838b9bccc5 /basegfx | |
parent | 0ae8fc1d55d632dd5ed4ea5443c137a5f262c267 (diff) |
INTEGRATION: CWS aw017 (1.7.34); FILE MERGED
2004/07/29 14:04:30 aw 1.7.34.1: #i25616#
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygontools.cxx | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index 48097ece634d..3cfeb076fd9c 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpolypolygontools.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: aw $ $Date: 2004-02-03 18:18:23 $ + * last change: $Author: hr $ $Date: 2004-08-03 13:30:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,6 +87,8 @@ #include <basegfx/polygon/b2dpolypolygoncutter.hxx> #endif +#include <numeric> + ////////////////////////////////////////////////////////////////////////////// namespace basegfx @@ -238,12 +240,20 @@ namespace basegfx B2DPolyPolygon applyLineDashing(const B2DPolyPolygon& rCandidate, const ::std::vector<double>& raDashDotArray, double fFullDashDotLen) { B2DPolyPolygon aRetval; - const sal_uInt32 nPolygonCount(rCandidate.count()); - for(sal_uInt32 a(0L); a < nPolygonCount; a++) + if(0.0 == fFullDashDotLen && raDashDotArray.size()) { - B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); - aRetval.append(applyLineDashing(aCandidate, raDashDotArray, fFullDashDotLen)); + // calculate fFullDashDotLen from raDashDotArray + fFullDashDotLen = ::std::accumulate(raDashDotArray.begin(), raDashDotArray.end(), 0.0); + } + + if(rCandidate.count() && fFullDashDotLen > 0.0) + { + for(sal_uInt32 a(0L); a < rCandidate.count(); a++) + { + B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); + aRetval.append(applyLineDashing(aCandidate, raDashDotArray, fFullDashDotLen)); + } } return aRetval; |