sw/inc/ndarr.hxx | 2 +- sw/source/core/doc/docglbl.cxx | 4 ++-- sw/source/core/doc/doctxm.cxx | 6 +++--- sw/source/core/docnode/ndsect.cxx | 16 ++++++++-------- sw/source/core/undo/unsect.cxx | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-)
New commits: commit 1dd58b8bc136b6867fbcea5adbfdc82ff685f129 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sun Sep 4 08:28:16 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Sep 5 08:54:08 2022 +0200 use more SwPosition::Assign part of hiding the internals of SwPosition Change-Id: Ib9012888a7d75e75a9301ac612349ed28d02a8a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139359 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index a3fe64b5cc15..b7fd0bb2e078 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -303,7 +303,7 @@ public: SwSectionFormat& rSectionFormat, SwSectionData const&, SwTOXBase const*const pTOXBase, - SwNodeIndex const*const pEnd, + SwNode const * pEndNd, bool const bInsAtStart = true, bool const bCreateFrames = true); diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 67bde58b3c6b..ca71fa98c707 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -461,12 +461,12 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, if (aEndIdx >= aStartIdx) { pSectNd = GetNodes().InsertTextSection(aStartIdx.GetNode(), - *pFormat, aSectData, nullptr, &aEndIdx, false); + *pFormat, aSectData, nullptr, &aEndIdx.GetNode(), false); } else { pSectNd = GetNodes().InsertTextSection(aEndIdx.GetNode(), - *pFormat, aSectData, nullptr, &aStartIdx, false); + *pFormat, aSectData, nullptr, &aStartIdx.GetNode(), false); } // <- #i26762# diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 157bbe1b84c1..215f9e9fb5c9 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -397,7 +397,7 @@ SwTOXBaseSection* SwDoc::InsertTableOf( const SwPaM& aPam, --aIdx; SwSectionFormat* pSectFormat = MakeSectionFormat(); GetNodes().InsertTextSection( - *pHeadNd, *pSectFormat, headerData, nullptr, &aIdx, true, false); + *pHeadNd, *pSectFormat, headerData, nullptr, &aIdx.GetNode(), true, false); } } @@ -431,7 +431,7 @@ void SwDoc::InsertTableOf( SwNodeOffset nSttNd, SwNodeOffset nEndNd, pFormat->SetFormatAttr(*pSet); SwSectionNode *const pNewSectionNode = - GetNodes().InsertTextSection(aStt.GetNode(), *pFormat, aSectionData, &rTOX, &aEnd); + GetNodes().InsertTextSection(aStt.GetNode(), *pFormat, aSectionData, &rTOX, &aEnd.GetNode()); if (!pNewSectionNode) { DelSectionFormat( pFormat ); @@ -1052,7 +1052,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, --aIdx; SwSectionFormat* pSectFormat = rDoc.MakeSectionFormat(); rDoc.GetNodes().InsertTextSection( - *pHeadNd, *pSectFormat, headerData, nullptr, &aIdx, true, false); + *pHeadNd, *pSectFormat, headerData, nullptr, &aIdx.GetNode(), true, false); if (pUndo) { diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index d97c08d278ff..34492a2f5a71 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -222,7 +222,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, --aEnd; // End is inclusive in the InsertSection pNewSectNode = GetNodes().InsertTextSection( - aStt.GetNode(), *pFormat, rNewData, pTOXBase, & aEnd); + aStt.GetNode(), *pFormat, rNewData, pTOXBase, & aEnd.GetNode()); } else { @@ -291,7 +291,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, } } pNewSectNode = GetNodes().InsertTextSection( - pSttPos->GetNode(), *pFormat, rNewData, pTOXBase, &pEndPos->nNode); + pSttPos->GetNode(), *pFormat, rNewData, pTOXBase, &pEndPos->GetNode()); } } else @@ -783,14 +783,14 @@ SwSectionNode* SwNodes::InsertTextSection(SwNode& rNd, SwSectionFormat& rSectionFormat, SwSectionData const& rSectionData, SwTOXBase const*const pTOXBase, - SwNodeIndex const*const pEnd, + SwNode const*const pEndNd, bool const bInsAtStart, bool const bCreateFrames) { SwNodeIndex aInsPos( rNd ); - if( !pEnd ) // No Area, thus create a new Section before/after it + if( !pEndNd ) // No Area, thus create a new Section before/after it { // #i26762# - OSL_ENSURE(!pEnd || rNd.GetIndex() <= pEnd->GetIndex(), + OSL_ENSURE(!pEndNd || rNd.GetIndex() <= pEndNd->GetIndex(), "Section start and end in wrong order!"); if( bInsAtStart ) @@ -845,11 +845,11 @@ SwSectionNode* SwNodes::InsertTextSection(SwNode& rNd, } } - if( pEnd ) + if( pEndNd ) { // Special case for the Reader/Writer - if( pEnd->GetNode() != GetEndOfContent() ) - aInsPos = pEnd->GetIndex()+1; + if( *pEndNd != GetEndOfContent() ) + aInsPos = pEndNd->GetIndex()+1; // #i58710: We created a RTF document with a section break inside a table cell // We are not able to handle a section start inside a table and the section end outside. const SwNode* pLastNode = pSectNd->StartOfSectionNode()->EndOfSectionNode(); diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx index 05263f7f9752..69bd6fd7cf04 100644 --- a/sw/source/core/undo/unsect.cxx +++ b/sw/source/core/undo/unsect.cxx @@ -380,7 +380,7 @@ void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext) /// OD 04.10.2002 #102894# /// remember inserted section node for further calculations SwSectionNode* pInsertedSectNd = rDoc.GetNodes().InsertTextSection( - aStt.GetNode(), *pFormat, *m_pSectionData, nullptr, & aEnd); + aStt.GetNode(), *pFormat, *m_pSectionData, nullptr, & aEnd.GetNode() ); if( SfxItemState::SET == pFormat->GetItemState( RES_FTN_AT_TXTEND ) || SfxItemState::SET == pFormat->GetItemState( RES_END_AT_TXTEND ))