From 25970c5703c1680ba058056b54ee588547ae49ad Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 21 Jan 2019 13:56:59 +0000 Subject: partially revert ofz#11275 erase via position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit partial revert of: commit e8833d4dd9322c01cf5b6d458fc86d3735cf9999 Author: Caolán McNamara 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 --- sw/source/core/doc/docredln.cxx | 5 ++--- 1 file 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; } -- cgit