[Libreoffice-commits] core.git: sw/qa sw/source

Dimitri Bouron bouron.d at gmail.com
Tue Jan 3 12:04:54 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 91a176b864ac0492f5c0d2386292118dd3095df4
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.
    
    Change-Id: If4adc33febe088a866b704e87e49339710e5aaf5
    Reviewed-on: https://gerrit.libreoffice.org/32349
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/sw/qa/extras/uiwriter/data/tdf104492.docx b/sw/qa/extras/uiwriter/data/tdf104492.docx
new file mode 100644
index 0000000..a5a7af3
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 5ac5648..229cc3e 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 d353645..4583a5d 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


More information about the Libreoffice-commits mailing list