diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2016-12-02 03:31:22 +0300 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2016-12-02 02:54:46 +0000 |
commit | ce17ebb69500530c978767b1389c9e8341acb9bf (patch) | |
tree | 411068c854910ae00596177f78e08d452bc914f8 /sc/qa/unit/bugfix-test.cxx | |
parent | 7d1be94484fa99bbfbaa0261cc243778a70b298e (diff) |
tdf#104310: Accept x12ac lists and fallbacks in dataValidations
Change-Id: I42cf20fcfe3ec03ebd09923be509a9d11e0b40da
Reviewed-on: https://gerrit.libreoffice.org/31516
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'sc/qa/unit/bugfix-test.cxx')
-rw-r--r-- | sc/qa/unit/bugfix-test.cxx | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx index 9b7f2b772ded..34991092ebba 100644 --- a/sc/qa/unit/bugfix-test.cxx +++ b/sc/qa/unit/bugfix-test.cxx @@ -242,20 +242,42 @@ void ScFiltersTest::testRhbz1390776() void ScFiltersTest::testTdf104310() { - ScDocShellRef xDocSh = loadDoc("tdf104310.", FORMAT_XLSX); - ScDocument& rDoc = xDocSh->GetDocument(); - - const ScValidationData* pData = rDoc.GetValidationEntry(1); - CPPUNIT_ASSERT(pData); - - // Make sure the list is correct. - std::vector<ScTypedStrData> aList; - pData->FillSelectionList(aList, ScAddress(0, 1, 0)); - CPPUNIT_ASSERT_EQUAL(size_t(5), aList.size()); - for (size_t i = 0; i < 5; ++i) - CPPUNIT_ASSERT_DOUBLES_EQUAL(double(i+1), aList[i].GetValue(), 1e-8); - - xDocSh->DoClose(); + // 1. Test x14 extension + { + ScDocShellRef xDocSh = loadDoc("tdf104310.", FORMAT_XLSX); + ScDocument& rDoc = xDocSh->GetDocument(); + + const ScValidationData* pData = rDoc.GetValidationEntry(1); + CPPUNIT_ASSERT(pData); + + // Make sure the list is correct. + std::vector<ScTypedStrData> aList; + pData->FillSelectionList(aList, ScAddress(0, 1, 0)); + CPPUNIT_ASSERT_EQUAL(size_t(5), aList.size()); + for (size_t i = 0; i < 5; ++i) + CPPUNIT_ASSERT_DOUBLES_EQUAL(double(i + 1), aList[i].GetValue(), 1e-8); + + xDocSh->DoClose(); + } + + // 2. Test x12ac extension + { + ScDocShellRef xDocSh = loadDoc("tdf104310-2.", FORMAT_XLSX); + ScDocument& rDoc = xDocSh->GetDocument(); + + const ScValidationData* pData = rDoc.GetValidationEntry(1); + CPPUNIT_ASSERT(pData); + + // Make sure the list is correct. + std::vector<ScTypedStrData> aList; + pData->FillSelectionList(aList, ScAddress(0, 1, 0)); + CPPUNIT_ASSERT_EQUAL(size_t(3), aList.size()); + CPPUNIT_ASSERT_EQUAL(OUString("1"), aList[0].GetString()); + CPPUNIT_ASSERT_EQUAL(OUString("2,3"), aList[1].GetString()); + CPPUNIT_ASSERT_EQUAL(OUString("4"), aList[2].GetString()); + + xDocSh->DoClose(); + } } ScFiltersTest::ScFiltersTest() |