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

Markus Mohrhard markus.mohrhard at collabora.co.uk
Mon Dec 29 21:54:42 PST 2014


 sc/qa/unit/subsequent_export-test.cxx |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

New commits:
commit 0aefc72fd42e744beb218c14121147bfcef89ca3
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Dec 30 06:48:08 2014 +0100

    correct test for fdo#81195
    
    Change-Id: I961603e3ea20aae4f12705c2656864dcbe8e1eca

diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 1727d30..57ff3b2 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();


More information about the Libreoffice-commits mailing list