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 <vmiklos@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 0000000..1a996b6
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/tdf79639.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 363d6b7..a79781d 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 8da444e..f1b3391 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);