sw/qa/extras/ww8import/data/tdf79639.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx     |   11 +++++++++++
 sw/source/filter/ww8/ww8par.cxx          |    7 +++++++
 3 files changed, 18 insertions(+)

New commits:
commit 8165cdad2e128ec5fabb50d3330c41a8b0f021d8
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Fri Sep 27 11:42:37 2019 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Sep 27 13:22:43 2019 +0200

    Related: tdf#124601 DOC import: always allow floating tables in 
header/footer
    
    So now the DOC import is in sync with the DOCX one, see commit
    81ef96a2417c7843dfed0558c920ad3064e58921 (tdf#79639 DOCX import: don't
    delay text frame conversion of in-header tables, 2015-06-01).
    
    The bugdoc used to have 2 additional pages in Writer (compared to Word),
    it has only 1 after this.
    
    Change-Id: I24f0dc28599e608737dc19a0143e72832202a034
    Reviewed-on: https://gerrit.libreoffice.org/79682
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/qa/extras/ww8import/data/tdf79639.doc 
b/sw/qa/extras/ww8import/data/tdf79639.doc
new file mode 100644
index 000000000000..1a996b62b0dd
Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf79639.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 363d6b76ee46..a79781d781d3 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -308,6 +308,17 @@ DECLARE_WW8IMPORT_TEST(testTdf122425_1, "tdf122425_1.doc")
     }
 }
 
+DECLARE_WW8IMPORT_TEST(testTdf79639, "tdf79639.doc")
+{
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage = 
xDrawPageSupplier->getDrawPage();
+    // Without the accompanying fix in place, this test would have failed with:
+    // - Expected: 1
+    // - Actual  : 0
+    // as the floating table in the header wasn't converted to a TextFrame.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xDrawPage->getCount());
+}
+
 DECLARE_WW8IMPORT_TEST(testTdf122425_2, "tdf122425_2.doc")
 {
     // This is for graphic objects in headers/footers
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 8da444eed684..f1b33912fc8d 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2548,6 +2548,13 @@ bool 
SwWW8ImplReader::FloatingTableConversion(WW8PLCFx_Cp_FKP* pPap)
     // table that is floating and can span over multiple pages at the same
     // time.
 
+    // If the floating table is in a header or footer, then it won't be a
+    // multi-page one, so can always do the conversion.
+    if (m_bIsHeader || m_bIsFooter)
+    {
+        return true;
+    }
+
     bool bResult = true;
 
     SprmResult aRes = pPap->HasSprm(NS_sprm::sprmTDefTable);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to