summaryrefslogtreecommitdiffstats
path: root/sw/qa/extras/ww8export/ww8export.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-05-04 22:21:46 +0300
committerGabor Kelemen <kelemeng@ubuntu.com>2022-07-11 16:06:09 +0200
commitdb882afc0cfad3e374b1ff83c617d4f6a6e85c1e (patch)
treed64aa65966b1c3ce1d710d438a332f8da9d787ef /sw/qa/extras/ww8export/ww8export.cxx
parenttdf#135244: move LockAllViews to SfxObjectShell (diff)
downloadcore-db882afc0cfad3e374b1ff83c617d4f6a6e85c1e.tar.gz
core-db882afc0cfad3e374b1ff83c617d4f6a6e85c1e.zip
tdf#132642 sw layout: try2 emulate table kept-with-next not splitting
This adjusts my LO 5.2 code for tdf#91083 that tried to emulate the table's keep-with-next property which doesn't have a matching counterpart in MS formats. I always confused myself trying to understand what my year-long coding attempt was trying to do. This seems much understandable, and efficient. The big clue was that it affected non-MS formats - which was unintended. Change-Id: I7886e52430cb34799e25f7fcf73500e28bbe2a55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93443 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136952 Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
Diffstat (limited to 'sw/qa/extras/ww8export/ww8export.cxx')
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index 4804610a8900..5c35d53820b0 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -1296,6 +1296,28 @@ DECLARE_WW8EXPORT_TEST(testTableKeep, "tdf91083.odt")
#endif
#endif
+DECLARE_WW8EXPORT_TEST(tesTdf91083_tableKeep2, "tdf91083_tableKeep2.odt")
+{
+ //emulate table "keep with next" - split large row in order to keep with previous paragraph
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Table doesn't split, so it starts on page 2",
+ OUString("0"), parseDump("count(//page[1]//tab)") );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Page 2 starts with a paragraph/title, not a table",
+ OUString("KeepWithNext"), parseDump("//page[2]/body/txt[1]") );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Table sticks with previous paragraph, so it starts on page 2",
+ OUString("1"), parseDump("count(//page[2]//tab)") );
+ CPPUNIT_ASSERT_MESSAGE("Row itself splits, not the table at a row boundary",
+ "Cell 2" != parseDump("//page[3]//tab//row[2]/cell[1]/txt[1]") );
+}
+
+DECLARE_WW8EXPORT_TEST(tesTdf91083_tableKeep3, "tdf91083_tableKeep3.odt")
+{
+ //emulate table "keep with next" - split single row table in order to keep with previous paragraph
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Table doesn't split, so it starts on page 2",
+ OUString("0"), parseDump("count(//page[1]//tab)") );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Table sticks with previous paragraph, so it starts on page 2",
+ OUString("1"), parseDump("count(//page[2]//tab)") );
+}
+
DECLARE_WW8EXPORT_TEST(testTdf76349_textboxMargins, "tdf76349_textboxMargins.doc")
{
// textboxes without borders were losing their spacing items in round-tripping