sw/inc/ndtxt.hxx                 |    2 +-
 sw/source/core/txtnode/ndtxt.cxx |    9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 2f3e958d7d1ee383793265d9a9e0d571fa80d64c
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Oct 6 15:36:44 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Oct 6 20:37:48 2022 +0200

    use more SwPosition::GetNode
    
    part of the process of hiding the internals of SwPosition
    
    Change-Id: Iecac4bd1e7836022182eba7c9b6d25bb827dbe5d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141019
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index a86b495515b0..9c773751537e 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -141,7 +141,7 @@ class SW_DLLPUBLIC SwTextNode final
     /// Copies the attributes at nStart to pDest.
     SAL_DLLPRIVATE void CopyAttr( SwTextNode *pDest, const sal_Int32 nStart, 
const sal_Int32 nOldPos);
 
-    SAL_DLLPRIVATE SwTextNode* MakeNewTextNode( const SwNodeIndex&, bool bNext 
= true,
+    SAL_DLLPRIVATE SwTextNode* MakeNewTextNode( SwNode&, bool bNext = true,
                                 bool bChgFollow = true );
 
     SAL_DLLPRIVATE void CutImpl(
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 18c649b33996..c411628df4be 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -438,7 +438,7 @@ SwTextNode *SwTextNode::SplitContentNode(const SwPosition & 
rPos,
     const sal_Int32 nSplitPos = rPos.GetContentIndex();
     const sal_Int32 nTextLen = m_Text.getLength();
     SwTextNode* const pNode =
-        MakeNewTextNode( rPos.nNode, false, nSplitPos==nTextLen );
+        MakeNewTextNode( rPos.GetNode(), false, nSplitPos==nTextLen );
 
     // the first paragraph gets the XmlId,
     // _except_ if it is empty and the second is not empty
@@ -2974,7 +2974,7 @@ bool SwTextNode::HasMarkedLabel() const
 }
 // <- #i27615#
 
-SwTextNode* SwTextNode::MakeNewTextNode( const SwNodeIndex& rPos, bool bNext,
+SwTextNode* SwTextNode::MakeNewTextNode( SwNode& rPosNd, bool bNext,
                                        bool bChgFollow )
 {
     // ignore hard PageBreak/PageDesc/ColumnBreak from Auto-Set
@@ -3052,7 +3052,7 @@ SwTextNode* SwTextNode::MakeNewTextNode( const 
SwNodeIndex& rPos, bool bNext,
 
     SwTextFormatColl* pColl = GetTextColl();
 
-    SwTextNode *pNode = new SwTextNode( rPos.GetNode(), pColl, oNewAttrSet ? 
&*oNewAttrSet : nullptr );
+    SwTextNode *pNode = new SwTextNode( rPosNd, pColl, oNewAttrSet ? 
&*oNewAttrSet : nullptr );
 
     oNewAttrSet.reset();
 
@@ -3098,8 +3098,7 @@ SwTextNode* SwTextNode::MakeNewTextNode( const 
SwNodeIndex& rPos, bool bNext,
 SwContentNode* SwTextNode::AppendNode( const SwPosition & rPos )
 {
     // position behind which it will be inserted
-    SwNodeIndex aIdx( rPos.GetNode(), 1 );
-    SwTextNode* pNew = MakeNewTextNode( aIdx );
+    SwTextNode* pNew = MakeNewTextNode( *rPos.GetNodes()[rPos.GetNodeIndex() + 
1] );
 
     // reset list attributes at appended text node
     pNew->ResetAttr( RES_PARATR_LIST_ISRESTART );

Reply via email to