[Libreoffice-commits] core.git: sw/qa sw/source
Justin Luth
justin_luth at sil.org
Thu Dec 3 11:12:08 PST 2015
sw/qa/extras/uiwriter/data/tdf34957.odt |binary
sw/qa/extras/uiwriter/uiwriter.cxx | 12 ++++++++++++
sw/source/core/layout/tabfrm.cxx | 3 +--
3 files changed, 13 insertions(+), 2 deletions(-)
New commits:
commit 04164c70f23ff49c308f62f36e45a589afa168d0
Author: Justin Luth <justin_luth at sil.org>
Date: Fri Nov 27 06:46:18 2015 +0300
tdf#34957 - don't push multi-page table to next page.
Removing an old hack that is no longer needed.
A table marked as “keep with next” doesn't split and keeps with the
following paragraph already. It doesn't require this old hack to
function properly anymore.
Preventing tables from splitting had forced
large tables to always start on a new page. Removing the hack
allows everything to lay out nicely now. There is a fairly large
suite of tests in the bug report that prove the proper layout of
various keep-with-next situations.
Any document depending on the old behaviour can simply (and properly)
insert a manual page-break before the table in order to force it to start
on a new page.
Change-Id: Ie2036c1a638009aaf95247574998077a1e55b5e5
Reviewed-on: https://gerrit.libreoffice.org/20216
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Justin Luth <justin_luth at sil.org>
diff --git a/sw/qa/extras/uiwriter/data/tdf34957.odt b/sw/qa/extras/uiwriter/data/tdf34957.odt
new file mode 100644
index 0000000..5aacca0
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf34957.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 3e40dff..6ce9814 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -169,6 +169,7 @@ public:
void testShapeAnchorUndo();
void testDde();
void testTdf94804();
+ void testTdf34957();
void testTdf89954();
void testTdf89720();
void testTdf88986();
@@ -250,6 +251,7 @@ public:
CPPUNIT_TEST(testShapeAnchorUndo);
CPPUNIT_TEST(testDde);
CPPUNIT_TEST(testTdf94804);
+ CPPUNIT_TEST(testTdf34957);
CPPUNIT_TEST(testTdf89954);
CPPUNIT_TEST(testTdf89720);
CPPUNIT_TEST(testTdf88986);
@@ -2771,6 +2773,16 @@ void SwUiWriterTest::testUnicodeNotationToggle()
CPPUNIT_ASSERT( sDocString.equals(sOriginalDocString) );
}
+void SwUiWriterTest::testTdf34957()
+{
+ load(DATA_DIRECTORY, "tdf34957.odt");
+ // table with "keep with next" always started on a new page if the table was large,
+ // regardless of whether it was already kept with the previous paragraph,
+ // or whether the following paragraph actually fit on the same page (MAB 3.6 - 5.0)
+ CPPUNIT_ASSERT_EQUAL( OUString("Row 1"), parseDump("/root/page[2]/body/tab[1]/row[2]/cell[1]/txt") );
+ CPPUNIT_ASSERT_EQUAL( OUString("Row 1"), parseDump("/root/page[4]/body/tab[1]/row[2]/cell[1]/txt") );
+}
+
void SwUiWriterTest::testTdf89954()
{
SwDoc* pDoc = createDoc("tdf89954.odt");
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index cea182f..236ac88 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1768,9 +1768,8 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
const bool bKeep = IsKeep( pAttrs->GetAttrSet() );
// All rows should keep together
- // OD 2004-05-25 #i21478# - don't split table, if it has to keep with next
const bool bDontSplit = !IsFollow() &&
- ( !GetFormat()->GetLayoutSplit().GetValue() || bKeep );
+ ( !GetFormat()->GetLayoutSplit().GetValue() );
// The number of repeated headlines
const sal_uInt16 nRepeat = GetTable()->GetRowsToRepeat();
More information about the Libreoffice-commits
mailing list