sw/source/filter/html/htmlsect.cxx | 2 +- sw/source/filter/html/htmltab.cxx | 32 +------------------------------- sw/source/filter/html/swhtml.hxx | 2 +- 3 files changed, 3 insertions(+), 33 deletions(-)
New commits: commit 8423861a74d7c6425ed2c3699806dd97415a04e1 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Nov 1 19:41:58 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Nov 2 18:26:37 2021 +0100 drop PendingDrawObjectsInPaM in favor of detecting draw objects removal Change-Id: I9f24f16ae47c8c178259650944bd80e19d6a887d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124568 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 9b212c0c5f4b..928e9bfe158d 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -207,7 +207,7 @@ void SwHTMLParser::NewDivision( HtmlTokenId nToken ) static_cast<const SwStartNode *>( &rContentStIdx.GetNode() ); aDelPam.GetPoint()->nNode = pStNd->EndOfSectionIndex() - 1; - if (!PendingObjectsInPaM(aDelPam)) + if (!PendingTableInPaM(aDelPam)) { m_xDoc->getIDocumentContentOperations().DeleteRange(aDelPam); m_xDoc->getIDocumentContentOperations().DelFullPara(aDelPam); diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 7407988ce640..ffb9c173027f 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -634,8 +634,6 @@ public: void IncBoxCount() { m_nBoxes++; } bool IsOverflowing() const { return m_nBoxes > 64000; } - - bool PendingDrawObjectsInPaM(SwPaM& rPam) const; }; void HTMLTableCnts::InitCtor() @@ -5256,39 +5254,11 @@ std::shared_ptr<HTMLTable> SwHTMLParser::BuildTable(SvxAdjust eParentAdjust, return xRetTable; } -bool HTMLTable::PendingDrawObjectsInPaM(SwPaM& rPam) const -{ - if (!m_xResizeDrawObjects) - return false; - - bool bRet = false; - - sal_uInt16 nCount = m_xResizeDrawObjects->size(); - for (sal_uInt16 i = 0; i < nCount && !bRet; ++i) - { - SdrObject *pObj = (*m_xResizeDrawObjects)[i]; - SwFrameFormat* pObjectFormat = ::FindFrameFormat(pObj); - if (!pObjectFormat) - continue; - const SwFormatAnchor& rAnch = pObjectFormat->GetAnchor(); - if (const SwPosition* pPos = rAnch.GetContentAnchor()) - { - SwNodeIndex aObjNodeIndex(pPos->nNode); - bRet = (aObjNodeIndex >= rPam.Start()->nNode && aObjNodeIndex <= rPam.End()->nNode); - } - } - - return bRet; -} - -bool SwHTMLParser::PendingObjectsInPaM(SwPaM& rPam) const +bool SwHTMLParser::PendingTableInPaM(SwPaM& rPam) const { bool bRet = false; for (const auto& a : m_aTables) { - bRet = a->PendingDrawObjectsInPaM(rPam); - if (bRet) - break; const SwTable *pTable = a->GetSwTable(); if (!pTable) continue; diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 023a796b5f5c..a0b714307974 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -874,7 +874,7 @@ private: bool HasCurrentParaFlys( bool bNoSurroundOnly = false, bool bSurroundOnly = false ) const; - bool PendingObjectsInPaM(SwPaM& rPam) const; + bool PendingTableInPaM(SwPaM& rPam) const; class TableDepthGuard {