[Libreoffice-commits] core.git: sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 15 12:38:04 UTC 2021


 sw/source/core/doc/DocumentRedlineManager.cxx |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit eef10be20a4c5108c68b19ccdda263c5ca852386
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Thu Jan 14 19:33:34 2021 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jan 15 13:37:19 2021 +0100

    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 at allotropia.de>

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index ea9b7164d683..3b3c95009a20 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -287,10 +287,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;
             }
 


More information about the Libreoffice-commits mailing list