diff options
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/baseprimitive2d.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx index 1f5e5ddd9f30..795c6098e894 100644 --- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx @@ -312,16 +312,17 @@ namespace drawinglayer { insert(end(), rSource.begin(), rSource.end()); } -/* + void Primitive2DContainer::append(Primitive2DContainer&& rSource) { - resize(size() + rSource.size()); - memcpy(data() + size(), - rSource.data(), - rSource.size() * sizeof(Primitive2DReference)); - memset(reinterpret_cast<void*>(rSource.data()), 0, rSource.size() * sizeof(Primitive2DReference)); + size_t n = size(); + resize(n + rSource.size()); + for (size_t i = 0; i<rSource.size(); ++i) + { + (*this)[n + i] = std::move( rSource[i] ); + } } -*/ + void Primitive2DContainer::append(const Primitive2DSequence& rSource) { std::copy(rSource.begin(), rSource.end(), std::back_inserter(*this)); |