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 4c5438b2c447403194420b69311a81ea7d36e157
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Jun 6 08:22:53 2023 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Jun 6 11:50:05 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.
    
    Change-Id: If5b702d99e81a3f939491b7ff9de1128da765cbf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152638
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index fb3113273079..3d778ce64458 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3173,17 +3173,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;
@@ -4781,15 +4770,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 9f467f7ae409..2c802d3ce2a9 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -333,9 +333,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; }
 };
 
 }

Reply via email to