diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-12-30 06:48:08 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-12-30 06:54:11 +0100 |
commit | 0aefc72fd42e744beb218c14121147bfcef89ca3 (patch) | |
tree | b4a26f073d76ab01456efa2b3b0eabb3bbbc8e3b | |
parent | 339521b5448ae3f63b790f144976e78c9941ed33 (diff) |
correct test for fdo#81195
Change-Id: I961603e3ea20aae4f12705c2656864dcbe8e1eca
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 1727d30c959b..57ff3b224855 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -136,6 +136,7 @@ public: void testImageWithSpecialID(); void testSupBookVirtualPath(); + void testSheetLocalRangeNameXLS(); CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); @@ -182,6 +183,7 @@ public: CPPUNIT_TEST(testSwappedOutImageExport); CPPUNIT_TEST(testLinkedGraphicRT); CPPUNIT_TEST(testImageWithSpecialID); + CPPUNIT_TEST(testSheetLocalRangeNameXLS); CPPUNIT_TEST_SUITE_END(); @@ -2491,6 +2493,30 @@ void ScExportTest::testImageWithSpecialID() } } +void ScExportTest::testSheetLocalRangeNameXLS() +{ + ScDocShellRef xDocSh = loadDoc("named-ranges-local.", XLS); + xDocSh->DoHardRecalc(true); + ScDocShellRef xDocSh2 = saveAndReload(xDocSh, XLS); + xDocSh->DoClose(); + xDocSh2->DoHardRecalc(true); + + ScDocument& rDoc = xDocSh2->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); + + xDocSh2->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |