summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-01-21 13:56:59 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-01-22 17:31:57 +0000
commit25970c5703c1680ba058056b54ee588547ae49ad (patch)
treeb0f24658d58dabd28d1f655740d5af0ad2887dea
parent46efac592b76d32152353466120eea2c9800858f (diff)
partially revert ofz#11275 erase via position
partial revert of: commit e8833d4dd9322c01cf5b6d458fc86d3735cf9999 Author: Caolán McNamara <caolanm@redhat.com> Date: Mon Jan 21 09:33:04 2019 +0000 because of the concerns of https://gerrit.libreoffice.org/#/c/66665/ i.e. "this looks like it reintroduces the bug fixed in 471212d464f54054f7419ef1890267d0def852d9" but continue to erase the final entry by its known index, rather than force a lookup of the index of the final entry Change-Id: Ic14aa133779b5555e8856d6c8fefe4e9b854e2fa
-rw-r--r--sw/source/core/doc/docredln.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 47f9f9227506..eeba3836e663 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -623,11 +623,10 @@ void SwRedlineTable::Remove( size_type nP )
void SwRedlineTable::DeleteAndDestroyAll()
{
- auto nCount = maVector.size();
- while (nCount)
+ while (!maVector.empty())
{
auto const pRedline = maVector.back();
- maVector.erase(--nCount);
+ maVector.erase(maVector.size() - 1);
LOKRedlineNotification(RedlineNotification::Remove, pRedline);
delete pRedline;
}