[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sw/qa sw/source
Dimitri Bouron
bouron.d at gmail.com
Tue Nov 28 13:43:45 UTC 2017
sw/qa/extras/uiwriter/data/tdf104492.docx |binary
sw/qa/extras/uiwriter/uiwriter.cxx | 9 +++++++++
sw/source/core/layout/tabfrm.cxx | 2 ++
3 files changed, 11 insertions(+)
New commits:
commit ba37662d05b484d8bd311464b896f3b10c5e2925
Author: Dimitri Bouron <bouron.d at gmail.com>
Date: Thu Dec 22 11:19:05 2016 +0100
tdf#104492: Fix bad docx opening and bad layout
The problem seems to be the table's repeated rows value which is
setted to max table rows in some docx file.
Decreasing repeated rows value by one avoids loops but renders a bad
layout.
Table continuity is lost and lots of rows are hidden.
So I set repeated rows value directly to one in order to avoid bad
layout.
Reviewed-on: https://gerrit.libreoffice.org/32349
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
(cherry picked from commit 91a176b864ac0492f5c0d2386292118dd3095df4)
Change-Id: If4adc33febe088a866b704e87e49339710e5aaf5
diff --git a/sw/qa/extras/uiwriter/data/tdf104492.docx b/sw/qa/extras/uiwriter/data/tdf104492.docx
new file mode 100644
index 000000000000..a5a7af367854
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf104492.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index cb603f313d95..55d14a9efd54 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -234,6 +234,7 @@ public:
void testTdf104032();
void testTdf104425();
void testTdf104814();
+ void testTdf104492();
void testTdf105417();
void testTdf105625();
void testTdf107976();
@@ -361,6 +362,7 @@ public:
CPPUNIT_TEST(testTdf104032);
CPPUNIT_TEST(testTdf104425);
CPPUNIT_TEST(testTdf104814);
+ CPPUNIT_TEST(testTdf104492);
CPPUNIT_TEST(testTdf105417);
CPPUNIT_TEST(testTdf105625);
CPPUNIT_TEST(testTdf107976);
@@ -4628,6 +4630,13 @@ void SwUiWriterTest::testTdf113790()
reload("Office Open XML Text", "tdf113790.docx");
CPPUNIT_ASSERT(dynamic_cast<SwXTextDocument *>(mxComponent.get()));
}
+void SwUiWriterTest::testTdf104492()
+{
+ createDoc("tdf104492.docx");
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+ // The document should split table over 3 pages.
+ assertXPath(pXmlDoc, "//page", 3);
+}
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index d08468aaa1e1..1c988ebee6e7 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2541,6 +2541,8 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
lcl_RecalcTable( *this, nullptr, aNotify );
m_bLowersFormatted = true;
m_bCalcLowers = false;
+ if (!mbValidPrtArea)
+ m_pTable->SetRowsToRepeat(1);
}
#if OSL_DEBUG_LEVEL > 0
else
More information about the Libreoffice-commits
mailing list