diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-07-15 03:02:13 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-07-15 03:10:16 +0900 |
commit | 7b689371cc344f14af783f87c7fe37f5350c10ab (patch) | |
tree | f90871bc113fbb890034e1576b3f05e414362ee2 | |
parent | abdaf7e5f8d3600b1e0e251bb9b78670f0af0aed (diff) |
fdo#52013: Writer will crash when the undo-redoing if it contains dummy text
this fixes a regression introduced at 9c0ca924446933431d736ee0dd37e6852b4947dc
by making assure that destination history has enough capacity
Change-Id: I3f608f7ab4a2617b695a5441d41553049cff333b
-rw-r--r-- | sw/source/core/inc/rolbck.hxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx index a597b9556658..982d26e2bf4e 100644 --- a/sw/source/core/inc/rolbck.hxx +++ b/sw/source/core/inc/rolbck.hxx @@ -399,6 +399,8 @@ public: { SwpHstry::iterator itSourceBegin = pIns->m_SwpHstry.begin() + nStart; SwpHstry::iterator itSourceEnd = pIns->m_SwpHstry.end(); + if (itSourceBegin == itSourceEnd) return; + m_SwpHstry.reserve(nPos + static_cast<size_t>(itSourceEnd - itSourceBegin)); std::copy( itSourceBegin, itSourceEnd, m_SwpHstry.begin() + nPos ); pIns->m_SwpHstry.erase( itSourceBegin, itSourceEnd ); } |