summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx27
1 files changed, 15 insertions, 12 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 7e2470e1422b..f833f7e1849d 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1162,21 +1162,24 @@ void SwTextNode::Update(
// The cursors of other shells shouldn't be moved, either.
if (SwDocShell* pDocShell = GetDoc()->GetDocShell())
{
- for (SwViewShell& rShell : pDocShell->GetWrtShell()->GetRingContainer())
+ if (pDocShell->GetWrtShell())
{
- auto pWrtShell = dynamic_cast<SwWrtShell*>(&rShell);
- if (!pWrtShell || pWrtShell == pDocShell->GetWrtShell())
- continue;
+ for (SwViewShell& rShell : pDocShell->GetWrtShell()->GetRingContainer())
+ {
+ auto pWrtShell = dynamic_cast<SwWrtShell*>(&rShell);
+ if (!pWrtShell || pWrtShell == pDocShell->GetWrtShell())
+ continue;
- SwShellCursor* pCursor = pWrtShell->GetCursor_();
- if (!pCursor)
- continue;
+ SwShellCursor* pCursor = pWrtShell->GetCursor_();
+ if (!pCursor)
+ continue;
- SwIndex& rIndex = const_cast<SwIndex&>(pCursor->Start()->nContent);
- if (&pCursor->Start()->nNode.GetNode() == this && rIndex.GetIndex() == rPos.GetIndex())
- {
- // The cursor position of this other shell is exactly our insert position.
- rIndex.Assign(&aTmpIdxReg, rIndex.GetIndex());
+ SwIndex& rIndex = const_cast<SwIndex&>(pCursor->Start()->nContent);
+ if (&pCursor->Start()->nNode.GetNode() == this && rIndex.GetIndex() == rPos.GetIndex())
+ {
+ // The cursor position of this other shell is exactly our insert position.
+ rIndex.Assign(&aTmpIdxReg, rIndex.GetIndex());
+ }
}
}
}