sw/inc/ndarr.hxx | 2 +- sw/source/core/doc/DocumentLayoutManager.cxx | 4 ++-- sw/source/core/doc/doclay.cxx | 6 +++--- sw/source/core/doc/docredln.cxx | 4 ++-- sw/source/core/docnode/nodes.cxx | 2 +- sw/source/core/txtnode/atrftn.cxx | 2 +- sw/source/core/undo/untbl.cxx | 2 +- sw/source/filter/html/htmltab.cxx | 7 +++---- sw/source/filter/ww8/ww8par.cxx | 2 +- sw/source/filter/xml/xmltbli.cxx | 2 +- 10 files changed, 16 insertions(+), 17 deletions(-)
New commits: commit 6a590bfe0427ed91fb20f037783ca0335f67cf6c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Aug 5 20:34:09 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Aug 6 21:31:17 2022 +0200 make MakeTextSection take a SwNode, not an SwNodeIndex as part of the process of hiding the internals of SwPosition Change-Id: Ia64ddd3e1f34c7c160af0134ef5526faf43108e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137895 Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index 1b1227549583..cce94857bc3f 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -209,7 +209,7 @@ public: SwTextNode *MakeTextNode( const SwNodeIndex & rWhere, SwTextFormatColl *pColl, bool bNewFrames = true); ///< in ndtxt.cxx - SwStartNode* MakeTextSection( const SwNodeIndex & rWhere, + SwStartNode* MakeTextSection( const SwNode & rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl ); diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index 3f49328bf462..2857a9afa17e 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -131,10 +131,10 @@ SwFrameFormat *DocumentLayoutManager::MakeLayoutFormat( RndStdIds eRequest, cons (bHeader ? "Right header" : "Right footer"), m_rDoc.GetDfltFrameFormat() ); - SwNodeIndex aTmpIdx( m_rDoc.GetNodes().GetEndOfAutotext() ); + const SwNode& rEndOfAutotext( m_rDoc.GetNodes().GetEndOfAutotext() ); SwStartNode* pSttNd = m_rDoc.GetNodes().MakeTextSection - ( aTmpIdx, + ( rEndOfAutotext, bHeader ? SwHeaderStartNode : SwFooterStartNode, m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(o3tl::narrowing<sal_uInt16>( bHeader ? ( eRequest == RndStdIds::HEADERL diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 2e5285fe9c89..9e545a654660 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -773,7 +773,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable, pNewSet->Put( std::move(aFrameSize) ); SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection( - SwNodeIndex( rDoc.GetNodes().GetEndOfAutotext() ), + rDoc.GetNodes().GetEndOfAutotext(), SwFlyStartNode, pColl ); pNewSet->Put( SwFormatContent( pSttNd )); @@ -1087,8 +1087,8 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection( - SwNodeIndex( rDoc.GetNodes().GetEndOfAutotext() ), - SwFlyStartNode, pColl ); + rDoc.GetNodes().GetEndOfAutotext(), + SwFlyStartNode, pColl ); pNewFormat = rDoc.MakeFlyFrameFormat( rDoc.GetUniqueFrameName(), rDoc.getIDocumentStylePoolAccess().GetFrameFormatFromPool( RES_POOLFRM_FRAME ) ); diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index cead2ecf1cba..f298e67598c4 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -1531,7 +1531,7 @@ void SwRangeRedline::MoveToSection() ? pCEndNd->GetTextNode()->GetTextColl() : rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD); - pSttNd = rNds.MakeTextSection( SwNodeIndex( rNds.GetEndOfRedlines() ), + pSttNd = rNds.MakeTextSection( rNds.GetEndOfRedlines(), SwNormalStartNode, pColl ); SwTextNode* pTextNd = rNds[ pSttNd->GetIndex() + 1 ]->GetTextNode(); @@ -1598,7 +1598,7 @@ void SwRangeRedline::CopyToSection() ? pCSttNd->GetTextNode()->GetTextColl() : rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD); - pSttNd = rNds.MakeTextSection( SwNodeIndex( rNds.GetEndOfRedlines() ), + pSttNd = rNds.MakeTextSection( rNds.GetEndOfRedlines(), SwNormalStartNode, pColl ); SwPosition aPos( *pSttNd, SwNodeOffset(1) ); diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 3e8baadd7800..341eadc99fd1 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -1924,7 +1924,7 @@ SwStartNode* SwNodes::MakeEmptySection( const SwNodeIndex& rIdx, return pSttNd; } -SwStartNode* SwNodes::MakeTextSection( const SwNodeIndex & rWhere, +SwStartNode* SwNodes::MakeTextSection( const SwNode & rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl ) { diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index bfc961bc7d3a..9abd514588d3 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -465,7 +465,7 @@ void SwTextFootnote::MakeNewTextSection( SwNodes& rNodes ) if( nullptr == pFormatColl ) pFormatColl = rNodes.GetDoc().getIDocumentStylePoolAccess().GetTextCollFromPool( nPoolId ); - SwStartNode* pSttNd = rNodes.MakeTextSection( SwNodeIndex( rNodes.GetEndOfInserts() ), + SwStartNode* pSttNd = rNodes.MakeTextSection( rNodes.GetEndOfInserts(), SwFootnoteStartNode, pFormatColl ); m_pStartNode.reset(new SwNodeIndex(*pSttNd)); } diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index dedb58c2369d..477ed55200c5 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -1884,7 +1884,7 @@ void SwUndoTableMerge::UndoImpl(::sw::UndoRedoContext & rContext) for (const auto& rBox : m_Boxes) { aIdx = rBox; - SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection( aIdx, + SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection( aIdx.GetNode(), SwTableBoxStartNode, pColl ); pBox = new SwTableBox( static_cast<SwTableBoxFormat*>(pCpyBox->GetFrameFormat()), *pSttNd, pCpyBox->GetUpper() ); diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index b779ec4e53ab..da067793a9cb 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -2559,7 +2559,7 @@ const SwStartNode *SwHTMLParser::InsertTableSection else pNd = pPrevStNd->EndOfSectionNode(); SwNodeIndex nIdx( *pNd, 1 ); - pStNd = m_xDoc->GetNodes().MakeTextSection( nIdx, SwTableBoxStartNode, + pStNd = m_xDoc->GetNodes().MakeTextSection( nIdx.GetNode(), SwTableBoxStartNode, pColl ); m_xTable->IncBoxCount(); } @@ -2626,8 +2626,7 @@ const SwStartNode *SwHTMLParser::InsertTableSection( sal_uInt16 nPoolId ) pOutTable = pOutTable->StartOfSectionNode()->FindTableNode(); } while( pOutTable && pTableNd->GetTable().GetHTMLTableLayout() ); } - SwNodeIndex aIdx( *pTableNd->EndOfSectionNode() ); - pStNd = m_xDoc->GetNodes().MakeTextSection( aIdx, SwTableBoxStartNode, + pStNd = m_xDoc->GetNodes().MakeTextSection( *pTableNd->EndOfSectionNode(), SwTableBoxStartNode, pColl ); m_pPam->GetPoint()->Assign( pStNd->GetIndex() + 1 ); @@ -2647,7 +2646,7 @@ SwStartNode *SwHTMLParser::InsertTempTableCaptionSection() SwTextFormatColl *pColl = m_pCSS1Parser->GetTextCollFromPool( RES_POOLCOLL_TEXT ); SwNodeIndex& rIdx = m_pPam->GetPoint()->nNode; rIdx = m_xDoc->GetNodes().GetEndOfExtras(); - SwStartNode *pStNd = m_xDoc->GetNodes().MakeTextSection( rIdx, + SwStartNode *pStNd = m_xDoc->GetNodes().MakeTextSection( rIdx.GetNode(), SwNormalStartNode, pColl ); rIdx = pStNd->GetIndex() + 1; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 8024ac6dea1d..03f3dfe4bec6 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5228,7 +5228,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD, false); SwStartNode *pNode = - m_rDoc.GetNodes().MakeTextSection(aIdx, + m_rDoc.GetNodes().MakeTextSection(aIdx.GetNode(), SwNormalStartNode,pColl); m_pPaM->GetPoint()->Assign( pNode->GetIndex()+1 ); aPlc.Get( nStart, nEnd, pDummy ); diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index bb05b1c14785..beb61656223e 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -2700,7 +2700,7 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( SwNodeIndex aIdx( *pEndNd, nOffset ); SwTextFormatColl *pColl = pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD, false ); - pStNd = pDoc->GetNodes().MakeTextSection( aIdx, SwTableBoxStartNode, + pStNd = pDoc->GetNodes().MakeTextSection( aIdx.GetNode(), SwTableBoxStartNode, pColl ); // Consider the case that a table is defined without a row. if( !pPrevSttNd && m_pBox1 != nullptr )