sw/source/filter/html/htmlctxt.cxx | 2 +- sw/source/filter/html/swhtml.cxx | 16 ++++++++-------- sw/source/filter/html/swhtml.hxx | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-)
New commits: commit b930f5f668fd8d9aa759d5a4d38da20a140328a4 Author: Noel Grandin <[email protected]> AuthorDate: Sat Aug 20 09:29:48 2022 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sat Aug 20 12:51:33 2022 +0200 SwNodeIndex->SwNode in HTMLAttr Change-Id: Ic8935b1f7f2e4620173be23ccbb76295c0aed3c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138572 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index a7b775c1dc86..b4f7389b4044 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -226,7 +226,7 @@ void SwHTMLParser::SplitAttrTab( const SwPosition& rNewPos ) // The attribute needs to be set. Because we still need the original, since // pointers to the attribute still exists in the contexts, we need to clone it. // The next-list gets lost but the previous-list is preserved - HTMLAttr *pSetAttr = pAttr->Clone( *pOldEndPara, nOldEndCnt ); + HTMLAttr *pSetAttr = pAttr->Clone( pOldEndPara->GetNode(), nOldEndCnt ); if( pNext ) pNext->InsertPrev( pSetAttr ); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 0d02435812ca..0b14b44e128d 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2285,7 +2285,7 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum ) if( nScriptItem == nScriptText ) { HTMLAttr *pSetAttr = - pAttr->Clone( rEndIdx, nScriptEnd ); + pAttr->Clone( rEndIdx.GetNode(), nScriptEnd ); pSetAttr->m_nStartContent = nStt; pSetAttr->ClearPrev(); if( !pNext || bWholePara ) @@ -2310,7 +2310,7 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum ) if( bInsert ) { HTMLAttr *pSetAttr = - pAttr->Clone( rEndIdx, nEndCnt ); + pAttr->Clone( rEndIdx.GetNode(), nEndCnt ); pSetAttr->m_nStartContent = nStt; // When the attribute is for the whole paragraph, the outer @@ -3175,7 +3175,7 @@ bool SwHTMLParser::EndAttr( HTMLAttr* pAttr, bool bChkEmpty ) { if( nScriptItem == nScriptText ) { - HTMLAttr *pSetAttr = pAttr->Clone( *pEndIdx, nScriptEnd ); + HTMLAttr *pSetAttr = pAttr->Clone( pEndIdx->GetNode(), nScriptEnd ); pSetAttr->ClearPrev(); if( pNext ) pNext->InsertPrev( pSetAttr ); @@ -3396,7 +3396,7 @@ void SwHTMLParser::SplitAttrTab( std::shared_ptr<HTMLAttrTable> const & rNewAttr // original and therefore we clone it, because pointer to the // attribute exist in the other contexts. The Next-List is lost // in doing so, but the Previous-List is preserved. - HTMLAttr *pSetAttr = pAttr->Clone( nEndIdx, nEndCnt ); + HTMLAttr *pSetAttr = pAttr->Clone( nEndIdx.GetNode(), nEndCnt ); if( pNext ) pNext->InsertPrev( pSetAttr ); @@ -3424,7 +3424,7 @@ void SwHTMLParser::SplitAttrTab( std::shared_ptr<HTMLAttrTable> const & rNewAttr } // set the start of the attribute anew and break link - pAttr->Reset(nSttIdx, nSttCnt, pSaveAttributes, rNewAttrTab); + pAttr->Reset(nSttIdx.GetNode(), nSttCnt, pSaveAttributes, rNewAttrTab); if (*pSaveAttributes) { @@ -5458,7 +5458,7 @@ HTMLAttr::HTMLAttr( const SwPosition& rPos, const SfxPoolItem& rItem, { } -HTMLAttr::HTMLAttr( const HTMLAttr &rAttr, const SwNodeIndex &rEndPara, +HTMLAttr::HTMLAttr( const HTMLAttr &rAttr, const SwNode &rEndPara, sal_Int32 nEndCnt, HTMLAttr **ppHd, std::shared_ptr<HTMLAttrTable> xAttrTab ) : m_nStartPara( rAttr.m_nStartPara ), m_nEndPara( rEndPara ), @@ -5479,7 +5479,7 @@ HTMLAttr::~HTMLAttr() { } -HTMLAttr *HTMLAttr::Clone(const SwNodeIndex& rEndPara, sal_Int32 nEndCnt) const +HTMLAttr *HTMLAttr::Clone(const SwNode& rEndPara, sal_Int32 nEndCnt) const { // create the attribute anew with old start position HTMLAttr *pNew = new HTMLAttr( *this, rEndPara, nEndCnt, m_ppHead, m_xAttrTab ); @@ -5490,7 +5490,7 @@ HTMLAttr *HTMLAttr::Clone(const SwNodeIndex& rEndPara, sal_Int32 nEndCnt) const return pNew; } -void HTMLAttr::Reset(const SwNodeIndex& rSttPara, sal_Int32 nSttCnt, +void HTMLAttr::Reset(const SwNode& rSttPara, sal_Int32 nSttCnt, HTMLAttr **ppHd, const std::shared_ptr<HTMLAttrTable>& rAttrTab) { // reset the start (and the end) diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index da215233e2af..caecde9cedac 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -146,15 +146,15 @@ class HTMLAttr HTMLAttr( const SwPosition& rPos, const SfxPoolItem& rItem, HTMLAttr **pHd, std::shared_ptr<HTMLAttrTable> xAttrTab ); - HTMLAttr( const HTMLAttr &rAttr, const SwNodeIndex &rEndPara, + HTMLAttr( const HTMLAttr &rAttr, const SwNode &rEndPara, sal_Int32 nEndCnt, HTMLAttr **pHd, std::shared_ptr<HTMLAttrTable> xAttrTab ); public: ~HTMLAttr(); - HTMLAttr *Clone( const SwNodeIndex& rEndPara, sal_Int32 nEndCnt ) const; - void Reset( const SwNodeIndex& rSttPara, sal_Int32 nSttCnt, + HTMLAttr *Clone( const SwNode& rEndPara, sal_Int32 nEndCnt ) const; + void Reset( const SwNode& rSttPara, sal_Int32 nSttCnt, HTMLAttr **pHd, const std::shared_ptr<HTMLAttrTable>& rAttrTab ); inline void SetStart( const SwPosition& rPos );
