diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-10-08 20:22:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-09 09:22:26 +0200 |
commit | f17bd77105da8995df7a79c8978556a8848edf99 (patch) | |
tree | aa23baaee4b9e80569f35b610c6123e1f93a2229 | |
parent | d72571fdd47c627efcd0dff92fbe8a9747f92932 (diff) |
use more SwPosition::GetNode
part of the process of hiding the internals of SwPosition
Change-Id: Ia080b5bf4ca622e3bf0279ba41d8ccdd11e0be8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141123
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/core/doc/DocumentLinksAdministrationManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/frmform.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/undel.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/undo/undobj.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/writer/writer.cxx | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx index 0dd65076f71c..59d8217de813 100644 --- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx +++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx @@ -515,7 +515,7 @@ bool DocumentLinksAdministrationManager::SelectServerObj( std::u16string_view rS const SwOutlineNodes& rOutlNds = m_rDoc.GetNodes().GetOutLineNds(); SwOutlineNodes::size_type nTmpPos; (void)rOutlNds.Seek_Entry( pNd, &nTmpPos ); - roRange.emplace( aPos.nNode, SwNodeOffset(0), aPos.nNode ); + roRange.emplace( aPos.GetNode(), SwNodeOffset(0), aPos.GetNode() ); // look for the section's end, now for( ++nTmpPos; diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 825468be250c..19dcb6e3ed5f 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -354,7 +354,7 @@ void SwTextFrame::MakePos() pRedln->MaybeNotifyRedlinePositionModification(getFrameArea().Top()); if (GetMergedPara() && pRedln->GetType() == RedlineType::Delete - && pRedln->GetPoint()->nNode != pRedln->GetMark()->nNode) + && pRedln->GetPoint()->GetNode() != pRedln->GetMark()->GetNode()) { pTextNode = pRedln->End()->GetNode().GetTextNode(); } diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index e7d6176f193c..42de132107c0 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -533,7 +533,7 @@ bool SwUndoDelete::CanGrouping( SwDoc& rDoc, const SwPaM& rDelPam ) if( pStt->GetNode() != pEnd->GetNode() || pStt->GetContentIndex()+1 != pEnd->GetContentIndex() || - pEnd->nNode != m_nSttNode ) + pEnd->GetNodeIndex() != m_nSttNode ) return false; // Distinguish between BackSpace and Delete because the Undo array needs to @@ -991,7 +991,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) nMoveIndex = aPos.GetNodeIndex() + m_nReplaceDummy + 1; } SwNodeIndex aMvIdx(rDoc.GetNodes(), nMoveIndex); - SwNodeRange aRg( aPos.nNode, SwNodeOffset(0), aPos.nNode, SwNodeOffset(1) ); + SwNodeRange aRg( aPos.GetNode(), SwNodeOffset(0), aPos.GetNode(), SwNodeOffset(1) ); pMovedNode = &aPos.GetNode(); // tdf#131684 without deleting frames rDoc.GetNodes().MoveNodes(aRg, rDoc.GetNodes(), aMvIdx.GetNode(), false); diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index a3ca96359c87..b9c73ae237ee 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -1011,7 +1011,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, { m_pHistory->AddChangeFlyAnchor(*pFormat); SwFormatAnchor aAnch( *pAnchor ); - SwPosition aPos( rMark.nNode ); + SwPosition aPos( rMark.GetNode() ); aAnch.SetAnchor( &aPos ); pFormat->SetFormatAttr( aAnch ); } @@ -1149,7 +1149,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, { // certain special handling for cross-reference bookmarks const bool bDifferentTextNodesAtMarkAndPoint = - rMark.nNode != rPoint.nNode + rMark.GetNode() != rPoint.GetNode() && rMark.GetNode().GetTextNode() && rPoint.GetNode().GetTextNode(); if ( bDifferentTextNodesAtMarkAndPoint ) @@ -1559,7 +1559,7 @@ static bool IsAtEndOfSection(SwPosition const& rAnchorPos) SwContentNode *const pNode(SwNodes::GoPrevious(&node)); assert(pNode); assert(rAnchorPos.GetNode() <= node.GetNode()); // last valid anchor pos is last content - return node == rAnchorPos.nNode + return node == rAnchorPos.GetNode() // at-para fly has no SwContentIndex! && (rAnchorPos.GetContentIndex() == pNode->Len() || rAnchorPos.GetContentNode() == nullptr); } @@ -1572,7 +1572,7 @@ static bool IsAtStartOfSection(SwPosition const& rAnchorPos) assert(pNode); (void) pNode; assert(node <= rAnchorPos.GetNode()); - return node == rAnchorPos.nNode && rAnchorPos.GetContentIndex() == 0; + return node == rAnchorPos.GetNode() && rAnchorPos.GetContentIndex() == 0; } /// passed start / end position could be on section start / end node @@ -1631,14 +1631,14 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos, return ((rStart < rAnchorPos) || (rStart == rAnchorPos // special case: fully deleted node - && ((rStart.nNode != rEnd.nNode && rStart.GetContentIndex() == 0 + && ((rStart.GetNode() != rEnd.GetNode() && rStart.GetContentIndex() == 0 // but not if the selection is backspace/delete! && IsNotBackspaceHeuristic(rStart, rEnd)) || (IsAtStartOfSection(rAnchorPos) && IsAtEndOfSection2(rEnd))))) && ((rAnchorPos < rEnd) || (rAnchorPos == rEnd // special case: fully deleted node - && ((rEnd.nNode != rStart.nNode && rEnd.GetContentIndex() == rEnd.GetNode().GetTextNode()->Len() + && ((rEnd.GetNode() != rStart.GetNode() && rEnd.GetContentIndex() == rEnd.GetNode().GetTextNode()->Len() && IsNotBackspaceHeuristic(rStart, rEnd)) || (IsAtEndOfSection(rAnchorPos) && IsAtStartOfSection2(rStart))))); } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 0f36092d080f..d7df162d6ab8 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -5445,8 +5445,8 @@ void SwHTMLParser::ParseMoreMetaOptions() HTMLAttr::HTMLAttr( const SwPosition& rPos, const SfxPoolItem& rItem, HTMLAttr **ppHd, std::shared_ptr<HTMLAttrTable> xAttrTab ) : - m_nStartPara( rPos.nNode ), - m_nEndPara( rPos.nNode ), + m_nStartPara( rPos.GetNode() ), + m_nEndPara( rPos.GetNode() ), m_nStartContent( rPos.GetContentIndex() ), m_nEndContent(rPos.GetContentIndex() ), m_bInsAtStart( true ), diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index a4bf93f2f36d..9123d4e2b6e4 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -971,7 +971,7 @@ struct SwPending inline void HTMLAttr::SetStart( const SwPosition& rPos ) { - m_nStartPara = rPos.nNode; + m_nStartPara = rPos.GetNode(); m_nStartContent = rPos.GetContentIndex(); m_nEndPara = m_nStartPara; m_nEndContent = m_nStartContent; diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index 04b46d1261b4..42fb87a592e2 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -94,7 +94,7 @@ void Writer_Impl::InsertBkmk(const ::sw::mark::IMark& rBkmk) aBkmkNodePos.emplace( nNd, &rBkmk ); - if(rBkmk.IsExpanded() && rBkmk.GetOtherMarkPos().nNode != nNd) + if(rBkmk.IsExpanded() && rBkmk.GetOtherMarkPos().GetNodeIndex() != nNd) { nNd = rBkmk.GetOtherMarkPos().GetNodeIndex(); aBkmkNodePos.emplace( nNd, &rBkmk ); |