summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ww8export/ww8export2.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-10-21 13:27:42 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-10-24 10:04:17 +0000
commitf5f51cb93d11731c64dfd68044144100f5fc4b28 (patch)
treefe111d3d2e461c5cb46e60098b6fb2cdd11b55e8 /sw/qa/extras/ww8export/ww8export2.cxx
parent87296258189bea6bebae9ff6c31dc9e76d8b2c56 (diff)
tdf#89377 ww8import: table honors ParaStyle break-before-page
MS Word can page-break inside a table at any row (using paragraph styles from the first column). Thus a table can be split across many pages. Writer can't because it ignores all page-breaks while inside a table, although the entire table itself can specify starting on a new page. This imported .doc patch checks to see if the very first paragraph style in a table is set with a page-break, and if so, then transfers that setting to the table itself. That at least mimics the most common layout scenario. Change-Id: Ifcf720e357fdf433c225234aae8e3838f1416422 Reviewed-on: https://gerrit.libreoffice.org/30127 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras/ww8export/ww8export2.cxx')
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx39
1 files changed, 39 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
new file mode 100644
index 000000000000..50aad0f8d5a6
--- /dev/null
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <swmodeltestbase.hxx>
+
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/text/XTextFramesSupplier.hpp>
+#include <com/sun/star/text/XTextTablesSupplier.hpp>
+#include <pagedesc.hxx>
+
+class Test : public SwModelTestBase
+{
+public:
+ Test() : SwModelTestBase("/sw/qa/extras/ww8export/data/", "MS Word 97") {}
+
+ bool mustTestImportOf(const char* filename) const override
+ {
+ // If the testcase is stored in some other format, it's pointless to test.
+ return OString(filename).endsWith(".doc");
+ }
+
+};
+
+DECLARE_WW8EXPORT_TEST(testTdf89377, "tdf89377_tableWithBreakBeforeParaStyle.doc")
+{
+ // the paragraph style should set table's text-flow break-before-page
+ CPPUNIT_ASSERT_EQUAL( 2, getPages() );
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */