summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docfly.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-11-28 14:51:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-11-29 06:00:30 +0100
commit2be29ee28d06110961775fe05253a949611deed6 (patch)
tree74fec05d340f217da333b92ec0047eda140861fa /sw/source/core/doc/docfly.cxx
parentb487550e829dee77de6fc202848e6de88e583e6c (diff)
use more SwFormatAnchor::GetAnchorContentOffset
Change-Id: I44406ddeb765088d86c0484f7097b80f362fd4a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143394 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/doc/docfly.cxx')
-rw-r--r--sw/source/core/doc/docfly.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 8a408affd030..7bf5c31681ac 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -307,7 +307,7 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo
SwNode *pAnchorNode = rOldAnch.GetAnchorNode();
SwTextNode *pTextNode = pAnchorNode->GetTextNode();
OSL_ENSURE( pTextNode->HasHints(), "Missing FlyInCnt-Hint." );
- const sal_Int32 nIdx = rOldAnch.GetContentAnchor()->GetContentIndex();
+ const sal_Int32 nIdx = rOldAnch.GetAnchorContentOffset();
SwTextAttr * const pHint =
pTextNode->GetTextAttrForCharAt( nIdx, RES_TXTATR_FLYCNT );
OSL_ENSURE( pHint && pHint->Which() == RES_TXTATR_FLYCNT,
@@ -332,12 +332,12 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo
// If no position attributes are received, we have to make sure
// that no forbidden automatic alignment is left.
{
- const SwPosition *pPos = aNewAnch.GetContentAnchor();
- SwTextNode *pNd = pPos->GetNode().GetTextNode();
+ SwNode *pAnchorNode = aNewAnch.GetAnchorNode();
+ SwTextNode *pNd = pAnchorNode->GetTextNode();
OSL_ENSURE( pNd, "Cursor does not point to TextNode." );
SwFormatFlyCnt aFormat( static_cast<SwFlyFrameFormat*>(&rFormat) );
- pNd->InsertItem( aFormat, pPos->GetContentIndex(), 0 );
+ pNd->InsertItem( aFormat, aNewAnch.GetAnchorContentOffset(), 0 );
}
if( SfxItemState::SET != rSet.GetItemState( RES_VERT_ORIENT, false ))
@@ -766,7 +766,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
// anchored object the complete <SwPosition> is kept, because the
// anchor index position could be moved, if the object again is
// anchored as character.
- std::optional<const SwPosition> oOldAsCharAnchorPos;
+ std::optional<SwPosition> oOldAsCharAnchorPos;
const RndStdIds eOldAnchorType = pContact->GetAnchorId();
if ( !_bSameOnly && eOldAnchorType == RndStdIds::FLY_AS_CHAR )
{