writerfilter/source/dmapper/DomainMapper.cxx | 20 --------------- writerfilter/source/dmapper/DomainMapperTableManager.cxx | 3 -- writerfilter/source/dmapper/DomainMapperTableManager.hxx | 5 --- 3 files changed, 28 deletions(-)
New commits: commit 6c67853b0798cf20fef02fcffd383e7f95cb66bd Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Tue Jun 6 08:22:53 2023 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Jun 7 22:59:02 2023 +0200 sw floattable, DOCX import: clean up not needed dmapper-level anchor insert This was added in commit 1c99616f86f7d5b83b91edc225fc95fec227d710 (sw floattable, crashtesting: fix PDF export of forum-mso-en3-26783.docx, 2023-05-02) to ensure that in case a floating table is not followed by a text node, then inject one at a dmapper level. Later commit 01ad8ec4bb5425446e95dbada81de435646824b4 (sw floattable: fix lost tables around a floating table from DOCX, 2023-06-05) did the same at a tokenizer level, as doing it in dmapper is too late in some cases. So keep the testcase from the first commit, but the changes to dmapper can be dropped. (cherry picked from commit 4c5438b2c447403194420b69311a81ea7d36e157) Change-Id: If5b702d99e81a3f939491b7ff9de1128da765cbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152694 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 593cf813c3e3..c6a11e38b74a 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3164,17 +3164,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) break; case NS_ooxml::LN_tblStart: { - if (m_pImpl->hasTableManager()) - { - if (m_pImpl->getTableManager().IsFloating()) - { - // We're starting a new table, but the previous table was floating. Insert a dummy - // paragraph to ensure that the floating table is not anchored inside the next - // table. - finishParagraph(); - } - } - if (m_pImpl->hasTableManager()) { bool bTableStartsAtCellStart = m_pImpl->m_nTableDepth > 0 && m_pImpl->m_nTableCellDepth > m_pImpl->m_nLastTableCellParagraphDepth + 1; @@ -4756,15 +4745,6 @@ void DomainMapper::finishParagraph(const bool bRemove, const bool bNoNumbering) if (m_pImpl->m_pSdtHelper->getControlType() == SdtControlType::datePicker) m_pImpl->m_pSdtHelper->createDateContentControl(); m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH), bRemove, bNoNumbering); - if (m_pImpl->m_nTableDepth == 0) - { - if (m_pImpl->hasTableManager()) - { - // Non-table content, possibly after a table. Forget that such a previous table was - // floating. - m_pImpl->getTableManager().SetFloating(false); - } - } } void DomainMapper::commentProps(const OUString& sId, const CommentProperties& rProps) diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index bf3c78dcebee..004f34971b6a 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -334,9 +334,6 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) break; case NS_ooxml::LN_CT_TblPrBase_tblpPr: { - // Remember that this will be a floating table. - m_bIsFloating = true; - writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); // Ignore <w:tblpPr> in shape text, those tables should be always non-floating ones. if (!m_bIsInShape && pProperties) diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx b/writerfilter/source/dmapper/DomainMapperTableManager.hxx index 955ccfafc963..a2e492936b96 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx @@ -42,8 +42,6 @@ class DomainMapperTableManager : public TableManager sal_Int32 m_nTableWidth; //might be set directly or has to be calculated from the column positions /// Are we in a shape (text append stack is not empty) or in the body document? bool m_bIsInShape; - /// Is the current table floating? - bool m_bIsFloating = false; std::vector< OUString > m_aTableStyleNames; /// Moved table (in moveRangeFromStart...moveRangeFromEnd or moveRangeToStart...moveRangeToEnd) std::vector< OUString > m_aMoved; @@ -167,9 +165,6 @@ public: return OUString(); } - bool IsFloating() const { return m_bIsFloating; } - - void SetFloating(bool bFloating) { m_bIsFloating = bFloating; } }; }