summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/sdrundomanager.hxx2
-rw-r--r--svx/source/svdraw/sdrundomanager.cxx3
-rw-r--r--svx/source/svdraw/svdedxv.cxx3
3 files changed, 7 insertions, 1 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
diff --git a/svx/source/svdraw/sdrundomanager.cxx b/svx/source/svdraw/sdrundomanager.cxx
index 1e64a1a89482..8b1f19fbecfa 100644
--- a/svx/source/svdraw/sdrundomanager.cxx
+++ b/svx/source/svdraw/sdrundomanager.cxx
@@ -25,6 +25,7 @@ SdrUndoManager::SdrUndoManager()
: EditUndoManager(20 /*nMaxUndoActionCount*/)
, maEndTextEditHdl()
, mpLastUndoActionBeforeTextEdit(nullptr)
+ , mnRedoActionCountBeforeTextEdit(0)
, mbEndTextEditTriggeredFromUndo(false)
, m_pDocSh(nullptr)
{
@@ -107,6 +108,7 @@ void SdrUndoManager::SetEndTextEditHdl(const Link<SdrUndoManager*, void>& rLink)
{
// text edit start, remember last non-textedit action for later cleanup
mpLastUndoActionBeforeTextEdit = GetUndoActionCount() ? GetUndoAction() : nullptr;
+ mnRedoActionCountBeforeTextEdit = GetRedoActionCount();
}
else
{
@@ -123,6 +125,7 @@ void SdrUndoManager::SetEndTextEditHdl(const Link<SdrUndoManager*, void>& rLink)
// forget marker again
mpLastUndoActionBeforeTextEdit = nullptr;
+ mnRedoActionCountBeforeTextEdit = 0;
}
}
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 8220b4c59b03..736d31b7aac5 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1438,7 +1438,8 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
// to create a complete text change undo action for the redo buffer. Also mark this
// state when at least one redo was executed; the created extra TextChange needs to
// be undone in addition to the first real undo outside the text edit changes
- while (pSdrUndoManager->GetRedoActionCount())
+ while (pSdrUndoManager->GetRedoActionCount()
+ > pSdrUndoManager->GetRedoActionCountBeforeTextEdit())
{
bNeedToUndoSavedRedoTextEdit = true;
pSdrUndoManager->Redo();