sc/source/ui/undo/undobase.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit 58f63e376892b55455ab4b85a250de6b6f81d405 Author: Patrick Luby <guibmac...@gmail.com> AuthorDate: Tue Jul 9 15:47:24 2024 -0400 Commit: Patrick Luby <guibomac...@gmail.com> CommitDate: Wed Jul 10 12:08:36 2024 +0200 tdf#161712 invoke ScSimpleUndo::EndUndo() before ShowBlock() If this is an instance of ScUndoAutoFill, ShowBlock() will invoke ScTabViewShell::MoveCursorAbs() which will delete this instance so invoke ScSimpleUndo::EndUndo() first. Change-Id: I7ef6dfa0444c38974e1d8c5af6672144f045d22d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170254 Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomac...@gmail.com> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit 99fda8da4e0a1b24c9aaecacfeeba0fe593fe730) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170287 diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index a99dec962d89..9bcd5349f67a 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -269,8 +269,12 @@ void ScBlockUndo::EndUndo() EnableDrawAdjust( &pDocShell->GetDocument(), true ); DoSdrUndoAction( pDrawUndo.get(), &pDocShell->GetDocument() ); - ShowBlock(); + // tdf#161712 invoke ScSimpleUndo::EndUndo() before ShowBlock() + // If this is an instance of ScUndoAutoFill, ShowBlock() will invoke + // ScTabViewShell::MoveCursorAbs() which will delete this instance + // so invoke ScSimpleUndo::EndUndo() first. ScSimpleUndo::EndUndo(); + ShowBlock(); } void ScBlockUndo::EndRedo()