sc/qa/unit/chart2dataprovider.cxx | 15 +++++++++++---- sc/qa/unit/data/ods/chart2dataprovider.ods |binary 2 files changed, 11 insertions(+), 4 deletions(-)
New commits: commit c6c83355c08d780f993fa9638ea163e7fe1ab742 Author: Vasily Melenchuk <vasily.melenc...@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 <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/46768 Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> Tested-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/sc/qa/unit/chart2dataprovider.cxx b/sc/qa/unit/chart2dataprovider.cxx index 3c78f23eb900..e5536d391997 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,25 +71,31 @@ 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); + } } } void ScChart2DataProviderTest::testHeaderExpansion() { ScDocShellRef xDocSh = loadDoc("chart2dataprovider.", FORMAT_ODS); - CPPUNIT_ASSERT_MESSAGE("Failed to load ch.ods.", xDocSh.Is()); + CPPUNIT_ASSERT_MESSAGE("Failed to load ch.ods.", xDocSh.is()); ScDocument& rDoc = xDocSh->GetDocument(); 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits