summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-08-12 20:43:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-08-13 15:40:07 +0200
commit38c1cba4067cffbf9f16b524ac4697efdb5c9e01 (patch)
tree45413b658261ff85b79925cc22a741102cb96183
parent912278671718d5d3d45fce25a3ca76228c81f7f3 (diff)
pass SwNode instead of SwNodeIndex to SwNode constructors
part of the process of hiding the internals of SwPosition Change-Id: I0b2dd3e24c82c1551a7275ffc78991823354858a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138224 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/inc/ndarr.hxx10
-rw-r--r--sw/inc/ndgrf.hxx8
-rw-r--r--sw/inc/ndnotxt.hxx2
-rw-r--r--sw/inc/ndole.hxx6
-rw-r--r--sw/inc/ndtxt.hxx4
-rw-r--r--sw/inc/node.hxx18
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx20
-rw-r--r--sw/source/core/doc/doclay.cxx6
-rw-r--r--sw/source/core/doc/docnew.cxx6
-rw-r--r--sw/source/core/doc/docsort.cxx2
-rw-r--r--sw/source/core/doc/doctxm.cxx8
-rw-r--r--sw/source/core/doc/tblcpy.cxx2
-rw-r--r--sw/source/core/docnode/ndcopy.cxx6
-rw-r--r--sw/source/core/docnode/ndnotxt.cxx2
-rw-r--r--sw/source/core/docnode/ndsect.cxx16
-rw-r--r--sw/source/core/docnode/ndtbl.cxx59
-rw-r--r--sw/source/core/docnode/node.cxx12
-rw-r--r--sw/source/core/docnode/nodes.cxx48
-rw-r--r--sw/source/core/docnode/section.cxx2
-rw-r--r--sw/source/core/frmedt/fecopy.cxx2
-rw-r--r--sw/source/core/graphic/ndgrf.cxx12
-rw-r--r--sw/source/core/ole/ndole.cxx10
-rw-r--r--sw/source/core/table/swnewtable.cxx2
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx10
-rw-r--r--sw/source/core/undo/undel.cxx4
-rw-r--r--sw/source/core/undo/unsect.cxx4
-rw-r--r--sw/source/core/undo/untbl.cxx18
-rw-r--r--sw/source/filter/docx/swdocxreader.cxx4
-rw-r--r--sw/source/filter/html/htmlsect.cxx2
-rw-r--r--sw/source/filter/ww8/ww8glsy.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par.cxx2
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx2
32 files changed, 154 insertions, 159 deletions
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index 5321bc62ca1f..69aa1b24cdb7 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -206,28 +206,28 @@ public:
SwStartNodeType = SwNormalStartNode );
/// Implementations of "Make...Node" are in the given .cxx-files.
- SwTextNode *MakeTextNode( const SwNodeIndex & rWhere,
+ SwTextNode *MakeTextNode( SwNode& rWhere,
SwTextFormatColl *pColl,
bool bNewFrames = true); ///< in ndtxt.cxx
SwStartNode* MakeTextSection( const SwNode & rWhere,
SwStartNodeType eSttNdTyp,
SwTextFormatColl *pColl );
- static SwGrfNode *MakeGrfNode( const SwNodeIndex & rWhere,
+ static SwGrfNode *MakeGrfNode( SwNode& rWhere,
const OUString& rGrfName,
const OUString& rFltName,
const Graphic* pGraphic,
SwGrfFormatColl *pColl,
SwAttrSet const * pAutoAttr = nullptr ); ///< in ndgrf.cxx
- static SwGrfNode *MakeGrfNode( const SwNodeIndex & rWhere,
+ static SwGrfNode *MakeGrfNode( SwNode & rWhere,
const GraphicObject& rGrfObj,
SwGrfFormatColl *pColl ); ///< in ndgrf.cxx
- SwOLENode *MakeOLENode( const SwNodeIndex & rWhere,
+ SwOLENode *MakeOLENode( SwNode& rWhere,
const svt::EmbeddedObjectRef&,
SwGrfFormatColl *pColl ); ///< in ndole.cxx
- SwOLENode *MakeOLENode( const SwNodeIndex & rWhere,
+ SwOLENode *MakeOLENode( SwNode& rWhere,
const OUString &rName,
sal_Int64 nAspect,
SwGrfFormatColl *pColl,
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 418b3b49d0c9..7acfb62b371d 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -51,17 +51,17 @@ class SW_DLLPUBLIC SwGrfNode final: public SwNoTextNode
css::uno::Reference<css::io::XInputStream> mxInputStream;
bool mbIsStreamReadOnly;
- SwGrfNode( const SwNodeIndex& rWhere,
+ SwGrfNode( SwNode& rWhere,
const OUString& rGrfName, const OUString& rFltName,
const Graphic* pGraphic,
SwGrfFormatColl* pGrfColl,
SwAttrSet const * pAutoAttr );
///< Ctor for reading (SW/G) without graphics.
- SwGrfNode( const SwNodeIndex& rWhere,
+ SwGrfNode( SwNode& rWhere,
std::u16string_view rGrfName, const OUString& rFltName,
SwGrfFormatColl* pGrfColl,
SwAttrSet const * pAutoAttr );
- SwGrfNode( const SwNodeIndex& rWhere,
+ SwGrfNode( SwNode& rWhere,
const GraphicObject& rGrfObj,
SwGrfFormatColl* pGrfColl,
SwAttrSet const * pAutoAttr );
@@ -107,7 +107,7 @@ public:
void SetScaleImageMap( bool b ) { mbScaleImageMap = b; }
/// in ndcopy.cxx
- virtual SwContentNode* MakeCopy(SwDoc&, const SwNodeIndex&, bool bNewFrames) const override;
+ virtual SwContentNode* MakeCopy(SwDoc&, SwNode&, bool bNewFrames) const override;
/** Re-read in case graphic was not OK. The current one
gets replaced by the new one. */
diff --git a/sw/inc/ndnotxt.hxx b/sw/inc/ndnotxt.hxx
index a73260a06c6c..b9e53ef4c080 100644
--- a/sw/inc/ndnotxt.hxx
+++ b/sw/inc/ndnotxt.hxx
@@ -46,7 +46,7 @@ class SW_DLLPUBLIC SwNoTextNode : public SwContentNode
SwNoTextNode &operator=( const SwNoTextNode& ) = delete;
protected:
- SwNoTextNode( const SwNodeIndex &rWhere, const SwNodeType nNdType,
+ SwNoTextNode( SwNode& rWhere, const SwNodeType nNdType,
SwGrfFormatColl *pGrColl, SwAttrSet const * pAutoAttr );
public:
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index 5344549f88bf..89ce94ef9c40 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -96,12 +96,12 @@ class SW_DLLPUBLIC SwOLENode final: public SwNoTextNode
SwEmbedObjectLink* mpObjectLink;
OUString maLinkURL;
- SwOLENode( const SwNodeIndex &rWhere,
+ SwOLENode( SwNode& rWhere,
const svt::EmbeddedObjectRef&,
SwGrfFormatColl *pGrfColl,
SwAttrSet const * pAutoAttr );
- SwOLENode( const SwNodeIndex &rWhere,
+ SwOLENode( SwNode& rWhere,
const OUString &rName,
sal_Int64 nAspect,
SwGrfFormatColl *pGrfColl,
@@ -117,7 +117,7 @@ public:
virtual ~SwOLENode() override;
/// Is in ndcopy.cxx.
- virtual SwContentNode* MakeCopy(SwDoc&, const SwNodeIndex&, bool bNewFrames) const override;
+ virtual SwContentNode* MakeCopy(SwDoc&, SwNode& rWhere, bool bNewFrames) const override;
virtual Size GetTwipSize() const override;
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 9a5aa068ade6..f9da070ae25e 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -131,7 +131,7 @@ class SW_DLLPUBLIC SwTextNode final
// DrawingLayer FillAttributes in a preprocessed form for primitive usage
drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFillAttributes;
- SAL_DLLPRIVATE SwTextNode( const SwNodeIndex &rWhere, SwTextFormatColl *pTextColl,
+ SAL_DLLPRIVATE SwTextNode( SwNode& rWhere, SwTextFormatColl *pTextColl,
const SfxItemSet* pAutoAttr = nullptr );
virtual void SwClientNotify( const SwModify&, const SfxHint& ) override;
/// Copies the attributes at nStart to pDest.
@@ -694,7 +694,7 @@ public:
/// in ndcopy.cxx
bool IsSymbolAt(sal_Int32 nBegin) const; // In itratr.cxx.
- virtual SwContentNode* MakeCopy(SwDoc&, const SwNodeIndex&, bool bNewFrames) const override;
+ virtual SwContentNode* MakeCopy(SwDoc&, SwNode& rWhere, bool bNewFrames) const override;
/// Interactive hyphenation: we find TextFrame and call its CalcHyph.
bool Hyphenate( SwInterHyphInfo &rHyphInf );
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 00c930bb73b5..91b18e30ed66 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -117,7 +117,7 @@ protected:
/// only used by SwContentNodeTmp in SwTextNode::Update
SwNode();
- SwNode( const SwNodeIndex &rWhere, const SwNodeType nNodeId );
+ SwNode( const SwNode& rWhere, const SwNodeType nNodeId );
/// for the initial StartNode
SwNode( SwNodes& rNodes, SwNodeOffset nPos, const SwNodeType nNodeId );
@@ -327,7 +327,7 @@ class SAL_DLLPUBLIC_RTTI SwStartNode: public SwNode
SwStartNode( SwNodes& rNodes, SwNodeOffset nPos );
protected:
- SwStartNode( const SwNodeIndex &rWhere,
+ SwStartNode( const SwNode& rWhere,
const SwNodeType nNodeType = SwNodeType::Start,
SwStartNodeType = SwNormalStartNode );
public:
@@ -353,7 +353,7 @@ class SwEndNode final : public SwNode
/// for the initial StartNode
SwEndNode( SwNodes& rNodes, SwNodeOffset nPos, SwStartNode& rSttNd );
- SwEndNode( const SwNodeIndex &rWhere, SwStartNode& rSttNd );
+ SwEndNode( const SwNode& rWhere, SwStartNode& rSttNd );
SwEndNode( const SwEndNode & rNode ) = delete;
SwEndNode & operator= ( const SwEndNode & rNode ) = delete;
@@ -372,7 +372,7 @@ protected:
/// only used by SwContentNodeTmp in SwTextNode::Update
SwContentNode();
- SwContentNode( const SwNodeIndex &rWhere, const SwNodeType nNodeType,
+ SwContentNode( const SwNode& rWhere, const SwNodeType nNodeType,
SwFormatColl *pFormatColl );
/** the = 0 forces the class to be an abstract base class, but the dtor can be still called
from subclasses */
@@ -432,7 +432,7 @@ public:
There are differences between text node and formula node. */
virtual sal_Int32 Len() const;
- virtual SwContentNode* MakeCopy(SwDoc&, const SwNodeIndex&, bool bNewFrames) const = 0;
+ virtual SwContentNode* MakeCopy(SwDoc&, SwNode& rWhere, bool bNewFrames) const = 0;
/// Get information from Client.
virtual bool GetInfo( SfxPoolItem& ) const override;
@@ -508,7 +508,7 @@ class SW_DLLPUBLIC SwTableNode final : public SwStartNode, public sw::Broadcasti
virtual ~SwTableNode() override;
public:
- SwTableNode( const SwNodeIndex & );
+ SwTableNode( const SwNode& );
const SwTable& GetTable() const { return *m_pTable; }
SwTable& GetTable() { return *m_pTable; }
@@ -552,7 +552,7 @@ private:
virtual ~SwSectionNode() override;
public:
- SwSectionNode(SwNodeIndex const&,
+ SwSectionNode(const SwNode& rWhere,
SwSectionFormat & rFormat, SwTOXBase const*const pTOXBase);
const SwSection& GetSection() const { return *m_pSection; }
@@ -596,7 +596,7 @@ class SwPlaceholderNode final : private SwNode
{
private:
friend class SwNodes;
- SwPlaceholderNode(const SwNodeIndex &rWhere);
+ SwPlaceholderNode(const SwNode& rWhere);
};
inline SwEndNode *SwNode::GetEndNode()
@@ -743,7 +743,7 @@ inline const SfxPoolItem& SwContentNode::GetAttr( sal_uInt16 nWhich,
return GetSwAttrSet().Get( nWhich, bInParents );
}
-inline SwPlaceholderNode::SwPlaceholderNode(const SwNodeIndex &rWhere)
+inline SwPlaceholderNode::SwPlaceholderNode(const SwNode& rWhere)
: SwNode(rWhere, SwNodeType::PlaceHolder)
{
}
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 1fc6dd71015d..d6c782027ae5 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3073,7 +3073,7 @@ SwFlyFrameFormat* DocumentContentOperationsManager::InsertGraphic(
if( !pFrameFormat )
pFrameFormat = m_rDoc.getIDocumentStylePoolAccess().GetFrameFormatFromPool( RES_POOLFRM_GRAPHIC );
SwGrfNode* pSwGrfNode = SwNodes::MakeGrfNode(
- SwNodeIndex( m_rDoc.GetNodes().GetEndOfAutotext() ),
+ m_rDoc.GetNodes().GetEndOfAutotext(),
rGrfName, rFltName, pGraphic,
m_rDoc.GetDfltGrfFormatColl() );
SwFlyFrameFormat* pSwFlyFrameFormat = InsNoTextNode( *rRg.GetPoint(), pSwGrfNode,
@@ -3088,7 +3088,7 @@ SwFlyFrameFormat* DocumentContentOperationsManager::InsertGraphicObject(
{
SwFrameFormat* pFrameFormat = m_rDoc.getIDocumentStylePoolAccess().GetFrameFormatFromPool( RES_POOLFRM_GRAPHIC );
SwGrfNode* pSwGrfNode = SwNodes::MakeGrfNode(
- SwNodeIndex( m_rDoc.GetNodes().GetEndOfAutotext() ),
+ m_rDoc.GetNodes().GetEndOfAutotext(),
rGrfObj, m_rDoc.GetDfltGrfFormatColl() );
SwFlyFrameFormat* pSwFlyFrameFormat = InsNoTextNode( *rRg.GetPoint(), pSwGrfNode,
pFlyAttrSet, pGrfAttrSet, pFrameFormat );
@@ -3112,7 +3112,7 @@ SwFlyFrameFormat* DocumentContentOperationsManager::InsertEmbObject(
SwFrameFormat* pFrameFormat = m_rDoc.getIDocumentStylePoolAccess().GetFrameFormatFromPool( nId );
return InsNoTextNode( *rRg.GetPoint(), m_rDoc.GetNodes().MakeOLENode(
- SwNodeIndex( m_rDoc.GetNodes().GetEndOfAutotext() ),
+ m_rDoc.GetNodes().GetEndOfAutotext(),
xObj,
m_rDoc.GetDfltGrfFormatColl() ),
pFlyAttrSet, nullptr,
@@ -3128,7 +3128,7 @@ SwFlyFrameFormat* DocumentContentOperationsManager::InsertOLE(const SwPaM &rRg,
return InsNoTextNode( *rRg.GetPoint(),
m_rDoc.GetNodes().MakeOLENode(
- SwNodeIndex( m_rDoc.GetNodes().GetEndOfAutotext() ),
+ m_rDoc.GetNodes().GetEndOfAutotext(),
rObjName,
nAspect,
m_rDoc.GetDfltGrfFormatColl(),
@@ -3311,7 +3311,7 @@ bool DocumentContentOperationsManager::SplitNode( const SwPosition &rPos, bool b
if( bChkTableStart && !rPos.GetContentIndex() && pNode->IsTextNode() )
{
SwNodeOffset nPrevPos = rPos.GetNodeIndex() - 1;
- const SwTableNode* pTableNd;
+ SwTableNode* pTableNd;
const SwNode* pNd = m_rDoc.GetNodes()[ nPrevPos ];
if( pNd->IsStartNode() &&
SwTableBoxStartNode == static_cast<const SwStartNode*>(pNd)->GetStartNodeType() &&
@@ -3341,7 +3341,7 @@ bool DocumentContentOperationsManager::SplitNode( const SwPosition &rPos, bool b
if( pNd )
{
SwTextNode* pTextNd = m_rDoc.GetNodes().MakeTextNode(
- SwNodeIndex( *pTableNd ),
+ *pTableNd,
m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ));
if( pTextNd )
{
@@ -3422,7 +3422,7 @@ bool DocumentContentOperationsManager::AppendTextNode( SwPosition& rPos )
{
// so then one can be created!
SwNodeIndex aIdx( rPos.nNode, 1 );
- pCurNode = m_rDoc.GetNodes().MakeTextNode( aIdx,
+ pCurNode = m_rDoc.GetNodes().MakeTextNode( aIdx.GetNode(),
m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ));
}
else
@@ -4980,11 +4980,11 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
if( !pDestTextNd )
{
if( pStt->GetContentIndex() || bOneNode )
- pDestTextNd = rDoc.GetNodes().MakeTextNode( aInsPos,
+ pDestTextNd = rDoc.GetNodes().MakeTextNode( aInsPos.GetNode(),
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD));
else
{
- pDestTextNd = pSttTextNd->MakeCopy(rDoc, aInsPos, true)->GetTextNode();
+ pDestTextNd = pSttTextNd->MakeCopy(rDoc, aInsPos.GetNode(), true)->GetTextNode();
bCopyOk = true;
}
aDestIdx.Assign( pDestTextNd, 0 );
@@ -5128,7 +5128,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
SwContentIndex aDestIdx( rPos.nContent );
if( !pDestTextNd )
{
- pDestTextNd = rDoc.GetNodes().MakeTextNode( aInsPos,
+ pDestTextNd = rDoc.GetNodes().MakeTextNode( aInsPos.GetNode(),
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD));
aDestIdx.Assign( pDestTextNd, 0 );
aInsPos--;
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 8d4d8017554f..14781dcd7e03 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -315,7 +315,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection( RndStdIds eAnchorType,
/* If there is no adjust item in the paragraph style for the content node of the new fly section
propagate an existing adjust item at the anchor to the new content node. */
SwContentNode * pNewTextNd = GetNodes().MakeTextNode
- (SwNodeIndex( GetNodes().GetEndOfAutotext()),
+ ( GetNodes().GetEndOfAutotext(),
getIDocumentStylePoolAccess().GetTextCollFromPool( nCollId ));
SwContentNode * pAnchorNode = pAnchorPos->GetNode().GetContentNode();
// pAnchorNode from cursor must be valid, unless a whole table is selected (in which
@@ -386,7 +386,7 @@ SwFlyFrameFormat* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rS
// FlyFrame, the we create a TextNode after it.
// So that this FlyFrame is preserved.
if( aRg.aEnd.GetNode().IsEndNode() )
- GetNodes().MakeTextNode( aRg.aStart,
+ GetNodes().MakeTextNode( aRg.aStart.GetNode(),
GetDfltTextFormatColl() );
getIDocumentContentOperations().MoveNodeRange( aRg, aPos.nNode, SwMoveFlags::DEFAULT );
@@ -692,7 +692,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable,
// Create Node for labeling paragraph.
SwNodeIndex aIdx( rDoc.GetNodes(), nNode );
- pNew = rDoc.GetNodes().MakeTextNode( aIdx, pColl );
+ pNew = rDoc.GetNodes().MakeTextNode( aIdx.GetNode(), pColl );
}
break;
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 2cc77c788c20..45a8e40eb354 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -327,9 +327,9 @@ SwDoc::SwDoc()
mpOutlineRule->SetCountPhantoms( !GetDocumentSettingManager().get(DocumentSettingId::OLD_NUMBERING) );
new SwTextNode(
- SwNodeIndex(GetUndoManager().GetUndoNodes().GetEndOfContent()),
+ GetUndoManager().GetUndoNodes().GetEndOfContent(),
mpDfltTextFormatColl.get() );
- new SwTextNode( SwNodeIndex( GetNodes().GetEndOfContent() ),
+ new SwTextNode( GetNodes().GetEndOfContent(),
getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ));
maOLEModifiedIdle.SetPriority( TaskPriority::LOWEST );
@@ -677,7 +677,7 @@ void SwDoc::ClearDoc()
SwNodeIndex aSttIdx( *GetNodes().GetEndOfContent().StartOfSectionNode(), 1 );
// create the first one over and over again (without attributes/style etc.
- SwTextNode* pFirstNd = GetNodes().MakeTextNode( aSttIdx, mpDfltTextFormatColl.get() );
+ SwTextNode* pFirstNd = GetNodes().MakeTextNode( aSttIdx.GetNode(), mpDfltTextFormatColl.get() );
if( getIDocumentLayoutAccess().GetCurrentViewShell() )
{
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index dfbf338ddb23..e1ab60da4f6c 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -694,7 +694,7 @@ void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar,
// -> insert an empty Node and move the rest or the Mark
// points to the first ContentNode
if( pNd->StartOfSectionNode() == pSource->GetSttNd() )
- pNd = pDoc->GetNodes().MakeTextNode( aRg.aStart,
+ pNd = pDoc->GetNodes().MakeTextNode( aRg.aStart.GetNode(),
pDoc->GetDfltTextFormatColl() );
aRg.aEnd = *pNd->EndOfSectionNode();
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index e5afaa5bd362..bdea1e4dec1d 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -389,7 +389,7 @@ SwTOXBaseSection* SwDoc::InsertTableOf( const SwPaM& aPam,
// then insert the headline section
SwNodeIndex aIdx( *pSectNd, +1 );
- SwTextNode* pHeadNd = GetNodes().MakeTextNode( aIdx,
+ SwTextNode* pHeadNd = GetNodes().MakeTextNode( aIdx.GetNode(),
getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ) );
SwSectionData headerData( SectionType::ToxHeader, pNewSection->GetTOXName()+"_Head" );
@@ -992,7 +992,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
SwNodeIndex aSttIdx( *pSectNd, +1 );
SwNodeIndex aEndIdx( *pSectNd->EndOfSectionNode() );
- pFirstEmptyNd = rDoc.GetNodes().MakeTextNode( aEndIdx,
+ pFirstEmptyNd = rDoc.GetNodes().MakeTextNode( aEndIdx.GetNode(),
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ) );
{
@@ -1041,7 +1041,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
// then insert the headline section
SwNodeIndex aIdx( *pSectNd, +1 );
- SwTextNode* pHeadNd = rDoc.GetNodes().MakeTextNode( aIdx,
+ SwTextNode* pHeadNd = rDoc.GetNodes().MakeTextNode( aIdx.GetNode(),
GetTextFormatColl( FORM_TITLE ) );
pHeadNd->InsertText( GetTitle(), SwContentIndex( pHeadNd ) );
@@ -1076,7 +1076,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
}
// Generate: Set dynamic TabStops
- SwTextNode* pTOXNd = rDoc.GetNodes().MakeTextNode( aInsPos , pColl );
+ SwTextNode* pTOXNd = rDoc.GetNodes().MakeTextNode( aInsPos.GetNode() , pColl );
m_aSortArr[ nCnt ]->pTOXNd = pTOXNd;
// Generate: Evaluate Form and insert the place holder for the
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index c7dc08b99934..b0fa499f0b3c 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -517,7 +517,7 @@ static void lcl_CpyBox( const SwTable& rCpyTable, const SwTableBox* pCpyBox,
if (pRg)
pCpyDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(*pRg, aInsIdx, nullptr, false);
else
- pDoc->GetNodes().MakeTextNode( aInsIdx, pDoc->GetDfltTextFormatColl() );
+ pDoc->GetNodes().MakeTextNode( aInsIdx.GetNode(), pDoc->GetDfltTextFormatColl() );
++aSavePos;
SwTableLine* pLine = pDstBox->GetUpper();
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 68fe6564faec..1296239719ba 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -57,7 +57,7 @@ struct MapTableFrameFormat
typedef std::vector<MapTableFrameFormat> MapTableFrameFormats;
-SwContentNode* SwTextNode::MakeCopy(SwDoc& rDoc, const SwNodeIndex& rIdx, bool const bNewFrames) const
+SwContentNode* SwTextNode::MakeCopy(SwDoc& rDoc, SwNode& rIdx, bool const bNewFrames) const
{
// the Copy-Textnode is the Node with the Text, the Copy-Attrnode is the
// node with the collection and hard attributes. Normally is the same
@@ -267,8 +267,8 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc& rDoc, const SwNodeIndex& rIdx ) const
SwFrameFormat* pTableFormat = rDoc.MakeTableFrameFormat( sTableName, rDoc.GetDfltFrameFormat() );
pTableFormat->CopyAttrs( *GetTable().GetFrameFormat() );
- SwTableNode* pTableNd = new SwTableNode( rIdx );
- SwEndNode* pEndNd = new SwEndNode( rIdx, *pTableNd );
+ SwTableNode* pTableNd = new SwTableNode( rIdx.GetNode() );
+ SwEndNode* pEndNd = new SwEndNode( rIdx.GetNode(), *pTableNd );
SwNodeIndex aInsPos( *pEndNd );
SwTable& rTable = pTableNd->GetTable();
diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx
index 7ae423a04c69..cca2d75f71fa 100644
--- a/sw/source/core/docnode/ndnotxt.cxx
+++ b/sw/source/core/docnode/ndnotxt.cxx
@@ -34,7 +34,7 @@
#include <frmfmt.hxx>
-SwNoTextNode::SwNoTextNode( const SwNodeIndex & rWhere,
+SwNoTextNode::SwNoTextNode( SwNode& rWhere,
const SwNodeType nNdType,
SwGrfFormatColl *pGrfColl,
SwAttrSet const * pAutoAttr ) :
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 3e85ec3e500a..728ba76db1a8 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -820,7 +820,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNode& rNd,
}
SwSectionNode *const pSectNd =
- new SwSectionNode(aInsPos, rSectionFormat, pTOXBase);
+ new SwSectionNode(aInsPos.GetNode(), rSectionFormat, pTOXBase);
if (lcl_IsTOXSection(rSectionData))
{
@@ -880,7 +880,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNode& rNd,
SwTextNode* pCpyTNd = rNd.GetTextNode();
if( pCpyTNd )
{
- SwTextNode* pTNd = new SwTextNode( aInsPos, pCpyTNd->GetTextColl() );
+ SwTextNode* pTNd = new SwTextNode( aInsPos.GetNode(), pCpyTNd->GetTextColl() );
if( pCpyTNd->HasSwAttrSet() )
{
// Move PageDesc/Break to the first Node of the section
@@ -905,9 +905,9 @@ SwSectionNode* SwNodes::InsertTextSection(SwNode& rNd,
pCpyTNd->MakeFramesForAdjacentContentNode(*pTNd);
}
else
- new SwTextNode( aInsPos, GetDoc().GetDfltTextFormatColl() );
+ new SwTextNode( aInsPos.GetNode(), GetDoc().GetDfltTextFormatColl() );
}
- new SwEndNode( aInsPos, *pSectNd );
+ new SwEndNode( aInsPos.GetNode(), *pSectNd );
pSectNd->GetSection().SetSectionData(rSectionData);
SwSectionFormat* pSectFormat = pSectNd->GetSection().GetFormat();
@@ -1005,9 +1005,9 @@ lcl_initParent(SwSectionNode & rThis, SwSectionFormat & rFormat)
return rFormat;
}
-SwSectionNode::SwSectionNode(SwNodeIndex const& rIdx,
+SwSectionNode::SwSectionNode(const SwNode& rWhere,
SwSectionFormat & rFormat, SwTOXBase const*const pTOXBase)
- : SwStartNode( rIdx, SwNodeType::Section )
+ : SwStartNode( rWhere, SwNodeType::Section )
, m_pSection( pTOXBase
? new SwTOXBaseSection(*pTOXBase, lcl_initParent(*this, rFormat))
: new SwSection( SectionType::Content, rFormat.GetName(),
@@ -1243,8 +1243,8 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc& rDoc, const SwNodeIndex& rIdx ) c
}
SwSectionNode *const pSectNd =
- new SwSectionNode(rIdx, *pSectFormat, pTOXBase.get());
- SwEndNode* pEndNd = new SwEndNode( rIdx, *pSectNd );
+ new SwSectionNode(rIdx.GetNode(), *pSectFormat, pTOXBase.get());
+ SwEndNode* pEndNd = new SwEndNode( rIdx.GetNode(), *pSectNd );
SwNodeIndex aInsPos( *pEndNd );
// Take over values
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index d010194fd24b..591cee8e611a 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -302,10 +302,10 @@ bool SwNodes::InsBoxen( SwTableNode* pTableNd,
SwNodeIndex aEndIdx( *this, nIdxPos );
for( sal_uInt16 n = 0; n < nCnt; ++n )
{
- SwStartNode* pSttNd = new SwStartNode( aEndIdx, SwNodeType::Start,
+ SwStartNode* pSttNd = new SwStartNode( aEndIdx.GetNode(), SwNodeType::Start,
SwTableBoxStartNode );
pSttNd->m_pStartOfSection = pTableNd;
- new SwEndNode( aEndIdx, *pSttNd );
+ new SwEndNode( aEndIdx.GetNode(), *pSttNd );
pPrvBox = new SwTableBox( pBoxFormat, *pSttNd, pLine );
@@ -321,13 +321,12 @@ bool SwNodes::InsBoxen( SwTableNode* pTableNd,
&& RES_CONDTXTFMTCOLL != pTextColl->Which()
//FEATURE::CONDCOLL
)
- new SwTextNode( SwNodeIndex( *pSttNd->EndOfSectionNode() ),
- pTextColl, pAutoAttr );
+ new SwTextNode( *pSttNd->EndOfSectionNode(), pTextColl, pAutoAttr );
else
{
// Handle Outline numbering correctly!
SwTextNode* pTNd = new SwTextNode(
- SwNodeIndex( *pSttNd->EndOfSectionNode() ),
+ *pSttNd->EndOfSectionNode(),
GetDoc().GetDfltTextFormatColl(),
pAutoAttr );
pTNd->ChgFormatColl( pTextColl );
@@ -576,23 +575,22 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
if( !pHeadlineTextColl || !nLines )
pHeadlineTextColl = pContentTextColl;
- SwTableNode * pTableNd = new SwTableNode( rNdIdx );
- SwEndNode* pEndNd = new SwEndNode( rNdIdx, *pTableNd );
+ SwTableNode * pTableNd = new SwTableNode( rNdIdx.GetNode() );
+ SwEndNode* pEndNd = new SwEndNode( rNdIdx.GetNode(), *pTableNd );
if( !nLines ) // For the for loop
++nLines;
- SwNodeIndex aIdx( *pEndNd );
SwTextFormatColl* pTextColl = pHeadlineTextColl;
for( sal_uInt16 nL = 0; nL < nLines; ++nL )
{
for( sal_uInt16 nB = 0; nB < nBoxes; ++nB )
{
- SwStartNode* pSttNd = new SwStartNode( aIdx, SwNodeType::Start,
+ SwStartNode* pSttNd = new SwStartNode( *pEndNd, SwNodeType::Start,
SwTableBoxStartNode );
pSttNd->m_pStartOfSection = pTableNd;
- SwTextNode * pTmpNd = new SwTextNode( aIdx, pTextColl );
+ SwTextNode * pTmpNd = new SwTextNode( *pEndNd, pTextColl );
// #i60422# Propagate some more attributes.
const SfxPoolItem* pItem = nullptr;
@@ -614,7 +612,7 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
}
}
- new SwEndNode( aIdx, *pSttNd );
+ new SwEndNode( *pEndNd, *pSttNd );
}
if ( nL + 1 >= nRepeat )
pTextColl = pContentTextColl;
@@ -1002,8 +1000,8 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
if( rRange.aStart >= rRange.aEnd )
return nullptr;
- SwTableNode * pTableNd = new SwTableNode( rRange.aStart );
- new SwEndNode( rRange.aEnd, *pTableNd );
+ SwTableNode * pTableNd = new SwTableNode( rRange.aStart.GetNode() );
+ new SwEndNode( rRange.aEnd.GetNode(), *pTableNd );
SwDoc& rDoc = GetDoc();
std::vector<sal_uInt16> aPosArr;
@@ -1086,9 +1084,9 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
// Set the TableNode as StartNode for all TextNodes in the Table
const SwNodeIndex aTmpIdx( aCntPos.nNode, -1 );
- pSttNd = new SwStartNode( aTmpIdx, SwNodeType::Start,
+ pSttNd = new SwStartNode( aTmpIdx.GetNode(), SwNodeType::Start,
SwTableBoxStartNode );
- new SwEndNode( aCntPos.nNode, *pSttNd );
+ new SwEndNode( aCntPos.GetNode(), *pSttNd );
pNewNd->m_pStartOfSection = pSttNd;
// Assign Section to the Box
@@ -1106,9 +1104,9 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
if( !pContentStore->Empty())
pContentStore->Restore( *pTextNd, pTextNd->GetText().getLength(), pTextNd->GetText().getLength()+1 );
- pSttNd = new SwStartNode( aCntPos.nNode, SwNodeType::Start, SwTableBoxStartNode );
+ pSttNd = new SwStartNode( aCntPos.GetNode(), SwNodeType::Start, SwTableBoxStartNode );
const SwNodeIndex aTmpIdx( aCntPos.nNode, 1 );
- new SwEndNode( aTmpIdx, *pSttNd );
+ new SwEndNode( aTmpIdx.GetNode(), *pSttNd );
pTextNd->m_pStartOfSection = pSttNd;
pBox = new SwTableBox( pBoxFormat, *pSttNd, pLine );
@@ -1362,14 +1360,14 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
if( rTableNodes.empty() )
return nullptr;
- SwTableNode * pTableNd = new SwTableNode( rTableNodes.begin()->begin()->aStart );
+ SwTableNode * pTableNd = new SwTableNode( rTableNodes.begin()->begin()->aStart.GetNode() );
//insert the end node after the last text node
SwNodeIndex aInsertIndex( rTableNodes.rbegin()->rbegin()->aEnd );
++aInsertIndex;
//!! ownership will be transferred in c-tor to SwNodes array.
//!! Thus no real problem here...
- new SwEndNode( aInsertIndex, *pTableNd );
+ new SwEndNode( aInsertIndex.GetNode(), *pTableNd );
SwDoc& rDoc = GetDoc();
SwTable& rTable = pTableNd->GetTable();
@@ -1397,17 +1395,15 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
for( const auto& rCell : rRow )
{
- const SwNodeIndex aTmpIdx( rCell.aStart,0 );
-
SwNodeIndex aCellEndIdx(rCell.aEnd);
++aCellEndIdx;
- SwStartNode* pSttNd = new SwStartNode( aTmpIdx, SwNodeType::Start,
+ SwStartNode* pSttNd = new SwStartNode( rCell.aStart.GetNode(), SwNodeType::Start,
SwTableBoxStartNode );
// Quotation of http://nabble.documentfoundation.org/Some-strange-lines-by-taking-a-look-at-the-bt-of-fdo-51916-tp3994561p3994639.html
// SwNode's constructor adds itself to the same SwNodes array as the other node (pSttNd).
// So this statement is only executed for the side-effect.
- new SwEndNode( aCellEndIdx, *pSttNd );
+ new SwEndNode( aCellEndIdx.GetNode(), *pSttNd );
//set the start node on all node of the current cell
SwNodeIndex aCellNodeIdx = rCell.aStart;
@@ -2008,7 +2004,7 @@ bool SwDoc::DeleteRowCol(const SwSelBoxes& rBoxes, RowColMode const eMode)
if( bNewTextNd )
{
const SwNodeIndex aTmpIdx( *pTableNd->EndOfSectionNode(), 1 );
- GetNodes().MakeTextNode( aTmpIdx,
+ GetNodes().MakeTextNode( aTmpIdx.GetNode(),
getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ) );
}
@@ -2058,7 +2054,7 @@ bool SwDoc::DeleteRowCol(const SwSelBoxes& rBoxes, RowColMode const eMode)
if( bNewTextNd )
{
const SwNodeIndex aTmpIdx( *pTableNd->EndOfSectionNode(), 1 );
- GetNodes().MakeTextNode( aTmpIdx,
+ GetNodes().MakeTextNode( aTmpIdx.GetNode(),
getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ) );
}
@@ -2324,8 +2320,8 @@ TableMergeErr SwDoc::MergeTable( SwPaM& rPam )
return nRet;
}
-SwTableNode::SwTableNode( const SwNodeIndex& rIdx )
- : SwStartNode( rIdx, SwNodeType::Table )
+SwTableNode::SwTableNode( const SwNode& rWhere )
+ : SwStartNode( rWhere, SwNodeType::Table )
{
m_pTable.reset(new SwTable);
}
@@ -3229,7 +3225,7 @@ void SwDoc::SplitTable( const SwPosition& rPos, SplitTable_HeadlineOption eHdlnM
pNew->MakeOwnFrames( &aNdIdx );
// Insert a paragraph between the Table
- GetNodes().MakeTextNode( SwNodeIndex( *pNew ),
+ GetNodes().MakeTextNode( *pNew,
getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ) );
}
@@ -3386,15 +3382,14 @@ SwTableNode* SwNodes::SplitTable( SwNode& rPos, bool bAfter,
SwEndNode* pOldTableEndNd = pTNd->EndOfSectionNode()->GetEndNode();
assert(pOldTableEndNd && "Where is the EndNode?");
- SwNodeIndex aIdx( *pBox->GetSttNd() );
- new SwEndNode( aIdx, *pTNd );
- pNewTableNd = new SwTableNode( aIdx );
+ new SwEndNode( *pBox->GetSttNd(), *pTNd );
+ pNewTableNd = new SwTableNode( *pBox->GetSttNd() );
pNewTableNd->GetTable().SetTableModel( rTable.IsNewModel() );
pOldTableEndNd->m_pStartOfSection = pNewTableNd;
pNewTableNd->m_pEndOfSection = pOldTableEndNd;
- SwNode* pBoxNd = aIdx.GetNode().GetStartNode();
+ SwNode* pBoxNd = const_cast<SwStartNode*>(pBox->GetSttNd()->GetStartNode());
do {
OSL_ENSURE( pBoxNd->IsStartNode(), "This needs to be a StartNode!" );
pBoxNd->m_pStartOfSection = pNewTableNd;
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 4723337cd289..d02d70258312 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -297,7 +297,7 @@ SwNode::SwNode()
, m_pStartOfSection( nullptr )
{}
-SwNode::SwNode( const SwNodeIndex &rWhere, const SwNodeType nNdType )
+SwNode::SwNode( const SwNode& rWhere, const SwNodeType nNdType )
: m_nNodeType( nNdType )
, m_nAFormatNumLvl( 0 )
, m_bIgnoreDontExpand( false)
@@ -312,7 +312,7 @@ SwNode::SwNode( const SwNodeIndex &rWhere, const SwNodeType nNdType )
SwNodes& rNodes = const_cast<SwNodes&> (rWhere.GetNodes());
SwNode* pNd = rNodes[ rWhere.GetIndex() -1 ];
- rNodes.InsertNode( this, rWhere );
+ rNodes.InsertNode( this, rWhere.GetIndex() );
m_pStartOfSection = pNd->GetStartNode();
if( nullptr == m_pStartOfSection )
{
@@ -958,14 +958,14 @@ void SwNode::dumpAsXml(xmlTextWriterPtr pWriter) const
(void)xmlTextWriterEndElement(pWriter); // end start node
}
-SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const SwNodeType nNdType,
+SwStartNode::SwStartNode( const SwNode& rWhere, const SwNodeType nNdType,
SwStartNodeType eSttNd )
: SwNode( rWhere, nNdType ), m_eStartNodeType( eSttNd )
{
if( !rWhere.GetIndex() )
{
SwNodes& rNodes = const_cast<SwNodes&> (rWhere.GetNodes());
- rNodes.InsertNode( this, rWhere );
+ rNodes.InsertNode( this, rWhere.GetIndex() );
m_pStartOfSection = this;
}
// Just do this temporarily until the EndNode is inserted
@@ -1058,7 +1058,7 @@ void SwStartNode::dumpAsXml(xmlTextWriterPtr pWriter) const
* @param rSttNd the start note of the section
*/
-SwEndNode::SwEndNode( const SwNodeIndex &rWhere, SwStartNode& rSttNd )
+SwEndNode::SwEndNode( const SwNode& rWhere, SwStartNode& rSttNd )
: SwNode( rWhere, SwNodeType::End )
{
m_pStartOfSection = &rSttNd;
@@ -1080,7 +1080,7 @@ SwContentNode::SwContentNode()
, mbSetModifyAtAttr( false )
{}
-SwContentNode::SwContentNode( const SwNodeIndex &rWhere, const SwNodeType nNdType,
+SwContentNode::SwContentNode( const SwNode& rWhere, const SwNodeType nNdType,
SwFormatColl *pColl )
: SwNode( rWhere, nNdType )
, m_aCondCollListener( *this )
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 0336ec48d9e1..1858999bd958 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -606,7 +606,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
if( !pSttNd->IsSectionNode() )
{
// create StartNode and EndNode at InsertPos
- SwStartNode* pTmp = new SwStartNode( aIdx,
+ SwStartNode* pTmp = new SwStartNode( aIdx.GetNode(),
SwNodeType::Start,
/*?? NodeType ??*/ SwNormalStartNode );
@@ -614,13 +614,13 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
aSttNdStack.insert( aSttNdStack.begin() + nLevel, pTmp );
// create EndNode
- new SwEndNode( aIdx, *pTmp );
+ new SwEndNode( aIdx.GetNode(), *pTmp );
}
else if (GetDoc().GetIDocumentUndoRedo().IsUndoNodes(
rNodes))
{
// use placeholder in UndoNodes array
- new SwPlaceholderNode(aIdx);
+ new SwPlaceholderNode(aIdx.GetNode());
}
else
{
@@ -701,7 +701,7 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
aIdx -= nInsPos;
nInsPos = SwNodeOffset(0);
}
- new SwPlaceholderNode(aIdx);
+ new SwPlaceholderNode(aIdx.GetNode());
--aRg.aEnd;
--aIdx;
break;
@@ -722,14 +722,14 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
{
// create decrease
SwNodeIndex aTmpSIdx( aOrigInsPos.aStart, 1 );
- SwStartNode* pTmpStt = new SwStartNode( aTmpSIdx,
+ SwStartNode* pTmpStt = new SwStartNode( aTmpSIdx.GetNode(),
SwNodeType::Start,
static_cast<SwStartNode*>(pCurrentNode)->GetStartNodeType() );
--aTmpSIdx;
SwNodeIndex aTmpEIdx( aOrigInsPos.aEnd );
- new SwEndNode( aTmpEIdx, *pTmpStt );
+ new SwEndNode( aTmpEIdx.GetNode(), *pTmpStt );
--aTmpEIdx;
++aTmpSIdx;
@@ -929,7 +929,7 @@ void SwNodes::SectionDown(SwNodeRange *pRange, SwStartNodeType eSttNdTyp )
else
{
// insert a new StartNode
- SwNode* pSttNd = new SwStartNode( pRange->aStart, SwNodeType::Start, eSttNdTyp );
+ SwNode* pSttNd = new SwStartNode( pRange->aStart.GetNode(), SwNodeType::Start, eSttNdTyp );
pRange->aStart = *pSttNd;
aTmpIdx = pRange->aStart;
}
@@ -944,7 +944,7 @@ void SwNodes::SectionDown(SwNodeRange *pRange, SwStartNodeType eSttNdTyp )
{
++pRange->aEnd;
// insert a new EndNode
- new SwEndNode( pRange->aEnd, *pRange->aStart.GetNode().GetStartNode() );
+ new SwEndNode( pRange->aEnd.GetNode(), *pRange->aStart.GetNode().GetStartNode() );
}
--pRange->aEnd;
@@ -1005,7 +1005,7 @@ void SwNodes::SectionUp(SwNodeRange *pRange)
else if( aIdx == pRange->aStart.GetIndex()-1 ) // before StartNode
DelNodes( aIdx );
else
- new SwEndNode( pRange->aStart, *aIdx.GetNode().GetStartNode() );
+ new SwEndNode( pRange->aStart.GetNode(), *aIdx.GetNode().GetStartNode() );
// If the end of a range is before or at a StartNode, so delete it,
// otherwise empty S/E or E/S nodes would be created.
@@ -1015,7 +1015,7 @@ void SwNodes::SectionUp(SwNodeRange *pRange)
DelNodes( pRange->aEnd );
else
{
- new SwStartNode( pRange->aEnd );
+ new SwStartNode( pRange->aEnd.GetNode() );
/*?? which NodeType ??*/
aTmpIdx = *pRange->aEnd.GetNode().EndOfSectionNode();
--pRange->aEnd;
@@ -1489,7 +1489,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
// be also a TextNode in the NodesArray to store the content
if( !pDestNd )
{
- pDestNd = rNodes.MakeTextNode( rPos.nNode, pSrcNd->GetTextColl() );
+ pDestNd = rNodes.MakeTextNode( rPos.GetNode(), pSrcNd->GetTextColl() );
--rPos.nNode;
rPos.nContent.Assign( pDestNd, 0 );
bCopyCollFormat = true;
@@ -1622,7 +1622,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
}
pDestNd =
- rNodes.MakeTextNode( rPos.nNode, pEndSrcNd->GetTextColl() );
+ rNodes.MakeTextNode( rPos.GetNode(), pEndSrcNd->GetTextColl() );
--rPos.nNode;
rPos.nContent.Assign( pDestNd, 0 );
}
@@ -1773,7 +1773,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
// insert a DummyNode for a TableNode
if( bTableInsDummyNode )
- new SwPlaceholderNode(aInsPos);
+ new SwPlaceholderNode(aInsPos.GetNode());
// copy all of the table's nodes into the current cell
for( ++aRg.aStart; aRg.aStart.GetIndex() <
@@ -1782,7 +1782,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
{
// insert a DummyNode for the box-StartNode?
if( bTableInsDummyNode )
- new SwPlaceholderNode(aInsPos);
+ new SwPlaceholderNode(aInsPos.GetNode());
SwStartNode* pSttNd = aRg.aStart.GetNode().GetStartNode();
CopyNodes( SwNodeRange( *pSttNd, SwNodeOffset(+ 1),
@@ -1791,12 +1791,12 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
// insert a DummyNode for the box-EndNode?
if( bTableInsDummyNode )
- new SwPlaceholderNode(aInsPos);
+ new SwPlaceholderNode(aInsPos.GetNode());
aRg.aStart = *pSttNd->EndOfSectionNode();
}
// insert a DummyNode for the table-EndNode
if( bTableInsDummyNode )
- new SwPlaceholderNode(aInsPos);
+ new SwPlaceholderNode(aInsPos.GetNode());
aRg.aStart = *pCurrentNode->EndOfSectionNode();
}
else
@@ -1847,9 +1847,9 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
case SwNodeType::Start:
{
- SwStartNode* pTmp = new SwStartNode( aInsPos, SwNodeType::Start,
+ SwStartNode* pTmp = new SwStartNode( aInsPos.GetNode(), SwNodeType::Start,
static_cast<SwStartNode*>(pCurrentNode)->GetStartNodeType() );
- new SwEndNode( aInsPos, *pTmp );
+ new SwEndNode( aInsPos.GetNode(), *pTmp );
--aInsPos;
nLevel++;
}
@@ -1878,7 +1878,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
case SwNodeType::Ole:
{
static_cast<SwContentNode*>(pCurrentNode)->MakeCopy(
- rDoc, aInsPos, bNewFrames);
+ rDoc, aInsPos.GetNode(), bNewFrames);
}
break;
@@ -1919,8 +1919,8 @@ void SwNodes::DelDummyNodes( const SwNodeRange& rRg )
SwStartNode* SwNodes::MakeEmptySection( const SwNodeIndex& rIdx,
SwStartNodeType eSttNdTyp )
{
- SwStartNode* pSttNd = new SwStartNode( rIdx, SwNodeType::Start, eSttNdTyp );
- new SwEndNode( rIdx, *pSttNd );
+ SwStartNode* pSttNd = new SwStartNode( rIdx.GetNode(), SwNodeType::Start, eSttNdTyp );
+ new SwEndNode( rIdx.GetNode(), *pSttNd );
return pSttNd;
}
@@ -1928,9 +1928,9 @@ SwStartNode* SwNodes::MakeTextSection( const SwNode & rWhere,
SwStartNodeType eSttNdTyp,
SwTextFormatColl *pColl )
{
- SwStartNode* pSttNd = new SwStartNode( SwNodeIndex(rWhere), SwNodeType::Start, eSttNdTyp );
- new SwEndNode( SwNodeIndex(rWhere), *pSttNd );
- MakeTextNode( SwNodeIndex( rWhere, - 1 ), pColl );
+ SwStartNode* pSttNd = new SwStartNode( rWhere, SwNodeType::Start, eSttNdTyp );
+ new SwEndNode( rWhere, *pSttNd );
+ MakeTextNode( SwNodeIndex( rWhere, - 1 ).GetNode(), pColl );
return pSttNd;
}
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 89d9d2516e60..59e29b863b64 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -1124,7 +1124,7 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe
// Insert an empty TextNode at the Section's start
SwNodeIndex aIdx( *pSectNd, +1 );
SwNodeIndex aEndIdx( *pSectNd->EndOfSectionNode() );
- pDoc->GetNodes().MakeTextNode( aIdx,
+ pDoc->GetNodes().MakeTextNode( aIdx.GetNode(),
pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ) );
if( pESh )
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index cce62bd53f9b..5b6e5f4abf3a 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -87,7 +87,7 @@ void SwFEShell::Copy( SwDoc& rClpDoc, const OUString* pNewClpText )
{
rClpDoc.GetNodes().Delete( aSttIdx,
rClpDoc.GetNodes().GetEndOfContent().GetIndex() - aSttIdx.GetIndex() );
- pTextNd = rClpDoc.GetNodes().MakeTextNode( aSttIdx,
+ pTextNd = rClpDoc.GetNodes().MakeTextNode( aSttIdx.GetNode(),
rClpDoc.GetDfltTextFormatColl() );
--aSttIdx;
}
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 14a898cf71eb..1d13b7a7a917 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -58,7 +58,7 @@
using namespace com::sun::star;
SwGrfNode::SwGrfNode(
- const SwNodeIndex & rWhere,
+ SwNode & rWhere,
const OUString& rGrfName,
const OUString& rFltName,
const Graphic* pGraphic,
@@ -76,7 +76,7 @@ SwGrfNode::SwGrfNode(
ReRead(rGrfName, rFltName, pGraphic, false);
}
-SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
+SwGrfNode::SwGrfNode( SwNode& rWhere,
const GraphicObject& rGrfObj,
SwGrfFormatColl *pGrfColl,
SwAttrSet const * pAutoAttr ) :
@@ -97,7 +97,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
*
* @note Does not read/open the image itself!
*/
-SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
+SwGrfNode::SwGrfNode( SwNode& rWhere,
std::u16string_view rGrfName,
const OUString& rFltName,
SwGrfFormatColl *pGrfColl,
@@ -402,7 +402,7 @@ const GraphicObject* SwGrfNode::GetReplacementGrfObj() const
return mpReplacementGraphic.get();
}
-SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere,
+SwGrfNode * SwNodes::MakeGrfNode( SwNode & rWhere,
const OUString& rGrfName,
const OUString& rFltName,
const Graphic* pGraphic,
@@ -421,7 +421,7 @@ SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere,
return pNode;
}
-SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere,
+SwGrfNode * SwNodes::MakeGrfNode( SwNode & rWhere,
const GraphicObject& rGrfObj,
SwGrfFormatColl* pGrfColl )
{
@@ -702,7 +702,7 @@ void SwGrfNode::ScaleImageMap()
}
}
-SwContentNode* SwGrfNode::MakeCopy(SwDoc& rDoc, const SwNodeIndex& rIdx, bool) const
+SwContentNode* SwGrfNode::MakeCopy(SwDoc& rDoc, SwNode& rIdx, bool) const
{
// copy formats into the other document
SwGrfFormatColl* pColl = rDoc.CopyGrfColl( *GetGrfColl() );
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 4a86c6f425e2..633940b7e58a 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -212,7 +212,7 @@ void SwEmbedObjectLink::Closed()
SvBaseLink::Closed();
}
-SwOLENode::SwOLENode( const SwNodeIndex &rWhere,
+SwOLENode::SwOLENode( SwNode& rWhere,
const svt::EmbeddedObjectRef& xObj,
SwGrfFormatColl *pGrfColl,
SwAttrSet const * pAutoAttr ) :
@@ -224,7 +224,7 @@ SwOLENode::SwOLENode( const SwNodeIndex &rWhere,
maOLEObj.SetNode( this );
}
-SwOLENode::SwOLENode( const SwNodeIndex &rWhere,
+SwOLENode::SwOLENode( SwNode& rWhere,
const OUString &rString,
sal_Int64 nAspect,
SwGrfFormatColl *pGrfColl,
@@ -378,7 +378,7 @@ bool SwOLENode::SavePersistentData()
return true;
}
-SwOLENode * SwNodes::MakeOLENode( const SwNodeIndex & rWhere,
+SwOLENode * SwNodes::MakeOLENode( SwNode& rWhere,
const svt::EmbeddedObjectRef& xObj,
SwGrfFormatColl* pGrfColl )
{
@@ -400,7 +400,7 @@ SwOLENode * SwNodes::MakeOLENode( const SwNodeIndex & rWhere,
return pNode;
}
-SwOLENode * SwNodes::MakeOLENode( const SwNodeIndex & rWhere,
+SwOLENode * SwNodes::MakeOLENode( SwNode& rWhere,
const OUString &rName, sal_Int64 nAspect, SwGrfFormatColl* pGrfColl, SwAttrSet const * pAutoAttr )
{
OSL_ENSURE( pGrfColl,"SwNodes::MakeOLENode: Formatpointer is 0." );
@@ -427,7 +427,7 @@ Size SwOLENode::GetTwipSize() const
return const_cast<SwOLENode*>(this)->maOLEObj.GetObject().GetSize( &aMapMode );
}
-SwContentNode* SwOLENode::MakeCopy( SwDoc& rDoc, const SwNodeIndex& rIdx, bool) const
+SwContentNode* SwOLENode::MakeCopy( SwDoc& rDoc, SwNode& rIdx, bool) const
{
// If there's already a SvPersist instance, we use it
SfxObjectShell* pPersistShell = rDoc.GetPersist();
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index b163f8e2bc83..35fa006e903d 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -2197,7 +2197,7 @@ void SwTable::ConvertSubtableBox(sal_uInt16 const nRow, sal_uInt16 const nBox)
pSourceBox, j+k, 1);
// insert dummy text node...
pDoc->GetNodes().MakeTextNode(
- SwNodeIndex(*pSourceBox->GetSttNd(), +1),
+ SwNodeIndex(*pSourceBox->GetSttNd(), +1).GetNode(),
pDoc->GetDfltTextFormatColl());
SwNodeRange content(*pSourceBox->GetSttNd(), SwNodeOffset(+2),
*pSourceBox->GetSttNd()->EndOfSectionNode());
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 2433ef710fde..10f221ff0c53 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -100,7 +100,7 @@ typedef std::vector<SwTextAttr*> SwpHts;
#define CHECK_SWPHINTS_IF_FRM(pNd)
#endif
-SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere,
+SwTextNode *SwNodes::MakeTextNode( SwNode& rWhere,
SwTextFormatColl *pColl, bool const bNewFrames)
{
OSL_ENSURE( pColl, "Collection pointer is 0." );
@@ -174,7 +174,7 @@ SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere,
}
[[fallthrough]];
default:
- if( rWhere == aTmp )
+ if( &rWhere == &aTmp.GetNode() )
aTmp -= SwNodeOffset(2);
else
return pNode;
@@ -183,7 +183,7 @@ SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere,
} while( true );
}
-SwTextNode::SwTextNode( const SwNodeIndex &rWhere, SwTextFormatColl *pTextColl, const SfxItemSet* pAutoAttr )
+SwTextNode::SwTextNode( SwNode& rWhere, SwTextFormatColl *pTextColl, const SfxItemSet* pAutoAttr )
: SwContentNode( rWhere, SwNodeType::Text, pTextColl ),
m_pParaIdleData_Impl(nullptr),
m_bContainsHiddenChars(false),
@@ -1219,7 +1219,7 @@ public:
SwContentNodeTmp() : SwContentNode() {}
virtual void NewAttrSet(SwAttrPool&) override {}
virtual SwContentFrame *MakeFrame(SwFrame*) override { return nullptr; }
- virtual SwContentNode* MakeCopy(SwDoc&, const SwNodeIndex&, bool /*bNewFrames*/) const override { return nullptr; };
+ virtual SwContentNode* MakeCopy(SwDoc&, SwNode&, bool /*bNewFrames*/) const override { return nullptr; };
};
};
@@ -3015,7 +3015,7 @@ SwTextNode* SwTextNode::MakeNewTextNode( const SwNodeIndex& rPos, bool bNext,
SwTextFormatColl* pColl = GetTextColl();
- SwTextNode *pNode = new SwTextNode( rPos, pColl, oNewAttrSet ? &*oNewAttrSet : nullptr );
+ SwTextNode *pNode = new SwTextNode( rPos.GetNode(), pColl, oNewAttrSet ? &*oNewAttrSet : nullptr );
oNewAttrSet.reset();
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index f60f8911815e..d261ade7f82a 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -865,7 +865,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
assert(!m_bTableDelLastNd || pInsNd->IsTextNode());
if( pInsNd->IsTableNode() )
{
- pInsNd = rDoc.GetNodes().MakeTextNode( aIdx,
+ pInsNd = rDoc.GetNodes().MakeTextNode( aIdx.GetNode(),
rDoc.GetDfltTextFormatColl() );
--aIdx;
aPos.nNode = aIdx;
@@ -1250,7 +1250,7 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
{
// than add again a Node at the end
const SwNodeIndex aTmpIdx( *pTableNd->EndOfSectionNode(), 1 );
- rDoc.GetNodes().MakeTextNode( aTmpIdx,
+ rDoc.GetNodes().MakeTextNode( aTmpIdx.GetNode(),
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ) );
}
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index 83b32f23058e..05263f7f9752 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -575,7 +575,7 @@ void SwUndoUpdateIndex::UndoImpl(::sw::UndoRedoContext & rContext)
assert(last.GetNode().IsTextNode());
// dummy node so that SaveSection doesn't remove ToX section...
SwTextNode *const pDeletionPrevention = rDoc.GetNodes().MakeTextNode(
- SwNodeIndex(*rDoc.GetNodes()[m_nStartIndex]->EndOfSectionNode()),
+ *rDoc.GetNodes()[m_nStartIndex]->EndOfSectionNode(),
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_TEXT));
m_pSaveSectionUpdated->SaveSection(SwNodeRange(first, last), false);
m_pSaveSectionOriginal->RestoreSection(&rDoc, first.GetNode(), true);
@@ -596,7 +596,7 @@ void SwUndoUpdateIndex::RedoImpl(::sw::UndoRedoContext & rContext)
assert(last.GetNode().IsTextNode());
// dummy node so that SaveSection doesn't remove ToX section...
SwTextNode *const pDeletionPrevention = rDoc.GetNodes().MakeTextNode(
- SwNodeIndex(*rDoc.GetNodes()[m_nStartIndex]->EndOfSectionNode()),
+ *rDoc.GetNodes()[m_nStartIndex]->EndOfSectionNode(),
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_TEXT));
m_pSaveSectionOriginal->SaveSection(SwNodeRange(first, last), false);
m_pSaveSectionUpdated->RestoreSection(&rDoc, first.GetNode(), true);
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 98a67a3b6996..2f511d996eb4 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -534,8 +534,8 @@ SwTableNode* SwNodes::UndoTableToText( SwNodeOffset nSttNd, SwNodeOffset nEndNd,
SwNodeIndex aSttIdx( *this, nSttNd );
SwNodeIndex aEndIdx( *this, nEndNd+1 );
- SwTableNode * pTableNd = new SwTableNode( aSttIdx );
- SwEndNode* pEndNd = new SwEndNode( aEndIdx, *pTableNd );
+ SwTableNode * pTableNd = new SwTableNode( aSttIdx.GetNode() );
+ SwEndNode* pEndNd = new SwEndNode( aEndIdx.GetNode(), *pTableNd );
aEndIdx = *pEndNd;
@@ -626,10 +626,10 @@ SwTableNode* SwNodes::UndoTableToText( SwNodeOffset nSttNd, SwNodeOffset nEndNd,
}
aEndIdx = pSave->m_nEndNd;
- SwStartNode* pSttNd = new SwStartNode( aSttIdx, SwNodeType::Start,
+ SwStartNode* pSttNd = new SwStartNode( aSttIdx.GetNode(), SwNodeType::Start,
SwTableBoxStartNode );
pSttNd->m_pStartOfSection = pTableNd;
- new SwEndNode( aEndIdx, *pSttNd );
+ new SwEndNode( aEndIdx.GetNode(), *pSttNd );
for( SwNodeOffset i = aSttIdx.GetIndex(); i < aEndIdx.GetIndex()-1; ++i )
{
@@ -1912,8 +1912,8 @@ void SwUndoTableMerge::UndoImpl(::sw::UndoRedoContext & rContext)
OSL_ENSURE( pBox, "Where is my TableBox?" );
if( !m_pSaveTable->IsNewModel() )
- rDoc.GetNodes().MakeTextNode( SwNodeIndex(
- *pBox->GetSttNd()->EndOfSectionNode() ), pColl );
+ rDoc.GetNodes().MakeTextNode(
+ const_cast<SwEndNode&>(*pBox->GetSttNd()->EndOfSectionNode()), pColl );
// this was the separator -> restore moved ones
for (size_t i = m_vMoves.size(); i; )
@@ -2394,7 +2394,7 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext)
SwTableBox& rBox = *pBox;
SwNodeIndex aInsIdx( *rBox.GetSttNd(), 1 );
- rDoc.GetNodes().MakeTextNode( aInsIdx, rDoc.GetDfltTextFormatColl() );
+ rDoc.GetNodes().MakeTextNode( aInsIdx.GetNode(), rDoc.GetDfltTextFormatColl() );
// b62341295: Redline for copying tables
const SwNode *pEndNode = rBox.GetSttNd()->EndOfSectionNode();
@@ -2530,7 +2530,7 @@ void SwUndoTableCpyTable::RedoImpl(::sw::UndoRedoContext & rContext)
SwNodeIndex aInsIdx( *rBox.GetSttNd(), 1 );
// b62341295: Redline for copying tables - Start.
- rDoc.GetNodes().MakeTextNode( aInsIdx, rDoc.GetDfltTextFormatColl() );
+ rDoc.GetNodes().MakeTextNode( aInsIdx.GetNode(), rDoc.GetDfltTextFormatColl() );
SwPaM aPam( aInsIdx.GetNode(), *rBox.GetSttNd()->EndOfSectionNode());
std::unique_ptr<SwUndo> pUndo(IDocumentRedlineAccess::IsRedlineOn(GetRedlineFlags())
? nullptr
@@ -2607,7 +2607,7 @@ void SwUndoTableCpyTable::AddBoxBefore( const SwTableBox& rBox, bool bDelContent
if( bDelContent )
{
SwNodeIndex aInsIdx( *rBox.GetSttNd(), 1 );
- pDoc->GetNodes().MakeTextNode( aInsIdx, pDoc->GetDfltTextFormatColl() );
+ pDoc->GetNodes().MakeTextNode( aInsIdx.GetNode(), pDoc->GetDfltTextFormatColl() );
SwPaM aPam( aInsIdx.GetNode(), *rBox.GetSttNd()->EndOfSectionNode() );
if( !pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
diff --git a/sw/source/filter/docx/swdocxreader.cxx b/sw/source/filter/docx/swdocxreader.cxx
index a02420a917f0..2bd3f3474283 100644
--- a/sw/source/filter/docx/swdocxreader.cxx
+++ b/sw/source/filter/docx/swdocxreader.cxx
@@ -187,7 +187,7 @@ bool SwDOCXReader::MakeEntries( SwDoc *pD, SwTextBlocks &rBlocks )
pCNd = rIdx.GetNode().GetTextNode();
if( nullptr == pCNd )
{
- pCNd = pD->GetNodes().MakeTextNode( rIdx, pColl );
+ pCNd = pD->GetNodes().MakeTextNode( rIdx.GetNode(), pColl );
rIdx = *pCNd;
}
}
@@ -205,7 +205,7 @@ bool SwDOCXReader::MakeEntries( SwDoc *pD, SwTextBlocks &rBlocks )
if( nullptr == pCNd )
{
++rIdx;
- pCNd = pD->GetNodes().MakeTextNode( rIdx, pColl );
+ pCNd = pD->GetNodes().MakeTextNode( rIdx.GetNode(), pColl );
rIdx = *pCNd;
}
}
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index 4c5280bbadf5..90b97b0ac625 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -194,7 +194,7 @@ void SwHTMLParser::NewDivision( HtmlTokenId nToken )
// and hide the original header/footers content by putting it into a hidden
// document-level section
SwNodeIndex aSttIdx( rContentStIdx, 1 );
- m_xDoc->GetNodes().MakeTextNode( aSttIdx,
+ m_xDoc->GetNodes().MakeTextNode( aSttIdx.GetNode(),
m_pCSS1Parser->GetTextCollFromPool(RES_POOLCOLL_TEXT));
// delete the current content of the section
diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx
index 821d31e47c49..8b8c92482510 100644
--- a/sw/source/filter/ww8/ww8glsy.cxx
+++ b/sw/source/filter/ww8/ww8glsy.cxx
@@ -120,7 +120,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks,
pCNd = rIdx.GetNode().GetTextNode();
if( nullptr == pCNd )
{
- pCNd = pD->GetNodes().MakeTextNode( rIdx, pColl );
+ pCNd = pD->GetNodes().MakeTextNode( rIdx.GetNode(), pColl );
rIdx = *pCNd;
}
}
@@ -133,7 +133,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks,
|| HasBareGraphicEnd(pD,rIdx))
{
++rIdx;
- pCNd = pD->GetNodes().MakeTextNode( rIdx, pColl );
+ pCNd = pD->GetNodes().MakeTextNode( rIdx.GetNode(), pColl );
rIdx = *pCNd;
}
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index d40ff1948480..d7e2d418d47b 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4609,7 +4609,7 @@ void wwSectionManager::InsertSegments()
if (pTableNd)
{
pTextNd =
- mrReader.m_rDoc.GetNodes().MakeTextNode(aAnchor,
+ mrReader.m_rDoc.GetNodes().MakeTextNode(aAnchor.GetNode(),
mrReader.m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ));
aSectPaM.GetPoint()->Assign(*pTextNd);
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 86d05ae9b45a..e13d09a700c5 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1261,7 +1261,7 @@ static bool lcl_FoldedOutlineNodeEndOfParaSplit(SwWrtShell *pThis)
// insert at end of tablebox doesn't work correct without
MakeAllOutlineContentTemporarilyVisible a(pDoc);
- SwTextNode* pNd = pDoc->GetNodes().MakeTextNode(SwNodeIndex(*pEndNd), pTextNode->GetTextColl(), true);
+ SwTextNode* pNd = pDoc->GetNodes().MakeTextNode(*pEndNd, pTextNode->GetTextColl(), true);
(void) rOutlineNodes.Seek_Entry(pNd, &nPos);
pThis->GotoOutline(nPos);