sw/qa/extras/ooxmlexport/data/tdf164901.docx    |binary
 sw/qa/extras/ooxmlexport/ooxmlexport20.cxx      |    9 +++++++++
 sw/source/writerfilter/dmapper/DomainMapper.cxx |    6 +++++-
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 4d98e46b7b22f6b2f048273890410f0579fe052c
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Wed Jan 29 23:36:14 2025 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 4 16:45:32 2025 +0100

    tdf#164901 sw inline heading: fix lost floating tables
    
    Style separators inside floating tables resulted losing of
    the floating tables. In this case, don't handle style separators,
    as before commit 56588663a0fddc005c12afaa7d3f8874d036875f.
    
    Regression since commit 56588663a0fddc005c12afaa7d3f8874d036875f
    "tdf#131728 sw inline heading: fix DOCX paragraph layout interoperability".
    
    Change-Id: I30b6683b2312636405960efc65b5af2b6b4dbfa3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180925
    Reviewed-by: László Németh <nem...@numbertext.org>
    Tested-by: Jenkins
    (cherry picked from commit f1bbce4068828f3d1240afd50b228d820c17e848)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180941
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf164901.docx 
b/sw/qa/extras/ooxmlexport/data/tdf164901.docx
new file mode 100644
index 000000000000..9035c53cf476
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf164901.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
index c418c1904197..fc4640425f88 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
@@ -274,6 +274,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf48459)
     assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:rPr/w:specVanish", 1);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf164901)
+{
+    loadAndSave("tdf164901.docx");
+    xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
+
+    // This was 0 (lost floating table because of containing a style separator)
+    assertXPath(pXmlDoc, "/w:document/w:body/w:tbl", 1);
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testFdo77129)
 {
     loadAndSave("fdo77129.docx");
diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index 03a5b22b4afb..c5fde2a1ab4e 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -2139,7 +2139,11 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
         }
         break;
     case NS_ooxml::LN_EG_RPrBase_specVanish:
-        if ( nIntValue && !IsStyleSheetImport() )
+        // tdf#131728 import inline heading
+        if ( nIntValue && !IsStyleSheetImport() &&
+                // tdf#164901 but not in a floating table
+                !(m_pImpl->hasTableManager() &&
+                        
m_pImpl->getTableManager().getCurrentTablePosition().getLength() != 0) )
         {
             // put inline heading inside a text frame to get the same layout 
with ToC/PDF bookmark support
             m_pImpl->m_StreamStateStack.top().bIsInlineParagraph = true;

Reply via email to