diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-02-01 21:35:46 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-02-03 10:13:13 +0100 |
commit | 4c5013818613d25b01051eafda9aef50b43d7163 (patch) | |
tree | 21f2619629ea96ffe3fd55ab852a5d5559bdad51 /sw/source/core/doc | |
parent | db7426fa13faf7a36cacc713ff0424a7cf14949f (diff) |
tdf#147006 sw_fieldmarkhide: fix crash when deleting fly with fieldmark
The problem is similar to commit eef10be20a4c5108c68b19ccdda263c5ca852386,
there is a fieldmark in a fly and this results in
UpdateFramesForRemoveDeleteRedline() re-creating fly frames that have
already been deleted in SwUndoFlyBase::DelFly(), and then the
SwFlyAtContentFrame::SwClientNotify() crashes on a null anchor position
in the SwFormat::ResetFormatAttr(RES_ANCHOR).
This time the passed rPam is empty, after removing the dummy characters
of the fieldmark; there isn't really anything to do in this case so
just return.
Change-Id: I475b8fcb0bcf94be58ff553454c261d75076303b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129308
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit bdf1d9b8151476531f2fbe06f66db260efcbc529)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129266
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 69bbf3d7ac67..a3de2c9143fb 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -246,7 +246,8 @@ void UpdateFramesForAddDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) { - if (rDoc.IsClipBoard()) + // tdf#147006 fieldmark command may be empty => do not call AppendAllObjs() + if (rDoc.IsClipBoard() || *rPam.GetPoint() == *rPam.GetMark()) { return; } |