summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorDaniel Arato (NISZ) <arato.daniel@nisz.hu>2021-04-26 15:04:17 +0200
committerLászló Németh <nemeth@numbertext.org>2021-05-10 15:41:28 +0200
commit0cd000bb83719982c1fd2265ea040c82af5bf98e (patch)
tree8a4b76358e29c56d0b542556064d541dbbd8c2b4 /sw/source/uibase
parent2436ed69a9dec1432117e894cba8ed693960f581 (diff)
tdf#141613 sw: avoid possible crash when undoing header creation
Move the ClearRedo() call to the very end of the undo process in order to avoid heap use after free. We still need to call ClearRedo() because there's no mechanism in place to Redo a header/footer change. Regression from commit 65e52cb61d74b0c71b45b63b2da131bc6b621104 "tdf#141613 sw: fix crash at header/footer undo". Change-Id: Ibd4604379c9791e85aef3d4dc6c29c9e3ecd5a28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115275 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/shells/basesh.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 78e37c09c756..d8b4c3210547 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -559,6 +559,12 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq)
rWrtShell.Do( SwWrtShell::UNDO, nCnt );
for (SwViewShell& rShell : rWrtShell.GetRingContainer())
rShell.UnlockPaint();
+
+ // tdf#141613 FIXME: Disable redoing header/footer changes for now.
+ // The proper solution would be to write a SwUndoHeaderFooter class
+ // to represent the addition of a header or footer to the current page.
+ if (nUndoId == SwUndoId::HEADER_FOOTER)
+ rUndoRedo.ClearRedo();
}
break;