summaryrefslogtreecommitdiff
path: root/sw/source/core/doc
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-01-22 11:23:34 +0100
committerLászló Németh <nemeth@numbertext.org>2022-01-26 12:06:15 +0100
commitb15638440d692dd8cce55c0e936fbb82d24f8414 (patch)
tree157ac6766f7c95189f3e21490c689f7b1d3303d6 /sw/source/core/doc
parentb37e3e8c8c545a0776a9fcdbad3cb752162d2e3d (diff)
tdf#146857 sw change tracking: fix freezing during Undo
Re-insertion of hundreds of redlines during Undo resulted freezing, because of the unnecessary call of isMoved() in SwRedlineTable::Insert(), multiplying the slow Undo by ~40 extra redline checkings around each redline to find tracke text movings. Stop unnecessary call of isMoved() during Undo in SwRedlineTable::Insert(). The state of isMoved bit i.e. the green/double strikethrough/underline redline formatting is preserved anyway. Regression from commit f51fa7534421a195a58b4a737a2e836d8c25ba81 "tdf#145718 sw, DOCX import: complete tracked text moving". Change-Id: Ib7901c7b4fefd87633c49ef252750b84dcdb73dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128762 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r--sw/source/core/doc/docredln.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 0d0b7fa621e2..cb6fb4f3302c 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -411,8 +411,15 @@ bool SwRedlineTable::Insert(SwRangeRedline*& p)
size_type nP = rv.first - begin();
LOKRedlineNotification(RedlineNotification::Add, p);
- // set IsMoved checking nearby redlines
- isMoved(nP);
+ // detect text moving by checking nearby redlines, except during Undo
+ // (apply isMoved() during OpenDocument and DOCX import, too, to fix
+ // missing text moving handling in ODF and e.g. web version of MSO)
+ if ( p->GetDoc().GetIDocumentUndoRedo().DoesUndo() ||
+ p->GetDoc().IsInWriterfilterImport() ||
+ p->GetDoc().IsInXMLImport() )
+ {
+ isMoved(nP);
+ }
p->CallDisplayFunc(nP);
if (rv.second)