Kaydet (Commit) e4882717 authored tarafından Jan Kantert's avatar Jan Kantert Kaydeden (comit) Eike Rathke

add unittest for tdf#89330

Change-Id: I4c5c65733700e7e7245e96f85714221acf23bcfb
Reviewed-on: https://gerrit.libreoffice.org/14473Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst 0a9e7293
...@@ -151,6 +151,7 @@ public: ...@@ -151,6 +151,7 @@ public:
void testFormulaRefUpdateNameCopySheet(); void testFormulaRefUpdateNameCopySheet();
void testFormulaRefUpdateNameDelete(); void testFormulaRefUpdateNameDelete();
void testFormulaRefUpdateValidity(); void testFormulaRefUpdateValidity();
void testErrorOnExternalReferences();
void testMultipleOperations(); void testMultipleOperations();
void testFuncCOLUMN(); void testFuncCOLUMN();
void testFuncCOUNT(); void testFuncCOUNT();
...@@ -462,6 +463,7 @@ public: ...@@ -462,6 +463,7 @@ public:
CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet); CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet);
CPPUNIT_TEST(testFormulaRefUpdateNameDelete); CPPUNIT_TEST(testFormulaRefUpdateNameDelete);
CPPUNIT_TEST(testFormulaRefUpdateValidity); CPPUNIT_TEST(testFormulaRefUpdateValidity);
CPPUNIT_TEST(testErrorOnExternalReferences);
CPPUNIT_TEST(testMultipleOperations); CPPUNIT_TEST(testMultipleOperations);
CPPUNIT_TEST(testFuncCOLUMN); CPPUNIT_TEST(testFuncCOLUMN);
CPPUNIT_TEST(testFuncCOUNT); CPPUNIT_TEST(testFuncCOUNT);
......
...@@ -1384,6 +1384,23 @@ void Test::testFormulaRefUpdateRange() ...@@ -1384,6 +1384,23 @@ void Test::testFormulaRefUpdateRange()
m_pDoc->DeleteTab(0); m_pDoc->DeleteTab(0);
} }
void Test::testErrorOnExternalReferences()
{
// Test tdf#89330
m_pDoc->InsertTab(0, "Sheet1");
m_pDoc->SetString(ScAddress(0,0,0), "='file:///Path/To/FileA.ods'#$Sheet1.A1A");
ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(0,0,0));
CPPUNIT_ASSERT(pFC);
CPPUNIT_ASSERT_EQUAL(ScErrorCodes::errNoName, pFC->GetErrCode());
if (!checkFormula(*m_pDoc, ScAddress(0,0,0), "'file:///Path/To/FileA.ods'#$Sheet1.A1A"))
CPPUNIT_FAIL("Formula changed");
m_pDoc->DeleteTab(0);
}
void Test::testFormulaRefUpdateSheets() void Test::testFormulaRefUpdateSheets()
{ {
m_pDoc->InsertTab(0, "Sheet1"); m_pDoc->InsertTab(0, "Sheet1");
......
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