summaryrefslogtreecommitdiff
path: root/basegfx/source/range
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/range
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/range')
-rw-r--r--basegfx/source/range/b2dpolyrange.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/basegfx/source/range/b2dpolyrange.cxx b/basegfx/source/range/b2dpolyrange.cxx
index d35af8f5dd0c..e212e083ef55 100644
--- a/basegfx/source/range/b2dpolyrange.cxx
+++ b/basegfx/source/range/b2dpolyrange.cxx
@@ -229,22 +229,34 @@ namespace basegfx
const B2DRange* begin() const
{
- return &maRanges.front();
+ if(maRanges.empty())
+ return 0;
+ else
+ return &maRanges.front();
}
const B2DRange* end() const
{
- return &maRanges[maRanges.size()];
+ if(maRanges.empty())
+ return 0;
+ else
+ return (&maRanges.back())+1;
}
B2DRange* begin()
{
- return &maRanges.front();
+ if(maRanges.empty())
+ return 0;
+ else
+ return &maRanges.front();
}
B2DRange* end()
{
- return &maRanges[maRanges.size()];
+ if(maRanges.empty())
+ return 0;
+ else
+ return (&maRanges.back())+1;
}
private: