sc/qa/unit/data/xml/empty-rows.xml     |   79 +++++++++++++++++++++++++++++++++
 sc/qa/unit/subsequent_filters-test.cxx |   35 ++++++++++++++
 sc/qa/unit/ucalc.cxx                   |   16 +++---
 sc/qa/unit/ucalc_formula.cxx           |   20 ++++----
 sc/qa/unit/ucalc_sort.cxx              |   52 ++++++++++-----------
 5 files changed, 158 insertions(+), 44 deletions(-)

New commits:
commit cf9e55538375e5c5dea173151f1d0386bd29ad4e
Author: Kohei Yoshida <kohei.yosh...@gmail.com>
Date:   Sat Feb 17 09:29:02 2018 -0500

    Use the variant of checkOutput that takes nested std::vector.
    
    That one is *the* future.  We can't remove the old one just yet...
    
    Change-Id: I3c5b1bfee3d2cb8988b68ced5a38d52d641e5881
    Reviewed-on: https://gerrit.libreoffice.org/49908
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Kohei Yoshida <libreoff...@kohei.us>

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 7651a65a448f..29c16f6e8243 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -6028,7 +6028,7 @@ void Test::testFormulaToValue()
 
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "1",  "2", "TRUE" },
             { "2",  "4", "TRUE" },
             { "3",  "6", "TRUE" },
@@ -6037,7 +6037,7 @@ void Test::testFormulaToValue()
             { "6", "12", "TRUE" },
         };
 
-        bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"Initial value");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Initial 
value");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -6048,7 +6048,7 @@ void Test::testFormulaToValue()
 
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "1",  "2",  "TRUE" },
             { "2",  "4",  "TRUE" },
             { "3",  "6", "FALSE" },
@@ -6057,7 +6057,7 @@ void Test::testFormulaToValue()
             { "6", "12",  "TRUE" },
         };
 
-        bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"Converted");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, 
"Converted");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -6090,7 +6090,7 @@ void Test::testFormulaToValue()
 
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "1",  "2", "TRUE" },
             { "2",  "4", "TRUE" },
             { "3",  "6", "TRUE" },
@@ -6099,7 +6099,7 @@ void Test::testFormulaToValue()
             { "6", "12", "TRUE" },
         };
 
-        bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"After undo");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "After 
undo");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -6121,7 +6121,7 @@ void Test::testFormulaToValue()
     pUndoMgr->Redo();
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "1",  "2",  "TRUE" },
             { "2",  "4",  "TRUE" },
             { "3",  "6", "FALSE" },
@@ -6130,7 +6130,7 @@ void Test::testFormulaToValue()
             { "6", "12",  "TRUE" },
         };
 
-        bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"Converted");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, 
"Converted");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index d6764c498e51..a67ef5063dcd 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -5683,7 +5683,7 @@ void Test::testFormulaDepTrackingDeleteCol()
 
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][2] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "#REF!", "#REF!" },
             { nullptr,  nullptr },
             { "#REF!", "#REF!" },
@@ -5691,7 +5691,7 @@ void Test::testFormulaDepTrackingDeleteCol()
         };
 
         ScRange aCheckRange(0,0,0,1,3,0);
-        bool bSuccess = checkOutput<2>(m_pDoc, aCheckRange, aOutputCheck, 
"Check after deleting column A");
+        bool bSuccess = checkOutput(m_pDoc, aCheckRange, aOutputCheck, "Check 
after deleting column A");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -5702,7 +5702,7 @@ void Test::testFormulaDepTrackingDeleteCol()
 
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "2", "2", "2" },
             { nullptr,  nullptr, nullptr },
             { "3", "3", "3" },
@@ -5710,7 +5710,7 @@ void Test::testFormulaDepTrackingDeleteCol()
         };
 
         ScRange aCheckRange(0,0,0,2,3,0);
-        bool bSuccess = checkOutput<3>(m_pDoc, aCheckRange, aOutputCheck, 
"Check after undo");
+        bool bSuccess = checkOutput(m_pDoc, aCheckRange, aOutputCheck, "Check 
after undo");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -5718,7 +5718,7 @@ void Test::testFormulaDepTrackingDeleteCol()
     pUndoMgr->Redo();
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][2] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "#REF!", "#REF!" },
             { nullptr, nullptr },
             { "#REF!", "#REF!" },
@@ -5726,7 +5726,7 @@ void Test::testFormulaDepTrackingDeleteCol()
         };
 
         ScRange aCheckRange(0,0,0,1,3,0);
-        bool bSuccess = checkOutput<2>(m_pDoc, aCheckRange, aOutputCheck, 
"Check after redo");
+        bool bSuccess = checkOutput(m_pDoc, aCheckRange, aOutputCheck, "Check 
after redo");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -5738,7 +5738,7 @@ void Test::testFormulaDepTrackingDeleteCol()
 
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "22", "22", "22" },
             { nullptr, nullptr, nullptr },
             { "23", "23", "23" },
