diff options
Diffstat (limited to 'src/gui/painting/qdatabuffer_p.h')
-rw-r--r-- | src/gui/painting/qdatabuffer_p.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h index 275ec13d7..b568f43ce 100644 --- a/src/gui/painting/qdatabuffer_p.h +++ b/src/gui/painting/qdatabuffer_p.h @@ -114,6 +114,23 @@ public: qSwap(buffer, other.buffer); } + inline void insertBlank(int pos, int count) { + Q_ASSERT(pos >= 0); + Q_ASSERT(pos < siz); + reserve(siz + count); + for (int i = siz - pos - 1; i >= 0; --i) + buffer[pos + count + i] = buffer[pos + i]; + siz += count; + } + + inline void removeAndShift(int pos, int count) { + Q_ASSERT(pos >= 0); + Q_ASSERT(pos < siz); + for (int i=pos; i<siz-count; ++i) + buffer[i] = buffer[i+count]; + siz -= count; + } + inline QDataBuffer &operator<<(const Type &t) { add(t); return *this; } private: |