sw/source/core/unocore/unoportenum.cxx | 10 +++++----- sw/source/core/unocore/unoredline.cxx | 4 ++-- sw/source/core/unocore/unotbl.cxx | 12 ++++++------ sw/source/core/unocore/unotext.cxx | 12 ++++++------ 4 files changed, 19 insertions(+), 19 deletions(-)
New commits: commit 851739459484a710ec1599a3bafef35689c0bcde Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Aug 26 11:26:17 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Aug 26 15:21:28 2022 +0200 use more SwPosition::Assign as part of the process of hiding the internals of SwPosition Change-Id: Ic458f63b8914993055c19ece159ad525a8ed9bb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138869 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index a74d95437c65..be697524c11c 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -159,8 +159,8 @@ namespace else if (pCrossRefMark) { // Crossrefbookmarks only remember the start position but have to span the whole paragraph - oCrossRefEndPos.emplace(rEndPos); - oCrossRefEndPos->nContent = oCrossRefEndPos->GetNode().GetTextNode()->Len(); + SwTextNode& rEndNd = *rEndPos.GetNode().GetTextNode(); + oCrossRefEndPos.emplace(rEndNd, rEndNd.Len()); pEndPos = &*oCrossRefEndPos; } if(pEndPos) @@ -242,8 +242,8 @@ namespace } // no need to consider annotation marks starting after aEndOfPara - SwPosition aEndOfPara(*rUnoCursor.GetPoint()); - aEndOfPara.nContent = aEndOfPara.GetNode().GetTextNode()->Len(); + SwContentNode& rPtNd = *rUnoCursor.GetPoint()->GetNode().GetContentNode(); + SwPosition aEndOfPara( rPtNd, rPtNd.Len() ); const IDocumentMarkAccess::const_iterator_t pCandidatesEnd = pMarkAccess->findFirstAnnotationStartsAfter(aEndOfPara); @@ -1099,7 +1099,7 @@ static void lcl_MoveCursor( SwUnoCursor * const pUnoCursor, if (nMovePos > nCurrentIndex) { - pUnoCursor->GetPoint()->nContent = nMovePos; + pUnoCursor->GetPoint()->SetContent( nMovePos ); } } diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index 17ecf3c06a6f..adc61e5700ce 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -109,7 +109,7 @@ uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor() bool bTable = pTableNode != nullptr; while( pTableNode != nullptr ) { - rUnoCursor.GetPoint()->nNode = *(pTableNode->EndOfSectionNode()); + rUnoCursor.GetPoint()->Assign( *pTableNode->EndOfSectionNode() ); SwContentNode* pContentNode = GetDoc()->GetNodes().GoNext(rUnoCursor.GetPoint()); pTableNode = pContentNode->FindTableNode(); } @@ -542,7 +542,7 @@ uno::Reference< text::XTextCursor > SwXRedline::createTextCursor() SwTableNode* pTableNode = rUnoCursor.GetPointNode().FindTableNode(); while( pTableNode ) { - rUnoCursor.GetPoint()->nNode = *pTableNode->EndOfSectionNode(); + rUnoCursor.GetPoint()->Assign( *pTableNode->EndOfSectionNode() ); SwContentNode* pCont = GetDoc()->GetNodes().GoNext(rUnoCursor.GetPoint()); pTableNode = pCont->FindTableNode(); } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 668c52065892..8f4094c7afce 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -2210,7 +2210,7 @@ uno::Reference<table::XCellRange> GetRangeByName( if(!pBRBox) return nullptr; pUnoCursor->SetMark(); - pUnoCursor->GetPoint()->nNode = *pBRBox->GetSttNd(); + pUnoCursor->GetPoint()->Assign( *pBRBox->GetSttNd() ); pUnoCursor->Move( fnMoveForward, GoInNode ); SwUnoTableCursor& rCursor = dynamic_cast<SwUnoTableCursor&>(*pUnoCursor); // HACK: remove pending actions for selecting old style tables @@ -2577,7 +2577,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An const SwTableBox* pBRBox = lcl_FindCornerTableBox(rLines, false); pUnoCursor->SetMark(); - pUnoCursor->GetPoint()->nNode = *pBRBox->GetSttNd(); + pUnoCursor->GetPoint()->Assign( *pBRBox->GetSttNd() ); pUnoCursor->Move( fnMoveForward, GoInNode ); SwUnoTableCursor& rCursor = dynamic_cast<SwUnoTableCursor&>(*pUnoCursor); // HACK: remove pending actions for selecting old style tables @@ -2775,7 +2775,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) const SwTableBox* pBRBox = lcl_FindCornerTableBox(rLines, false); pUnoCursor->SetMark(); const SwStartNode* pLastNd = pBRBox->GetSttNd(); - pUnoCursor->GetPoint()->nNode = *pLastNd; + pUnoCursor->GetPoint()->Assign( *pLastNd ); pUnoCursor->Move( fnMoveForward, GoInNode ); SwUnoTableCursor& rCursor = dynamic_cast<SwUnoTableCursor&>(*pUnoCursor); @@ -3286,7 +3286,7 @@ SwXCellRange::getCellRangeByPosition( if(pBRBox) { pUnoCursor->SetMark(); - pUnoCursor->GetPoint()->nNode = *pBRBox->GetSttNd(); + pUnoCursor->GetPoint()->Assign( *pBRBox->GetSttNd() ); pUnoCursor->Move( fnMoveForward, GoInNode ); SwUnoTableCursor& rCursor = dynamic_cast<SwUnoTableCursor&>(*pUnoCursor); // HACK: remove pending actions for selecting old style tables @@ -3980,7 +3980,7 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) if(!pBLBox) throw uno::RuntimeException("Illegal arguments", static_cast<cppu::OWeakObject*>(this)); pUnoCursor->SetMark(); - pUnoCursor->GetPoint()->nNode = *pBLBox->GetSttNd(); + pUnoCursor->GetPoint()->Assign( *pBLBox->GetSttNd() ); pUnoCursor->Move(fnMoveForward, GoInNode); SwUnoTableCursor& rCursor = dynamic_cast<SwUnoTableCursor&>(*pUnoCursor); { @@ -4137,7 +4137,7 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) if(!pTRBox) throw uno::RuntimeException("Cell not found", static_cast<cppu::OWeakObject*>(this)); pUnoCursor->SetMark(); - pUnoCursor->GetPoint()->nNode = *pTRBox->GetSttNd(); + pUnoCursor->GetPoint()->Assign( *pTRBox->GetSttNd() ); pUnoCursor->Move(fnMoveForward, GoInNode); SwUnoTableCursor& rCursor = dynamic_cast<SwUnoTableCursor&>(*pUnoCursor); { diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 21980c053fff..bb024135a09d 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1843,7 +1843,7 @@ SwXText::convertToTextFrame( // In case the frame has a table only, the cursor points to the end of the first cell of the table. SwPaM aPaM(*pFrameCursor->GetPaM()->GetPointNode().FindSttNodeByType(SwFlyStartNode)->EndOfSectionNode()); // Now we have the end of the frame -- the node before that will be the paragraph we want to remove. - --aPaM.GetPoint()->nNode; + aPaM.GetPoint()->Adjust(SwNodeOffset(-1)); m_pImpl->m_pDoc->getIDocumentContentOperations().DelFullPara(aPaM); } } @@ -2042,11 +2042,11 @@ void SwXText::Impl::ConvertCell( // aEndCellPam has to point to the end of the new (previous) node aStartCellPam.DeleteMark(); aStartCellPam.Move(fnMoveBackward, GoInNode); - aStartCellPam.GetPoint()->nContent = 0; + aStartCellPam.GetPoint()->SetContent(0); aEndCellPam.DeleteMark(); aEndCellPam.Move(fnMoveBackward, GoInNode); - aEndCellPam.GetPoint()->nContent = - aEndCellPam.GetPointNode().GetTextNode()->Len(); + aEndCellPam.GetPoint()->SetContent( + aEndCellPam.GetPointNode().GetTextNode()->Len() ); } assert(aStartCellPam.Start()->GetContentIndex() == 0); @@ -2506,7 +2506,7 @@ rtl::Reference<SwXTextCursor> SwXBodyText::CreateTextCursor(const bool bIgnoreTa SwTableNode * pTableNode = aPam.GetPointNode().FindTableNode(); while (pTableNode) { - aPam.GetPoint()->nNode = *pTableNode->EndOfSectionNode(); + aPam.GetPoint()->Assign( *pTableNode->EndOfSectionNode() ); SwContentNode* pCont = GetDoc()->GetNodes().GoNext(aPam.GetPoint()); pTableNode = pCont->FindTableNode(); } @@ -2761,7 +2761,7 @@ uno::Reference<text::XTextCursor> SwXHeadFootText::CreateTextCursor(const bool b SwTableNode* pTableNode = rUnoCursor.GetPointNode().FindTableNode(); while (pTableNode) { - rUnoCursor.GetPoint()->nNode = *pTableNode->EndOfSectionNode(); + rUnoCursor.GetPoint()->Assign(*pTableNode->EndOfSectionNode()); SwContentNode* pCont = GetDoc()->GetNodes().GoNext(rUnoCursor.GetPoint()); pTableNode = pCont->FindTableNode(); }