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.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2022-10-06 15:36:44 +02:00
parent c98388db26
commit 2f3e958d7d
2 changed files with 5 additions and 6 deletions

View file

@ -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(

View file

@ -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 );