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

Vasily Melenchuk Vasily.Melenchuk at cib.de
Tue Dec 19 11:27:38 UTC 2017


Rebased ref, commits from common ancestor:
commit 0f3e957d1a11f12d91eb510f3ef09825a63d2b27
Author: Vasily Melenchuk <Vasily.Melenchuk at cib.de>
Date:   Wed Nov 29 16:29:52 2017 +0300

    tdf#113861: Unittest for chart datatable labels expansion
    
    Change-Id: Iab00252901495612cbdee123bd796eaeb36cba2e
    Reviewed-on: https://gerrit.libreoffice.org/45670
    Reviewed-on: https://gerrit.libreoffice.org/46541
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/46768
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sc/qa/unit/chart2dataprovider.cxx b/sc/qa/unit/chart2dataprovider.cxx
index 3c78f23eb900..4400d040d036 100644
--- a/sc/qa/unit/chart2dataprovider.cxx
+++ b/sc/qa/unit/chart2dataprovider.cxx
@@ -12,6 +12,7 @@
 
 #include <docsh.hxx>
 #include <chart2uno.hxx>
+#include <charthelper.hxx>
 
 #include <com/sun/star/frame/Desktop.hpp>
 #include <com/sun/star/chart2/data/XLabeledDataSequence2.hpp>
@@ -70,11 +71,15 @@ void lcl_createAndCheckDataProvider(ScDocument& rDoc, const OUString& cellRange,
 
     CPPUNIT_ASSERT_EQUAL(expectedRows, xSequences.getLength());
 
-    for (sal_Int32 nIdx = 0; nIdx < xSequences.getLength(); ++nIdx)
+    sal_Int32 nStartRow = hasCategories ? 1 : 0;
+    for (sal_Int32 nIdx = nStartRow; nIdx < xSequences.getLength(); ++nIdx)
     {
         Reference<chart2::data::XDataSequence> xValues(xSequences[nIdx]->getValues());
         if (xValues.is())
-            CPPUNIT_ASSERT_EQUAL(expectedCols, xValues->getData().getLength());
+        {
+            sal_Int32 colsNum = xValues->getData().getLength();
+            CPPUNIT_ASSERT_EQUAL(expectedCols, colsNum);
+        }
     }
 }
 
@@ -88,7 +93,9 @@ void ScChart2DataProviderTest::testHeaderExpansion()
     lcl_createAndCheckDataProvider(rDoc, "$Sheet1.$A$1:$D$4", false, false, 4, 4);
     lcl_createAndCheckDataProvider(rDoc, "$Sheet1.$A$1:$D$4", true, true, 4, 3);
 
-    lcl_createAndCheckDataProvider(rDoc, "$Sheet1.$A$9:$D$12", true, true, 1, 2);
+    lcl_createAndCheckDataProvider(rDoc, "$Sheet1.$A$17:$D$20", true, true, 3, 2);
+
+    lcl_createAndCheckDataProvider(rDoc, "$Sheet1.$A$25:$D$28", true, true, 4, 2);
 
     xDocSh->DoClose();
 }
diff --git a/sc/qa/unit/data/ods/chart2dataprovider.ods b/sc/qa/unit/data/ods/chart2dataprovider.ods
index d27b78c83e82..7352b4d30cb5 100644
Binary files a/sc/qa/unit/data/ods/chart2dataprovider.ods and b/sc/qa/unit/data/ods/chart2dataprovider.ods differ


More information about the Libreoffice-commits mailing list