diff options
author | Dimitri Bouron <bouron.d@gmail.com> | 2016-12-22 11:19:05 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2017-01-03 12:04:33 +0000 |
commit | 91a176b864ac0492f5c0d2386292118dd3095df4 (patch) | |
tree | 067dfa3908edc7d722c1b504a0a77d001ca5eb95 /sw | |
parent | 640e8e827ef9e02d1f231e058faf743a4fbfae44 (diff) |
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.
Change-Id: If4adc33febe088a866b704e87e49339710e5aaf5
Reviewed-on: https://gerrit.libreoffice.org/32349
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/uiwriter/data/tdf104492.docx | bin | 0 -> 61554 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf104492.docx b/sw/qa/extras/uiwriter/data/tdf104492.docx Binary files differnew file mode 100644 index 000000000000..a5a7af367854 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf104492.docx diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 5ac5648a6a9d..229cc3e78d8c 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -221,6 +221,7 @@ public: void testTdf104425(); void testTdf104814(); void testTdf66405(); + void testTdf104492(); CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST(testReplaceForward); @@ -338,6 +339,7 @@ public: CPPUNIT_TEST(testTdf104425); CPPUNIT_TEST(testTdf104814); CPPUNIT_TEST(testTdf66405); + CPPUNIT_TEST(testTdf104492); CPPUNIT_TEST_SUITE_END(); private: @@ -4201,6 +4203,13 @@ void SwUiWriterTest::testTdf66405() CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nTopMargin); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nBottomMargin); } +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 d353645f8f00..4583a5db0219 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2540,6 +2540,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 |