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 f1bbce4068828f3d1240afd50b228d820c17e848
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Wed Jan 29 23:36:14 2025 +0100
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Thu Jan 30 12:58:18 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

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 74f020e614f2..7ef3f92031cd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
@@ -277,6 +277,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 b268f3d9b701..45a911196cca 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