diff options
Diffstat (limited to 'drawinglayer/source/primitive2d/Primitive2DContainer.cxx')
-rw-r--r-- | drawinglayer/source/primitive2d/Primitive2DContainer.cxx | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/drawinglayer/source/primitive2d/Primitive2DContainer.cxx b/drawinglayer/source/primitive2d/Primitive2DContainer.cxx index 85ab03951996..48b0c625e1ba 100644 --- a/drawinglayer/source/primitive2d/Primitive2DContainer.cxx +++ b/drawinglayer/source/primitive2d/Primitive2DContainer.cxx @@ -54,24 +54,11 @@ Primitive2DContainer::toSequence() const return aVal; } -Primitive2DContainer Primitive2DContainer::maybeInvert(bool bInvert) const +Primitive2DContainer Primitive2DContainer::maybeInvert(bool bInvert) { - const sal_uInt32 nSize(size()); - Primitive2DContainer aRetval; - - aRetval.resize(nSize); - - for (sal_uInt32 a(0); a < nSize; a++) - { - aRetval[bInvert ? nSize - 1 - a : a] = (*this)[a]; - } - - // all entries taken over to Uno References as owners. To avoid - // errors with users of this mechanism to delete pointers to BasePrimitive2D - // itself, clear given vector - const_cast<Primitive2DContainer&>(*this).clear(); - - return aRetval; + if (bInvert) + std::reverse(begin(), end()); + return std::move(*this); } // get B2DRange from a given Primitive2DSequence |