[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-5-2+backports' - sc/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 30 13:06:16 UTC 2018


 sc/qa/unit/subsequent_export-test.cxx  |   59 +++++++++++++++++----------------
 sc/qa/unit/subsequent_filters-test.cxx |   28 ++-------------
 2 files changed, 35 insertions(+), 52 deletions(-)

New commits:
commit 836c2b708b3712a52116561e6916a4077edfc24c
Author:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
AuthorDate: Tue Oct 30 14:04:34 2018 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Oct 30 14:04:34 2018 +0100

    Partial revert for some tdf#62268 unit tests
    
    This reverts more pieces from commit
    0896fdb1b165b44ef22c2b909184ce6ae5548b48:
    
     tdf#62268: allow row height recalculation on document load
    
    Change-Id: Ib91b0615bfca1eaabc7266e39b9ff42751284106

diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index ba3e5dc610af..4e90034a5f99 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -800,57 +800,60 @@ void ScExportTest::testOutlineExportXLSX()
     // We expected that exactly 13 unique Nodes will be produced
     assertXPath(pSheet, "/x:worksheet/x:cols/x:col", 13);
 
-    // First row is empty and default so it is not written into XML file
-    // so we need to save 29 rows, as it provides information about outLineLevel
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]", "r", "2");
+    // We need to save all 30 rows, as it provides information about outLineLevel
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]", "r", "1");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]", "hidden", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]", "outlineLevel", "1");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]", "outlineLevel", "0");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]", "collapsed", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]", "r", "3");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]", "r", "2");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]", "hidden", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]", "outlineLevel", "2");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]", "outlineLevel", "1");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]", "collapsed", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]", "r", "4");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]", "r", "3");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]", "hidden", "false");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]", "outlineLevel", "2");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]", "collapsed", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]", "r", "5");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]", "r", "4");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]", "hidden", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]", "outlineLevel", "3");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]", "outlineLevel", "2");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]", "collapsed", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]", "r", "6");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]", "r", "5");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]", "hidden", "false");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]", "outlineLevel", "3");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[5]", "collapsed", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]", "r", "7");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]", "hidden", "true");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]", "outlineLevel", "4");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]", "r", "6");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]", "hidden", "false");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]", "outlineLevel", "3");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[6]", "collapsed", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]", "r", "8");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]", "r", "7");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]", "hidden", "true");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]", "outlineLevel", "4");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[7]", "collapsed", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]", "r", "9");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]", "r", "8");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]", "hidden", "true");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]", "outlineLevel", "4");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[8]", "collapsed", "false");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[9]", "r", "9");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[9]", "hidden", "true");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[9]", "outlineLevel", "4");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[9]", "collapsed", "false");
     // Next rows are the same as the previous one but it needs to bre preserved,
     // as they contain information about outlineLevel
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]", "r", "21");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]", "hidden", "true");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]", "outlineLevel", "4");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[20]", "collapsed", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]", "r", "22");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]", "hidden", "false");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]", "outlineLevel", "3");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]", "collapsed", "true");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]", "r", "23");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]", "r", "21");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]", "hidden", "true");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]", "outlineLevel", "4");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[21]", "collapsed", "false");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]", "r", "22");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]", "hidden", "false");
     assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]", "outlineLevel", "3");
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]", "collapsed", "false");
-
-    // We expected that exactly 29 Row Nodes will be produced
-    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row", 29);
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[22]", "collapsed", "true");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[23]", "r", "23");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[23]", "hidden", "false");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[23]", "outlineLevel", "3");
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[23]", "collapsed", "false");
+
+    // We expected that exactly 30 Row Nodes will be produced
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row", 30);
 }
 
 
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 436cd2381f95..69d7a4f43a36 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -220,8 +220,6 @@ public:
 
     void testBnc762542();
 
-    void testTdf62268();
-
     CPPUNIT_TEST_SUITE(ScFiltersTest);
     CPPUNIT_TEST(testBooleanFormatXLSX);
     CPPUNIT_TEST(testBasicCellContentODS);
@@ -330,8 +328,6 @@ public:
 
     CPPUNIT_TEST(testHiddenSheetsXLSX);
 
-    CPPUNIT_TEST(testTdf62268);
-
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -2860,8 +2856,8 @@ void ScFiltersTest::testMiscRowHeights()
 
     TestParam::RowData MultiLineOptData[] =
     {
-        // Row 0 is 12.63 mm, but optimal flag is set
-        { 0, 0, 0, 1236, CHECK_OPTIMAL, true  },
+        // Row 0 is 12.63 mm and optimal flag is set
+        { 0, 0, 0, 1263, CHECK_OPTIMAL, true  },
         // Row 1 is 11.99 mm and optimal flag is NOT set
         { 1, 1, 0, 1199, CHECK_OPTIMAL, false  },
     };
@@ -2894,9 +2890,8 @@ void ScFiltersTest::testOptimalHeightReset()
     rDoc.EnableAdjustHeight( true );
     // open document in read/write mode ( otherwise optimal height stuff won't
     // be triggered ) *and* you can't delete cell contents.
-    int nHeight = rDoc.GetRowHeight(nRow, nTab, false);
-    // Due to some minor differences on Mac this comparison is made bit fuzzy
-    CPPUNIT_ASSERT( 3 > abs( nHeight - 701 ) );
+    int nHeight = sc::TwipsToHMM ( rDoc.GetRowHeight(nRow, nTab, false) );
+    CPPUNIT_ASSERT_EQUAL(1263, nHeight);
 
     ScDocFunc &rFunc = xDocSh->GetDocFunc();
 
@@ -3504,21 +3499,6 @@ void ScFiltersTest::testRelFormulaValidationXLS()
     xDocSh->DoClose();
 }
 
-void ScFiltersTest::testTdf62268()
-{
-    ScDocShellRef xDocSh = loadDoc("tdf62268.", FORMAT_ODS);
-    ScDocument& rDoc = xDocSh->GetDocument();
-    int nHeight;
-
-    SCTAB nTab = 0;
-    nHeight = rDoc.GetRowHeight(0, nTab, false);
-    CPPUNIT_ASSERT( 3 >= abs( 256 - nHeight ) );
-    nHeight = rDoc.GetRowHeight(1, nTab, false);
-    CPPUNIT_ASSERT( 19 >= abs( 1905 - nHeight ) );
-
-    xDocSh->DoClose();
-}
-
 ScFiltersTest::ScFiltersTest()
       : ScBootstrapFixture( "sc/qa/unit/data" )
 {


More information about the Libreoffice-commits mailing list