@@ -5746,7 +5746,7 @@ void Test::testFormulaDepTrackingDeleteCol()
         };
 
         ScRange aCheckRange(0,0,0,2,3,0);
-        bool bSuccess = checkOutput<3>(m_pDoc, aCheckRange, aOutputCheck, 
"Check after undo & value change in column A");
+        bool bSuccess = checkOutput(m_pDoc, aCheckRange, aOutputCheck, "Check 
after undo & value change in column A");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -6203,7 +6203,7 @@ void Test::testExternalRefUnresolved()
     ScRange aRange = insertRangeData(m_pDoc, aPos, aData, 
SAL_N_ELEMENTS(aData));
     CPPUNIT_ASSERT_EQUAL(aPos, aRange.aStart);
 
-    const char* aOutputCheck[][1] = {
+    std::vector<std::vector<const char*>> aOutputCheck = {
         { "#REF!" },    // plain single ref
         { "#REF!" },    // +23
         { "#REF!" },    // &"W"
@@ -6234,7 +6234,7 @@ void Test::testExternalRefUnresolved()
         { "#REF!" },    // INDIRECT
     };
 
-    bool bSuccess = checkOutput<1>(m_pDoc, aRange, aOutputCheck, "Check 
unresolved external reference.");
+    bool bSuccess = checkOutput(m_pDoc, aRange, aOutputCheck, "Check 
unresolved external reference.");
     CPPUNIT_ASSERT_MESSAGE("Unresolved reference check failed", bSuccess);
 
     m_pDoc->DeleteTab(0);
diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx
index e700c5e4ffe2..825c608f3643 100644
--- a/sc/qa/unit/ucalc_sort.cxx
+++ b/sc/qa/unit/ucalc_sort.cxx
@@ -177,14 +177,14 @@ void Test::testSortHorizontal()
 
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][4] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "table", "flag", "has UNIQUE", "Publish to EC2" },
             { "w2gi.mobilehit",     "Yes-No",  "Yes", "No" },
             { "w2gi.visitors",      "No-No",   "No",  "No" },
             { "w2gi.pagedimension", "Yes-Yes", "Yes", "Yes" },
         };
 
-        bool bSuccess = checkOutput<4>(m_pDoc, aDataRange, aOutputCheck, 
"Sorted by column with formula");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Sorted 
by column with formula");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -1354,14 +1354,14 @@ void Test::testSortRefUpdate6()
 
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "Order", "Value", "1" },
             { "9", "1", "2" },
             { "1", "2", "4" },
             { "8", "3", "7" },
         };
 
-        bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"Initial value");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Initial 
value");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -1386,14 +1386,14 @@ void Test::testSortRefUpdate6()
 
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "Order", "Value", "1" },
             { "1", "2", "3" },
             { "8", "3", "6" },
             { "9", "1", "7" },
         };
 
-        bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"Sorted without reference update");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Sorted 
without reference update");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -1410,14 +1410,14 @@ void Test::testSortRefUpdate6()
 
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "Order", "Value", "1" },
             { "9", "1", "2" },
             { "1", "2", "4" },
             { "8", "3", "7" },
         };
 
-        bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"After undo");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "After 
undo");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -1425,14 +1425,14 @@ void Test::testSortRefUpdate6()
     pUndoMgr->Redo();
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "Order", "Value", "1" },
             { "1", "2", "3" },
             { "8", "3", "6" },
             { "9", "1", "7" },
         };
 
-        bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"After redo");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "After 
redo");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -1441,14 +1441,14 @@ void Test::testSortRefUpdate6()
     rFunc.SetValueCell(ScAddress(2,0,0), 11.0, false);
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "Order", "Value", "11" },
             { "1", "2", "13" },
             { "8", "3", "16" },
             { "9", "1", "17" },
         };
 
-        bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"Change the header value");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "Change 
the header value");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -1456,14 +1456,14 @@ void Test::testSortRefUpdate6()
     pUndoMgr->Undo();
     {
         // Expected output table content.  0 = empty cell
-        const char* aOutputCheck[][3] = {
+        std::vector<std::vector<const char*>> aOutputCheck = {
             { "Order", "Value", "1" },
             { "1", "2", "3" },
             { "8", "3", "6" },
             { "9", "1", "7" },
         };
 
-        bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"After undo of header value change");
+        bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, "After 
undo of header value change");
         CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
     }
 
