diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-11-25 14:43:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-11-26 07:13:38 +0100 |
commit | 9a2d15d3358816043016af79588e0eb3bb2fa5ef (patch) | |
tree | 35c751597726097d767cbd6f5d8bf4a663148155 /sw/source/filter/html | |
parent | cb7153403a55a0e565584aedd8a4dc8da149b08c (diff) |
use more SwFormatAnchor::GetAnchorNode method
as a step towards switching away from using SwPosition inside
SwFormatAnchor (because SwFormatAnchor wants to do weird stuff with the
internals of SwPosition)
Change-Id: I1cdbe2fc6623d8fe2bb0c1bc629b570ca4d0cb0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143298
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/html')
-rw-r--r-- | sw/source/filter/html/htmlfly.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index 2c50a4de78bc..f76f1d536888 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -47,8 +47,8 @@ SwHTMLPosFlyFrame::SwHTMLPosFlyFrame( const SwPosFlyFrame& rPosFly, // Output of auto-bound frames will be a character farther back, // because then the position aligns with Netscape. - OSL_ENSURE( rAnchor.GetContentAnchor(), "No anchor position?" ); - if( !rAnchor.GetContentAnchor() ) + OSL_ENSURE( rAnchor.GetAnchorNode(), "No anchor position?" ); + if( !rAnchor.GetAnchorNode() ) return; m_nContentIndex = rAnchor.GetContentAnchor()->GetContentIndex(); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index f9f0e7f59bd7..6f9c71494461 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -3012,8 +3012,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); OSL_ENSURE( RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId(), "Only At-Para flys need special handling" ); - const SwPosition *pFlyPos = rAnchor.GetContentAnchor(); - SwNodeOffset nFlyParaIdx = pFlyPos->GetNodeIndex(); + SwNodeOffset nFlyParaIdx = rAnchor.GetAnchorNode()->GetIndex(); bool bMoveFly; if( bChkEnd ) { @@ -3031,7 +3030,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, if( bMoveFly ) { pFrameFormat->DelFrames(); - *aAttrPam.GetPoint() = *pFlyPos; + *aAttrPam.GetPoint() = *rAnchor.GetContentAnchor(); aAttrPam.GetPoint()->SetContent( m_aMoveFlyCnts[n] ); SwFormatAnchor aAnchor( rAnchor ); aAnchor.SetType( RndStdIds::FLY_AT_CHAR ); @@ -4561,11 +4560,11 @@ bool SwHTMLParser::HasCurrentParaFlys( bool bNoSurroundOnly, // - every paragraph-bound frame counts, or // - (only frames without wrapping count and) the frame doesn't have // a wrapping - 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())) && - pAPos->GetNode() == rNode ) + *pAnchorNode == rNode ) { if( !(bNoSurroundOnly || bSurroundOnly) ) { |