summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kantert <jan-lo@kantert.net>2015-02-13 14:39:00 +0100
committerEike Rathke <erack@redhat.com>2015-02-13 16:30:00 +0000
commite4882717f3dc0375e113ed692374870ab8302a16 (patch)
tree1c626a3f22e92cf530ff2b79f5e79b6327ac98da
parent0a9e7293a570da8a36b2ac4fd1c4a22d6bc084f2 (diff)
add unittest for tdf#89330
Change-Id: I4c5c65733700e7e7245e96f85714221acf23bcfb Reviewed-on: https://gerrit.libreoffice.org/14473 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/qa/unit/ucalc.hxx2
-rw-r--r--sc/qa/unit/ucalc_formula.cxx17
2 files changed, 19 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 867b27597732..4e69a8165bb1 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -151,6 +151,7 @@ public:
void testFormulaRefUpdateNameCopySheet();
void testFormulaRefUpdateNameDelete();
void testFormulaRefUpdateValidity();
+ void testErrorOnExternalReferences();
void testMultipleOperations();
void testFuncCOLUMN();
void testFuncCOUNT();
@@ -462,6 +463,7 @@ public:
CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet);
CPPUNIT_TEST(testFormulaRefUpdateNameDelete);
CPPUNIT_TEST(testFormulaRefUpdateValidity);
+ CPPUNIT_TEST(testErrorOnExternalReferences);
CPPUNIT_TEST(testMultipleOperations);
CPPUNIT_TEST(testFuncCOLUMN);
CPPUNIT_TEST(testFuncCOUNT);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index ca731a232bb5..9eea4a32d4a0 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -1384,6 +1384,23 @@ void Test::testFormulaRefUpdateRange()
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()
{
m_pDoc->InsertTab(0, "Sheet1");