Kaydet (Commit) 0aefc72f authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

correct test for fdo#81195

Change-Id: I961603e3ea20aae4f12705c2656864dcbe8e1eca
üst 339521b5
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment