sw/source/core/frmedt/fecopy.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
New commits: commit 0f455bf096c922b8dd07b045258c490bae93ab1e Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Sep 29 11:08:31 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Sep 29 13:09:17 2022 +0200 use more SwPosition::SetContent part of the process of hiding the internals of SwPosition Change-Id: I58aef1248e52bd36239dad4029d127e58179e637 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140722 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index d45a2d2eb8ec..ab7ccfe6c9eb 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -136,7 +136,7 @@ void SwFEShell::Copy( SwDoc& rClpDoc, const OUString* pNewClpText ) SwPosition aPos( aSttIdx ); if ( RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId() ) { - aPos.nContent.Assign( pTextNd, 0 ); + aPos.SetContent( 0 ); } aAnchor.SetAnchor( &aPos ); } @@ -160,14 +160,14 @@ void SwFEShell::Copy( SwDoc& rClpDoc, const OUString* pNewClpText ) // clipboard, it should be found at pasting. Therefore // the copied TextAttribut should be removed in the node // otherwise it will be recognised as TextSelektion - const SwContentIndex& rIdx = pFlyFormat->GetAnchor().GetContentAnchor()->nContent; + const SwPosition& rPos = *pFlyFormat->GetAnchor().GetContentAnchor(); SwTextFlyCnt *const pTextFly = static_cast<SwTextFlyCnt *>( pTextNd->GetTextAttrForCharAt( - rIdx.GetIndex(), RES_TXTATR_FLYCNT)); + rPos.GetContentIndex(), RES_TXTATR_FLYCNT)); if( pTextFly ) { const_cast<SwFormatFlyCnt&>(pTextFly->GetFlyCnt()).SetFlyFormat(); - pTextNd->EraseText( rIdx, 1 ); + pTextNd->EraseText( rPos, 1 ); } } } @@ -918,10 +918,10 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable) // If there are no more paragraphs e.g. at the end of a document, // we insert complete paragraphs instead of text portions if( bCompletePara ) - aInsertion.first->GetPoint()->nNode = aIdx; + aInsertion.first->GetPoint()->Assign(aIdx); else - aInsertion.first->GetPoint()->nContent = - aInsertion.first->GetPointContentNode()->Len(); + aInsertion.first->GetPoint()->SetContent( + aInsertion.first->GetPointContentNode()->Len() ); aCopyVector.push_back( aInsertion ); } // If there are no text portions left but there are some more @@ -952,7 +952,7 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable) { ++aIndexBefore; SwPaM aPaM(SwPosition(aIndexBefore), - SwPosition(rInsPos.nNode)); + SwPosition(rInsPos.GetNode())); aPaM.GetDoc().MakeUniqueNumRules(aPaM); } } @@ -1093,7 +1093,7 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable) // Note: aCpyPam is invalid now ++aIndexBefore; - SwPaM aPaM(aIndexBefore, rInsPos.nNode); + SwPaM aPaM(aIndexBefore.GetNode(), rInsPos.GetNode()); aPaM.GetDoc().MakeUniqueNumRules(aPaM);