sw/source/core/unocore/unodraw.cxx | 2 +- sw/source/core/unocore/unofield.cxx | 3 +-- sw/source/core/unocore/unoframe.cxx | 4 ++-- sw/source/core/unocore/unoidx.cxx | 14 +++++++------- 4 files changed, 11 insertions(+), 12 deletions(-)
New commits: commit fdc5ac4b0e4e1a964c259a5f5056041346dbf3cf Author: Noel Grandin <[email protected]> AuthorDate: Fri Aug 26 10:44:27 2022 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Aug 26 15:27:51 2022 +0200 use more SwPosition::Assign as part of the process of hiding the internals of SwPosition Change-Id: I5ff23a9aa7c40d10a719d3f38af5c4c3f39ca2af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138870 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 0cf271b70b0f..8dccfbe08c1b 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1346,7 +1346,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SwFormatFlyCnt aFormat( pFlyFormat ); pNd->InsertItem(aFormat, aPam.GetPoint()->GetContentIndex(), 0 ); - --aPam.GetPoint()->nContent; // InsertItem moved it + aPam.GetPoint()->AdjustContent(-1); // InsertItem moved it SwFormatAnchor aNewAnchor( dynamic_cast<const SwFormatAnchor&>( aSet.Get(RES_ANCHOR))); diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 89294319b0ee..7849c96229cc 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2178,8 +2178,7 @@ SwXTextField::setPropertyValue( const SwTextField* pTextField = m_pImpl->GetFormatField()->GetTextField(); if(!pTextField) throw uno::RuntimeException(); - SwPosition aPosition( pTextField->GetTextNode() ); - aPosition.nContent = pTextField->GetStart(); + SwPosition aPosition( pTextField->GetTextNode(), pTextField->GetStart() ); pDoc->getIDocumentFieldsAccess().PutValueToField( aPosition, rValue, pEntry->nWID); } diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 6a1460beca63..1be52ee6113a 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1880,7 +1880,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& else { SwPosition aPos = *pPosition; - aPos.nNode = *pFlyFormat->GetContent().GetContentIdx(); + aPos.Assign( *pFlyFormat->GetContent().GetContentIdx() ); aAnchor.SetAnchor(&aPos); aSet.Put(aAnchor); } @@ -3301,7 +3301,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor() 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(); } diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 0d1fb2ff7f1e..d321dc06729a 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1355,7 +1355,7 @@ SwXDocumentIndex::getAnchor() SwPaM aPaM(*pIdx); aPaM.Move( fnMoveForward, GoInContent ); aPaM.SetMark(); - aPaM.GetPoint()->nNode = *pIdx->GetNode().EndOfSectionNode(); + aPaM.GetPoint()->Assign( *pIdx->GetNode().EndOfSectionNode() ); aPaM.Move( fnMoveBackward, GoInContent ); xRet = SwXTextRange::CreateXTextRange(*pSectionFormat->GetDoc(), *aPaM.GetMark(), aPaM.GetPoint()); @@ -1729,10 +1729,10 @@ SwXDocumentIndexMark::setMarkEntry(const OUString& rIndexEntry) aPam.SetMark(); if(pTextMark->End()) { - aPam.GetPoint()->nContent = *pTextMark->End(); + aPam.GetPoint()->SetContent( *pTextMark->End() ); } else - ++aPam.GetPoint()->nContent; + aPam.GetPoint()->AdjustContent(1); m_pImpl->ReplaceTOXMark(*pType, aMark, aPam); } @@ -1954,11 +1954,11 @@ SwXDocumentIndexMark::getAnchor() aPam.SetMark(); if(pTextMark->End()) { - aPam.GetPoint()->nContent = *pTextMark->End(); + aPam.GetPoint()->SetContent( *pTextMark->End() ); } else { - ++aPam.GetPoint()->nContent; + aPam.GetPoint()->AdjustContent(1); } const uno::Reference< frame::XModel > xModel = m_pImpl->m_pDoc->GetDocShell()->GetBaseModel(); @@ -2090,11 +2090,11 @@ SwXDocumentIndexMark::setPropertyValue( aPam.SetMark(); if(pTextMark->End()) { - aPam.GetPoint()->nContent = *pTextMark->End(); + aPam.GetPoint()->SetContent(*pTextMark->End()); } else { - ++aPam.GetPoint()->nContent; + aPam.GetPoint()->AdjustContent(1); } m_pImpl->ReplaceTOXMark(*pType, aMark, aPam);
