summaryrefslogtreecommitdiff
path: root/basegfx/source/polygon/b2dpolypolygon.cxx
diff options
context:
space:
mode:
authorthb <thb@openoffice.org>2009-10-16 22:58:23 +0200
committerthb <thb@openoffice.org>2009-10-16 22:58:23 +0200
commit42c0c069b71db77b3a0f1617dac3c569df798625 (patch)
tree82d1cc56cc8e60aca8f11a790219fb9d6125ca12 /basegfx/source/polygon/b2dpolypolygon.cxx
parentd3356548cf6aa4c53cb4c17395df82e8bbdea88f (diff)
#i105939# Decided returning by const ref was a bad idea, coupling-
and in terms of unwanted side effects (think vector re-allocating the mem). Fixed iterator-to-ptr conversion for obvious oversights.
Diffstat (limited to 'basegfx/source/polygon/b2dpolypolygon.cxx')
-rw-r--r--basegfx/source/polygon/b2dpolypolygon.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx
index af63bbccf8d4..2acc1a31a369 100644
--- a/basegfx/source/polygon/b2dpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dpolypolygon.cxx
@@ -169,22 +169,34 @@ public:
const basegfx::B2DPolygon* begin() const
{
- return &maPolygons.front();
+ if(maPolygons.empty())
+ return 0;
+ else
+ return &maPolygons.front();
}
const basegfx::B2DPolygon* end() const
{
- return &maPolygons[maPolygons.size()];
+ if(maPolygons.empty())
+ return 0;
+ else
+ return (&maPolygons.back())+1;
}
basegfx::B2DPolygon* begin()
{
- return &maPolygons.front();
+ if(maPolygons.empty())
+ return 0;
+ else
+ return &maPolygons.front();
}
basegfx::B2DPolygon* end()
{
- return &maPolygons[maPolygons.size()];
+ if(maPolygons.empty())
+ return 0;
+ else
+ return &(maPolygons.back())+1;
}
};