diff options
Diffstat (limited to 'basegfx/source/polygon/b2dpolypolygon.cxx')
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygon.cxx | 20 |
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; } }; |