Kaydet (Commit) 7b689371 authored tarafından Takeshi Abe's avatar Takeshi Abe

fdo#52013: Writer will crash when the undo-redoing if it contains dummy text

this fixes a regression introduced at 9c0ca924
by making assure that destination history has enough capacity

Change-Id: I3f608f7ab4a2617b695a5441d41553049cff333b
üst abdaf7e5
...@@ -399,6 +399,8 @@ public: ...@@ -399,6 +399,8 @@ public:
{ {
SwpHstry::iterator itSourceBegin = pIns->m_SwpHstry.begin() + nStart; SwpHstry::iterator itSourceBegin = pIns->m_SwpHstry.begin() + nStart;
SwpHstry::iterator itSourceEnd = pIns->m_SwpHstry.end(); 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 ); std::copy( itSourceBegin, itSourceEnd, m_SwpHstry.begin() + nPos );
pIns->m_SwpHstry.erase( itSourceBegin, itSourceEnd ); pIns->m_SwpHstry.erase( itSourceBegin, itSourceEnd );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment