summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-09-27 11:42:37 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-09-27 13:22:43 +0200
commit8165cdad2e128ec5fabb50d3330c41a8b0f021d8 (patch)
tree75533edb6c3ffcd0a99760c69b1d0dd9db98d607 /sw
parent4a736dff5ae2865318cab5d504b5b68feeb949be (diff)
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
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8import/data/tdf79639.docbin0 -> 27648 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx11
-rw-r--r--sw/source/filter/ww8/ww8par.cxx7
3 files changed, 18 insertions, 0 deletions
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
--- /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 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);