diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-01-14 19:33:34 +0100 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2021-01-20 17:24:49 +0100 |
commit | 60eb993b5558c7999a23b4e3c241b2a60419a3d4 (patch) | |
tree | 6c2a5e7b5faefdefeebc2a225b10269e47aff024 | |
parent | 8ba16d77881fe199a3c2ea40fb9c18741e17af5f (diff) |
tdf#135014 sw_fieldmarkhide: fix crash deleting field in fly
SwUndoDelete calls DelContentIndex(), which calls
SwUndoFlyBase::DelFly().
This calls DelFrames() first and then SwUndoSaveSection::SaveSection(),
so by the time UpdateFramesForRemoveDeleteRedline() runs for the
fieldmark in fly it's expected that there are no more frames.
Also, don't try to recreate fly frames in this situation; it will crash
when resetting the RES_ANCHOR.
Change-Id: I11f6fb011d84e96f77b93ffbd1b5904594cbc591
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109306
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit eef10be20a4c5108c68b19ccdda263c5ca852386)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109345
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 4a63d5e443ac..337c0429107d 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -286,10 +286,15 @@ void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) } if (frames.empty()) { - auto const& layouts(rDoc.GetAllLayouts()); - assert(std::none_of(layouts.begin(), layouts.end(), - [](SwRootFrame const*const pLayout) { return pLayout->IsHideRedlines(); })); - (void) layouts; + // in SwUndoSaveSection::SaveSection(), DelFrames() preceded this call + if (!pNode->FindTableBoxStartNode() && !pNode->FindFlyStartNode()) + { + auto const& layouts(rDoc.GetAllLayouts()); + assert(std::none_of(layouts.begin(), layouts.end(), + [](SwRootFrame const*const pLayout) { return pLayout->IsHideRedlines(); })); + (void) layouts; + } + isAppendObjsCalled = true; // skip that! break; } |