summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2021-04-14 22:30:06 +0800
committerMark Hung <marklh9@gmail.com>2021-04-16 15:04:07 +0200
commit7a641c71f8191e83bb6c408d3ff51a58d7dd4af9 (patch)
tree442ad884be57032694ad306df4c4cec13cf67652 /include
parent748ef40304e523135108905e902655abdf3c5d23 (diff)
tdf#131634 Don't redo actions created before text edit begins.
In SdrObjEditView::SdrEndTextEdit(), pSdrUndoManager->Redo() was invoked until all the redo actions created after text edit began were converted to undo actions. Without checking, all the redo actions include the ones created before text edit began were moved to undo stack, and caused the SdrTextObj to be destroyed in SdrUndoManager::SetEndTextEditHdl when removing the undo actions and a use after release problem. The patch add GetRedoActionCountBeforeTextEdit() so the program won't invoke pSdrUndoManager->Redo() on actions created before text edit begin. Change-Id: Ic010bc6e71ee78ef2cb20a5259dc9d6d6579ccaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114102 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/svx/sdrundomanager.hxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/svx/sdrundomanager.hxx b/include/svx/sdrundomanager.hxx
index 12fa1c7b3852..9ff23e441c54 100644
--- a/include/svx/sdrundomanager.hxx
+++ b/include/svx/sdrundomanager.hxx
@@ -33,6 +33,7 @@ private:
Link<SdrUndoManager*, void> maEndTextEditHdl;
SfxUndoAction* mpLastUndoActionBeforeTextEdit;
+ size_t mnRedoActionCountBeforeTextEdit;
bool mbEndTextEditTriggeredFromUndo;
SfxObjectShell* m_pDocSh;
@@ -64,6 +65,7 @@ public:
// by a last undo during text edit
bool isEndTextEditTriggeredFromUndo() const { return mbEndTextEditTriggeredFromUndo; }
void SetDocShell(SfxObjectShell* pDocShell);
+ size_t GetRedoActionCountBeforeTextEdit() const { return mnRedoActionCountBeforeTextEdit; }
};
#endif // INCLUDED_SVX_SDRUNDOMANAGER_HXX