@@ -1491,12 +1491,12 @@ void Test::testSortBroadcaster()
 
         {
             // Expected output table content.  0 = empty cell
-            const char* aOutputCheck[][7] = {
+            std::vector<std::vector<const char*>> aOutputCheck = {
                 { "1",   nullptr, nullptr, "0", "0",  "1",  "1" },
                 { "2", "8", nullptr, "8", "8", "10", "10" },
             };
 
-            bool bSuccess = checkOutput<7>(m_pDoc, aDataRange, aOutputCheck, 
"Initial value");
+            bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, 
"Initial value");
             CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
         }
 
@@ -1522,12 +1522,12 @@ void Test::testSortBroadcaster()
 
         {
             // Expected output table content.  0 = empty cell
-            const char* aOutputCheck[][7] = {
+            std::vector<std::vector<const char*>> aOutputCheck = {
                 { "2", "8", nullptr, "8", "8", "10", "10" },
                 { "1",   nullptr, nullptr, "0", "0",  "1",  "1" },
             };
 
-            bool bSuccess = checkOutput<7>(m_pDoc, aDataRange, aOutputCheck, 
"Sorted without reference update");
+            bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, 
"Sorted without reference update");
             CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
         }
 
@@ -1583,7 +1583,7 @@ void Test::testSortBroadcaster()
 
         {
             // Expected output table content.  0 = empty cell
-            const char* aOutputCheck[][2] = {
+            std::vector<std::vector<const char*>> aOutputCheck = {
                 { "1", "2" },
                 {   nullptr, "8" },
                 { nullptr, nullptr },
@@ -1593,7 +1593,7 @@ void Test::testSortBroadcaster()
                 { "1", "10" },
             };
 
-            bool bSuccess = checkOutput<2>(m_pDoc, aDataRange, aOutputCheck, 
"Initial value");
+            bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, 
"Initial value");
             CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
         }
 
@@ -1619,7 +1619,7 @@ void Test::testSortBroadcaster()
 
         {
             // Expected output table content.  0 = empty cell
-            const char* aOutputCheck[][2] = {
+            std::vector<std::vector<const char*>> aOutputCheck = {
                 { "2", "1" },
                 { "8",   nullptr },
                 { nullptr, nullptr },
@@ -1629,7 +1629,7 @@ void Test::testSortBroadcaster()
                 { "10", "1" },
             };
 
-            bool bSuccess = checkOutput<2>(m_pDoc, aDataRange, aOutputCheck, 
"Sorted without reference update");
+            bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, 
"Sorted without reference update");
             CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
         }
 
@@ -1691,12 +1691,12 @@ void Test::testSortBroadcastBroadcaster()
 
         {
             // Expected output table content.  0 = empty cell
-            const char* aOutputCheck[][3] = {
+            std::vector<std::vector<const char*>> aOutputCheck = {
                 { "1", "1", "1" },
                 { "2", "2", "2" },
             };
 
-            bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"Initial value");
+            bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, 
"Initial value");
             CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
         }
 
