summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-09-15 17:52:29 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-09-18 17:24:06 +0200
commitd19fb1dd668473f2d4f8dbde8bac1fcb34042a6a (patch)
treee768aab3bb47934c98d2f037ca38cf88013c6307
parentb2b43e83ccc41c37bad32a4dcf07ca86bf2f8a15 (diff)
sw: fix crash when moving nodes into undo array
In SwUndoSaveContent::MoveToUndoNds() a node is split and in sw::OnlineAccessibilityCheck::runAccessibilityCheck() we get: sw/inc/ndindex.hxx:99: bool SwNodeIndex::operator<(const SwNode&) const: Assertion `&GetNodes() == &rNd.GetNodes()' failed. Try to make sure that OnlineAccessibilityCheck doesn't touch nodes in the undo array. Change-Id: Iaeb0d36c341c05948cdfcce08009b0430a78f214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156970 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sw/source/core/docnode/nodes.cxx3
-rw-r--r--sw/source/core/txtnode/OnlineAccessibilityCheck.cxx7
2 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index e5d20e4691ff..9f9c516e8f3b 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -346,6 +346,9 @@ void SwNodes::ChgNode( SwNodeIndex const & rDelPos, SwNodeOffset nSz,
if( pCNd->IsNoTextNode() && bRestPersData )
static_cast<SwNoTextNode*>(pCNd)->RestorePersistentData();
}
+
+ // reset Accessibility issue state
+ pCNd->resetAndQueueAccessibilityCheck();
}
}
}
diff --git a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx
index 27d4d5d56f12..d85379ffb1ee 100644
--- a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx
+++ b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx
@@ -306,8 +306,11 @@ void OnlineAccessibilityCheck::resetAndQueue(SwNode* pNode, bool bIssueObjectNam
pNode->getAccessibilityCheckStatus().reset();
m_aNodes.erase(pNode);
- runAccessibilityCheck(pNode);
- updateNodeStatus(pNode, bIssueObjectNameChanged);
+ if (&pNode->GetNodes() == &m_rDocument.GetNodes()) // don't add undo array
+ {
+ runAccessibilityCheck(pNode);
+ updateNodeStatus(pNode, bIssueObjectNameChanged);
+ }
updateStatusbar();
}