sw/source/core/txtnode/atrfld.cxx |    2 +-
 sw/source/core/undo/undobj.cxx    |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 27e9ead64d4e3a3f3b3d1203f7b9fee50eb0d04d
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Fri Aug 14 16:35:32 2020 +0200
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Aug 17 10:36:24 2020 +0200

    tdf#135457 sw: fix invalidation of SwXTextField
    
    This was supposed to happen from SwNodes::ChgNode() when moving to the
    undo nodes array.
    
    There are fields with a range that contains other fields, when the outer
    field's range is deleted, the contained field moves to the undo array
    and its position is no longer valid to be given out by
    SwXTextField::getAnchor().
    
    (regression from c73b5e969b2f9abdb2b9191938ca30bec5af725d)
    
    Change-Id: I38c8b3393a777ca8dc8739b5ca4233a7f124961e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100749
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 14fd4b54113f884cfd6871aeff693734fc06224b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100705
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/core/txtnode/atrfld.cxx 
b/sw/source/core/txtnode/atrfld.cxx
index b41eb943c429..b8027bcd5d65 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -217,7 +217,7 @@ void SwFormatField::InvalidateField()
 {
     SwPtrMsgPoolItem const item(RES_REMOVE_UNO_OBJECT,
             &static_cast<SwModify&>(*this)); // cast to base class (void*)
-    NotifyClients(&item, &item);
+    CallSwClientNotify(sw::LegacyModifyHint{ &item, &item });
 }
 
 void SwFormatField::SwClientNotify( const SwModify& rModify, const SfxHint& 
rHint )
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 30fc2ed24b4d..a7a6119176fd 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -853,6 +853,10 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& 
rMark,
 
     SwDoc* pDoc = rMark.nNode.GetNode().GetDoc();
 
+    // if it's not in the doc array, probably missing some invalidation 
somewhere
+    assert(&rPoint.nNode.GetNodes() == &pDoc->GetNodes());
+    assert(&rMark.nNode.GetNodes() == &pDoc->GetNodes());
+
     ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
 
     // 1. Footnotes
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to