diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-12-30 06:30:30 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-12-30 06:32:05 +0100 |
commit | 339521b5448ae3f63b790f144976e78c9941ed33 (patch) | |
tree | 1c1b1f7576cabd871d57c5a35b65f912d386253f /sc/qa | |
parent | 4ebdadfda60f108556ea9cc4436dd440bf122ca4 (diff) |
add test for fdo#81195
Change-Id: If19f4067d53c2c614f6afcc0d6349db6ec2fd602
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xls/named-ranges-local.xls | bin | 0 -> 6144 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 23 |
2 files changed, 23 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/named-ranges-local.xls b/sc/qa/unit/data/xls/named-ranges-local.xls Binary files differnew file mode 100644 index 000000000000..7c39d204bb94 --- /dev/null +++ b/sc/qa/unit/data/xls/named-ranges-local.xls diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 703f90593ba9..bafe9921f883 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -88,6 +88,7 @@ public: //ods, xls, xlsx filter tests void testBasicCellContentODS(); void testRangeNameXLS(); + void testRangeNameLocalXLS(); void testRangeNameXLSX(); void testHyperlinksXLSX(); void testHardRecalcODS(); @@ -185,6 +186,7 @@ public: CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testBasicCellContentODS); CPPUNIT_TEST(testRangeNameXLS); + CPPUNIT_TEST(testRangeNameLocalXLS); CPPUNIT_TEST(testRangeNameXLSX); CPPUNIT_TEST(testHyperlinksXLSX); CPPUNIT_TEST(testHardRecalcODS); @@ -363,6 +365,27 @@ void ScFiltersTest::testRangeNameXLS() xDocSh->DoClose(); } +void ScFiltersTest::testRangeNameLocalXLS() +{ + ScDocShellRef xDocSh = loadDoc("named-ranges-local.", XLS); + xDocSh->DoHardRecalc(true); + + ScDocument& rDoc = xDocSh->GetDocument(); + ScRangeName* pRangeName = rDoc.GetRangeName(0); + CPPUNIT_ASSERT(pRangeName); + CPPUNIT_ASSERT_EQUAL(size_t(2), pRangeName->size()); + + OUString aFormula; + rDoc.GetFormula(3, 11, 0, aFormula); + CPPUNIT_ASSERT_EQUAL(OUString("=SUM(local_name2)"), aFormula); + ASSERT_DOUBLES_EQUAL(14.0, rDoc.GetValue(3, 11, 0)); + + rDoc.GetFormula(6, 4, 0, aFormula); + CPPUNIT_ASSERT_EQUAL(OUString("=local_name1"), aFormula); + + xDocSh->DoClose(); +} + void ScFiltersTest::testRangeNameXLSX() { ScDocShellRef xDocSh = loadDoc("named-ranges-global.", XLSX); |