diff options
author | László Németh <nemeth@numbertext.org> | 2020-12-21 21:09:44 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-12-22 15:25:10 +0100 |
commit | 207a709bcf1af2eee7fbac8d3c30de6f8d43a8a3 (patch) | |
tree | 065c0bb8439c2004238a1ce34d2bdb24bf43ca0a /sw/source | |
parent | 45175d655ad3773df1c006182108cf25e87b1091 (diff) |
tdf#139120 tdf#139127 sw: fix empty redline related crash
and bad "$2" redline text in ChangesInMargin mode.
Also in the default "changes-in-text" mode, Undo didn't
remove this empty redline added for tdf#119571 in the
case of associated redline ExtraData (i.e. joining
paragraphs with different styles), see also
commit 66b39ca79b36da8d5e151deab17a0fb7690eebe6
(tdf#131147 don't store redline ExtraData during Undo).
Change-Id: I7faa7c3acd8f8a0312339087072453a15751dd81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108126
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 016151161dc5..889b725e8e3e 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -2486,6 +2486,17 @@ bool DocumentRedlineManager::DeleteRedline( const SwPaM& rRange, bool bSaveInUnd break; case SwComparePosition::CollideEnd: + // remove (not hidden) empty redlines created for fixing tdf#119571 + // (Note: hidden redlines are all empty, i.e. start and end are equal.) + if ( pRedl->HasMark() && *pRedl->GetMark() == *pRedl->GetPoint() ) + { + pRedl->InvalidateRange(SwRangeRedline::Invalidation::Remove); + mpRedlineTable->DeleteAndDestroy( n-- ); + bChg = true; + break; + } + [[fallthrough]]; + case SwComparePosition::Before: n = mpRedlineTable->size(); break; |