[Libreoffice-commits] core.git: sc/qa

Jan Kantert jan-lo at kantert.net
Fri Feb 13 08:30:32 PST 2015


 sc/qa/unit/ucalc.hxx         |    2 ++
 sc/qa/unit/ucalc_formula.cxx |   17 +++++++++++++++++
 2 files changed, 19 insertions(+)

New commits:
commit e4882717f3dc0375e113ed692374870ab8302a16
Author: Jan Kantert <jan-lo at kantert.net>
Date:   Fri Feb 13 14:39:00 2015 +0100

    add unittest for tdf#89330
    
    Change-Id: I4c5c65733700e7e7245e96f85714221acf23bcfb
    Reviewed-on: https://gerrit.libreoffice.org/14473
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 867b275..4e69a81 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 ca731a2..9eea4a3 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");


More information about the Libreoffice-commits mailing list