summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-05-08 16:56:34 +0200
committerMichael Stahl <mstahl@redhat.com>2017-05-08 17:21:16 +0200
commit13d7778fc10638a145af7fb077688e032bd16f81 (patch)
tree386949c45b447a8ebe956bab50c2060bb7e0e2da /sw/inc
parentf9f0b6ac12c5d6c73d9aa415a9de5e37105085d8 (diff)
tdf#70960 sw::UndoManager: fix exponential Repeat proliferation
In case of a multi-selection, the usual pattern is that the EditShell contains a loop around GetCursor()->GetRingContainer() that creates N "groups" of undo-actions, all of which are inside a SfxListUndoAction. If that is then repeated again with a multi-selection, the result will be N*N actions, etc. This is usually not an issue because most repeatable actions are idempotent - except for the resource usage. Prevent the 2nd step of the proliferation by introducing a flag in SwUndo to do nothing in SwUndo::Repeat() that is set for all but the 1st cursor of the multi-selection in sw::UndoManager::Repeat(). (presumably regression from CWS undoapi) Change-Id: I095258f6d57af6bcaa8a39747632422e8311e694
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/undobj.hxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 91185bbcded0..bfd7cf804051 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -53,6 +53,7 @@ class SwUndo
SwUndoId const m_nId;
RedlineFlags nOrigRedlineFlags;
ViewShellId m_nViewShellId;
+ bool m_isRepeatIgnored; /// for multi-selection, only repeat 1st selection
protected:
bool bCacheComment;
@@ -124,6 +125,7 @@ public:
static bool FillSaveDataForFormat( const SwPaM& , SwRedlineSaveDatas& );
static void SetSaveData( SwDoc& rDoc, SwRedlineSaveDatas& rSData );
static bool HasHiddenRedlines( const SwRedlineSaveDatas& rSData );
+ void IgnoreRepeat() { m_isRepeatIgnored = true; }
};
enum class DelContentType : sal_uInt16