[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - vcl/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Mon Apr 1 20:21:02 UTC 2019
vcl/source/edit/textundo.cxx | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
New commits:
commit e10083d6daef5fadc53734ef3dc85f4cce563640
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Apr 1 14:38:01 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Apr 1 22:20:40 2019 +0200
tdf#124413 Crash on undo / redo in Basic IDE
regression from
commit 3a9d3f271c445641bebd057c4c91279f9b3cd7d5
Date: Mon Apr 23 09:38:41 2018 +0200
loplugin:useuniqueptr in TextDoc
Change-Id: I51ab5de7571e4ec358442e54d590adf88fbeb12d
Reviewed-on: https://gerrit.libreoffice.org/70061
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
(cherry picked from commit 3ebdb97a305ada182af045ea6438432adfe74e80)
Reviewed-on: https://gerrit.libreoffice.org/70072
Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx
index e5b3d0165517..5c99f30d94b0 100644
--- a/vcl/source/edit/textundo.cxx
+++ b/vcl/source/edit/textundo.cxx
@@ -162,14 +162,19 @@ void TextUndoDelPara::Undo()
void TextUndoDelPara::Redo()
{
+ auto & rDocNodes = GetDoc()->GetNodes();
// pNode is not valid anymore in case an Undo joined paragraphs
- mpNode = GetDoc()->GetNodes()[ mnPara ].get();
+ mpNode = rDocNodes[ mnPara ].get();
GetTEParaPortions()->Remove( mnPara );
// do not delete Node because of Undo!
- GetDoc()->GetNodes().erase( ::std::find_if( GetDoc()->GetNodes().begin(), GetDoc()->GetNodes().end(),
- [&] (std::unique_ptr<TextNode> const & p) { return p.get() == mpNode; } ) );
+ auto it = ::std::find_if( rDocNodes.begin(), rDocNodes.end(),
+ [&] (std::unique_ptr<TextNode> const & p) { return p.get() == mpNode; } );
+ assert(it != rDocNodes.end());
+ it->release();
+ GetDoc()->GetNodes().erase( it );
+
GetTextEngine()->ImpParagraphRemoved( mnPara );
mbDelObject = true; // belongs again to the Undo
More information about the Libreoffice-commits
mailing list