@@ -1722,12 +1722,12 @@ void Test::testSortBroadcastBroadcaster()
 
         {
             // Expected output table content.  0 = empty cell
-            const char* aOutputCheck[][3] = {
+            std::vector<std::vector<const char*>> aOutputCheck = {
                 { "2", "2", "2" },
                 { "1", "1", "1" },
             };
 
-            bool bSuccess = checkOutput<3>(m_pDoc, aDataRange, aOutputCheck, 
"Sorted without reference update");
+            bool bSuccess = checkOutput(m_pDoc, aDataRange, aOutputCheck, 
"Sorted without reference update");
             CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
         }
 
commit 1c791a9b28af5e6ece46e1d48a2acde9d4c81c78
Author: Kohei Yoshida <kohei.yosh...@gmail.com>
Date:   Sat Feb 17 09:12:48 2018 -0500

    Add a test to make sure we import docs with empty rows correctly.
    
    The previous XSLT-based filter failed to import this correctly.
    
    Change-Id: I6218bd2b3e5c5ac1514f84b959be27df23a0c3f8
    Reviewed-on: https://gerrit.libreoffice.org/49907
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Kohei Yoshida <libreoff...@kohei.us>

diff --git a/sc/qa/unit/data/xml/empty-rows.xml 
b/sc/qa/unit/data/xml/empty-rows.xml
new file mode 100644
index 000000000000..624e94bb4201
--- /dev/null
+++ b/sc/qa/unit/data/xml/empty-rows.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:o="urn:schemas-microsoft-com:office:office"
+ xmlns:x="urn:schemas-microsoft-com:office:excel"
+ xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:html="http://www.w3.org/TR/REC-html40";>
+ <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+  <Author>Kohei Yoshida</Author>
+  <LastAuthor>Kohei Yoshida</LastAuthor>
+  <Created>2016-12-14T01:54:30Z</Created>
+  <LastSaved>2016-12-14T01:58:30Z</LastSaved>
+  <Version>15.00</Version>
+ </DocumentProperties>
+ <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
+  <AllowPNG/>
+ </OfficeDocumentSettings>
+ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
+  <WindowHeight>14385</WindowHeight>
+  <WindowWidth>24000</WindowWidth>
+  <WindowTopX>0</WindowTopX>
+  <WindowTopY>0</WindowTopY>
+  <ProtectStructure>False</ProtectStructure>
+  <ProtectWindows>False</ProtectWindows>
+ </ExcelWorkbook>
+ <Styles>
+  <Style ss:ID="Default" ss:Name="Normal">
+   <Alignment ss:Vertical="Bottom"/>
+   <Borders/>
+   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" 
ss:Color="#000000"/>
+   <Interior/>
+   <NumberFormat/>
+   <Protection/>
+  </Style>
+ </Styles>
+ <Worksheet ss:Name="Sheet1">
+  <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="9" x:FullColumns="1"
+   x:FullRows="1" ss:DefaultRowHeight="15">
+   <Row>
+    <Cell><Data ss:Type="String">Top row, followed by 2 empty 
rows.</Data></Cell>
+   </Row>
+   <Row ss:Index="4">
+    <Cell ss:Index="2"><Data ss:Type="Number">1</Data></Cell>
+   </Row>
+   <Row>
+    <Cell ss:Index="2"><Data ss:Type="Number">2</Data></Cell>
+   </Row>
+   <Row>
+    <Cell ss:Index="2"><Data ss:Type="Number">3</Data></Cell>
+   </Row>
+   <Row>
+    <Cell ss:Index="2"><Data ss:Type="Number">4</Data></Cell>
+   </Row>
+   <Row>
+    <Cell ss:Index="2"><Data ss:Type="Number">5</Data></Cell>
+   </Row>
+   <Row>
+    <Cell ss:Index="2" ss:Formula="=SUM(R[-5]C:R[-1]C)"><Data 
ss:Type="Number">15</Data></Cell>
+   </Row>
+  </Table>
+  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+   <PageSetup>
+    <Header x:Margin="0.3"/>
+    <Footer x:Margin="0.3"/>
+    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
+   </PageSetup>
+   <Selected/>
+   <Panes>
+    <Pane>
+     <Number>3</Number>
+     <ActiveRow>9</ActiveRow>
+     <ActiveCol>1</ActiveCol>
+    </Pane>
+   </Panes>
+   <ProtectObjects>False</ProtectObjects>
+   <ProtectScenarios>False</ProtectScenarios>
+  </WorksheetOptions>
+ </Worksheet>
+</Workbook>
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index 214062f30ef0..4f72dddadf44 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -238,6 +238,7 @@ public:
     void testMergedCellsXLSXML();
     void testBackgroundColorStandardXLSXML();
     void testNamedExpressionsXLSXML();
+    void testEmptyRowsXLSXML();
 
     CPPUNIT_TEST_SUITE(ScFiltersTest);
     CPPUNIT_TEST(testBooleanFormatXLSX);
@@ -363,6 +364,7 @@ public:
     CPPUNIT_TEST(testMergedCellsXLSXML);
     CPPUNIT_TEST(testBackgroundColorStandardXLSXML);
     CPPUNIT_TEST(testNamedExpressionsXLSXML);
+    CPPUNIT_TEST(testEmptyRowsXLSXML);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -3643,6 +3645,39 @@ void ScFiltersTest::testNamedExpressionsXLSXML()
     }
 }
 
+void ScFiltersTest::testEmptyRowsXLSXML()
+{
+    ScDocShellRef xDocSh = loadDoc("empty-rows.", FORMAT_XLS_XML);
+    CPPUNIT_ASSERT_MESSAGE("Failed to load empty-rows.xml", xDocSh.is());
+    ScDocument& rDoc = xDocSh->GetDocument();
+
+    {
+        // Expected output table content.  0 = empty cell
+        std::vector<std::vector<const char*>> aOutputCheck = {
+            { "Top row, followed by 2 empty rows.", nullptr },
+            { nullptr, nullptr },
+            { nullptr, nullptr },
+            { nullptr,     "1" },
+            { nullptr,     "2" },
+            { nullptr,     "3" },
+            { nullptr,     "4" },
+            { nullptr,     "5" },
+            { nullptr,    "15" },
+        };
+
+        ScRange aDataRange;
+        aDataRange.Parse("A1:B9");
+        bool bSuccess = checkOutput(&rDoc, aDataRange, aOutputCheck, "Expected 
output");
+        CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+    }
+
+    ScAddress aPos;
+    aPos.Parse("B9");
+    ASSERT_FORMULA_EQUAL(rDoc, aPos, "SUM(B4:B8)", nullptr);
+
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest::testCondFormatXLSB()
 {
     ScDocShellRef xDocSh = loadDoc("cond_format.", FORMAT_XLSB);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to