sw/source/core/doc/DocumentContentOperationsManager.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit 5ef4ed1e4b506a9fc54b069b6de3980ed731be30 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Aug 30 13:32:18 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Aug 30 18:32:42 2022 +0200 use more SwPosition::Assign part of hiding the internals of SwPosition Change-Id: I0defa466d8088aaad1c23b2fc780dcaa37691ad4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139006 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 1c8489ab95ce..402325687e01 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -212,7 +212,9 @@ namespace sal_Int32 nContentPos = rOrigPos.GetContentIndex(); // Always adjust <nNode> at to be changed <SwPosition> instance <rChgPos> - rChgPos.nNode = nNdOff + rCpyStt.GetNodeIndex(); + rChgPos.Assign( nNdOff + rCpyStt.GetNodeIndex() ); + if (!rChgPos.GetNode().GetContentNode()) + return; if( !nNdOff ) { // just adapt the content index @@ -222,7 +224,7 @@ namespace nContentPos = 0; nContentPos += rCpyStt.GetContentIndex(); } - rChgPos.nContent.Assign( rChgPos.GetNode().GetContentNode(), nContentPos ); + rChgPos.SetContent( nContentPos ); } }