summaryrefslogtreecommitdiff
path: root/basegfx/source/polygon
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-07-21 18:56:16 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-07-21 18:56:16 +0200
commita233dac0653f3f3054f7ad2da114ed989747e89a (patch)
treebf1e11438321c06125a94308649c496648061ccb /basegfx/source/polygon
parentacb6133d89abe071108577f821d7eaa381378879 (diff)
parente5647de7dd26775e45af24f11ac4f82a5518bd9e (diff)
resyncing to master
Diffstat (limited to 'basegfx/source/polygon')
-rw-r--r--basegfx/source/polygon/b2dpolypolygon.cxx19
-rw-r--r--basegfx/source/polygon/b2dsvgpolypolygon.cxx7
2 files changed, 6 insertions, 20 deletions
diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx
index 4c8ab7b44a45..b55af03e9575 100644
--- a/basegfx/source/polygon/b2dpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dpolypolygon.cxx
@@ -93,21 +93,10 @@ public:
void insert(sal_uInt32 nIndex, const basegfx::B2DPolyPolygon& rPolyPolygon)
{
- const sal_uInt32 nCount = rPolyPolygon.count();
-
- if(nCount)
- {
- // add nCount polygons from rPolyPolygon
- maPolygons.reserve(maPolygons.size() + nCount);
- PolygonVector::iterator aIndex(maPolygons.begin());
- aIndex += nIndex;
-
- for(sal_uInt32 a(0L); a < nCount; a++)
- {
- aIndex = maPolygons.insert(aIndex, rPolyPolygon.getB2DPolygon(a));
- ++aIndex;
- }
- }
+ // add all polygons from rPolyPolygon
+ PolygonVector::iterator aIndex(maPolygons.begin());
+ aIndex += nIndex;
+ maPolygons.insert(aIndex, rPolyPolygon.begin(), rPolyPolygon.end());
}
void remove(sal_uInt32 nIndex, sal_uInt32 nCount)
diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index 50a04dbaa075..074cfd9e25d5 100644
--- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
@@ -787,10 +787,7 @@ namespace basegfx
// (since
// createPolygonFromEllipseSegment()
// normalizes to e.g. cw arc)
- const bool bLessThanPi(fmod(fTheta2+2*M_PI-fTheta1,
- 2*M_PI)<M_PI);
- const bool bFlipSegment( (bLargeArcFlag!=0) == bLessThanPi );
- if( bFlipSegment )
+ if( !bSweepFlag )
std::swap(fTheta1,fTheta2);
// finally, create bezier polygon from this
@@ -812,7 +809,7 @@ namespace basegfx
// always creates arcs that are
// positively oriented - flip polygon
// if we swapped angles above
- if( bFlipSegment )
+ if( !bSweepFlag )
aSegment.flip();
aCurrPoly.append(aSegment);
}