From 239b4bb27fd8db26e8416045b3015688a8b1b0ae Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Tue, 8 Jun 2021 16:17:37 -0800 Subject: Resolves tdf#142651 Writer: Next Change stopped working by normalizing copy of PaM instead of reference Change-Id: If2c8664de18eb9473151c5961ad7654932ca37e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116875 Tested-by: Jenkins Reviewed-by: Jim Raykowski --- sw/source/core/crsr/crsrsh.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sw') diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 6f5516d69c1f..e747b1753601 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -3351,11 +3351,12 @@ bool SwCursorShell::HasReadonlySel() const SwWrtShell* pWrtSh = GetDoc()->GetDocShell()->GetWrtShell(); if (pWrtSh) { - for(SwPaM& rPaM : GetCursor()->GetRingContainer()) + for(const SwPaM& rPaM : GetCursor()->GetRingContainer()) { - rPaM.Normalize(); - SwNodeIndex aPointIdx(rPaM.GetPoint()->nNode.GetNode()); - SwNodeIndex aMarkIdx(rPaM.GetMark()->nNode.GetNode()); + SwPaM aPaM(*rPaM.GetMark(), *rPaM.GetPoint()); + aPaM.Normalize(); + SwNodeIndex aPointIdx(aPaM.GetPoint()->nNode.GetNode()); + SwNodeIndex aMarkIdx(aPaM.GetMark()->nNode.GetNode()); if (aPointIdx == aMarkIdx) continue; // If any nodes in PaM are folded outline content nodes, then set read-only. -- cgit v1.2.3