sw/source/core/access/accmap.cxx | 2 +- sw/source/core/doc/CntntIdxStore.cxx | 6 +++--- sw/source/core/doc/docedt.cxx | 10 +++++----- sw/source/core/doc/doclay.cxx | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-)
New commits: commit 5230836875cc193469ada218d7934ca8c6d5f45e Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sat Dec 31 17:11:17 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Dec 31 20:15:28 2022 +0000 use more GetAnchorContentOffset Change-Id: I0c5f1bbe04a1888bb20a0aaba207d3787bff250b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 2ada9c50b8c0..4f33788504cb 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1196,7 +1196,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() } if( pAnchorNode->GetTextNode() ) { - int nIndex = rAnchor.GetContentAnchor()->GetContentIndex(); + sal_Int32 nIndex = rAnchor.GetAnchorContentOffset(); bool bMarked = false; if( pCursor != nullptr ) { diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx index 451c8362521b..dd71aba69cc9 100644 --- a/sw/source/core/doc/CntntIdxStore.cxx +++ b/sw/source/core/doc/CntntIdxStore.cxx @@ -342,14 +342,14 @@ void ContentIdxStoreImpl::SaveFlys(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nC if ( RES_FLYFRMFMT == pFrameFormat->Which() || RES_DRAWFRMFMT == pFrameFormat->Which() ) { const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); - SwPosition const*const pAPos = rAnchor.GetContentAnchor(); - if ( pAPos && ( nNode == pAPos->GetNodeIndex() ) && + SwNode const*const pAnchorNode = rAnchor.GetAnchorNode(); + if ( pAnchorNode && ( nNode == pAnchorNode->GetIndex() ) && ( RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId() || RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() ) ) { bool bSkip = false; aSave.m_bOther = false; - aSave.m_nContent = pAPos->GetContentIndex(); + aSave.m_nContent = rAnchor.GetAnchorContentOffset(); if ( RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() ) { if( nContent <= aSave.m_nContent ) diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 3a085c1d060e..22b35fdf8e20 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -110,15 +110,15 @@ void SaveFlyInRange( const SwNodeRange& rRg, SaveFlyArr& rArr ) { SwFrameFormat *const pFormat = rFormats[n]; SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); - SwPosition const*const pAPos = pAnchor->GetContentAnchor(); - if (pAPos && + SwNode const*const pAnchorNode = pAnchor->GetAnchorNode(); + if (pAnchorNode && ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && - rRg.aStart <= pAPos->GetNode() && pAPos->GetNode() < rRg.aEnd.GetNode() ) + rRg.aStart <= *pAnchorNode && *pAnchorNode < rRg.aEnd.GetNode() ) { - SaveFly aSave( pAPos->GetNodeIndex() - rRg.aStart.GetIndex(), + SaveFly aSave( pAnchorNode->GetIndex() - rRg.aStart.GetIndex(), (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId()) - ? pAPos->GetContentIndex() + ? pAnchor->GetAnchorContentOffset() : 0, pFormat, false ); rArr.push_back( aSave ); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 457ff80b517b..94229dbc968f 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -475,7 +475,7 @@ static bool lcl_TstFlyRange( const SwPaM* pPam, const SwFormatAnchor& rFlyFormat (nPamEndIndex > nFlyIndex)); else { - const sal_Int32 nFlyContentIndex = rFlyFormatAnchor.GetContentAnchor()->GetContentIndex(); + const sal_Int32 nFlyContentIndex = rFlyFormatAnchor.GetAnchorContentOffset(); const sal_Int32 nPamEndContentIndex = pPaMEnd->GetContentIndex(); bOk = (nPamStartIndex < nFlyIndex && (( nPamEndIndex > nFlyIndex )|| @@ -787,7 +787,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable, { SwTextNode *pTextNode = rAnchor.GetAnchorNode()->GetTextNode(); OSL_ENSURE( pTextNode->HasHints(), "Missing FlyInCnt-Hint." ); - const sal_Int32 nIdx = rAnchor.GetContentAnchor()->GetContentIndex(); + const sal_Int32 nIdx = rAnchor.GetAnchorContentOffset(); SwTextAttr * const pHint = pTextNode->GetTextAttrForCharAt(nIdx, RES_TXTATR_FLYCNT); @@ -1105,7 +1105,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable { SwTextNode *pTextNode = rAnchor.GetAnchorNode()->GetTextNode(); OSL_ENSURE( pTextNode->HasHints(), "Missing FlyInCnt-Hint." ); - const sal_Int32 nIdx = rAnchor.GetContentAnchor()->GetContentIndex(); + const sal_Int32 nIdx = rAnchor.GetAnchorContentOffset(); SwTextAttr * const pHint = pTextNode->GetTextAttrForCharAt( nIdx, RES_TXTATR_FLYCNT );