Kaydet (Commit) 91a176b8 authored tarafından Dimitri Bouron's avatar Dimitri Bouron Kaydeden (comit) Björn Michaelsen

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/32349Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
üst 640e8e82
......@@ -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();
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment