summaryrefslogtreecommitdiff
path: root/sc/qa/unit/subsequent_export-test.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-02-15 09:34:57 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-02-15 10:14:11 -0500
commitf45ce989589654128c08294dd4e7ba5c89dcb255 (patch)
treed763f0f088d98222cd020cf36d3517b587d96a58 /sc/qa/unit/subsequent_export-test.cxx
parent7c7bddc9bb22088110544343e41cc185c615ab28 (diff)
fdo#74512: Add export test for this.
Change-Id: I7582ff84c3a31f294f241ca642915361509768a1
Diffstat (limited to 'sc/qa/unit/subsequent_export-test.cxx')
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 2db6307e5b51..26fc12a64997 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -67,6 +67,7 @@ public:
void testMiscRowHeightExport();
void testNamedRangeBugfdo62729();
void testRichTextExportODS();
+ void testFormulaRefSheetNameODS();
void testCellValuesExportODS();
void testCellNoteExportODS();
@@ -90,6 +91,7 @@ public:
CPPUNIT_TEST(testMiscRowHeightExport);
CPPUNIT_TEST(testNamedRangeBugfdo62729);
CPPUNIT_TEST(testRichTextExportODS);
+ CPPUNIT_TEST(testFormulaRefSheetNameODS);
CPPUNIT_TEST(testCellValuesExportODS);
CPPUNIT_TEST(testCellNoteExportODS);
CPPUNIT_TEST(testCellNoteExportXLS);
@@ -674,6 +676,30 @@ void ScExportTest::testRichTextExportODS()
xNewDocSh3->DoClose();
}
+void ScExportTest::testFormulaRefSheetNameODS()
+{
+ ScDocShellRef xDocSh = loadDoc("formula-quote-in-sheet-name.", ODS, true);
+ ScDocument* pDoc = xDocSh->GetDocument();
+
+ sc::AutoCalcSwitch aACSwitch(*pDoc, true); // turn on auto calc.
+ pDoc->SetString(ScAddress(1,1,0), "='90''s Data'.B2");
+ CPPUNIT_ASSERT_EQUAL(1.1, pDoc->GetValue(ScAddress(1,1,0)));
+ if (!checkFormula(*pDoc, ScAddress(1,1,0), "'90''s Data'.B2"))
+ CPPUNIT_FAIL("Wrong formula");
+
+ // Now, save and reload this document.
+ ScDocShellRef xNewDocSh = saveAndReload(xDocSh, ODS);
+ xDocSh->DoClose();
+
+ pDoc = xNewDocSh->GetDocument();
+ pDoc->CalcAll();
+ CPPUNIT_ASSERT_EQUAL(1.1, pDoc->GetValue(ScAddress(1,1,0)));
+ if (!checkFormula(*pDoc, ScAddress(1,1,0), "'90''s Data'.B2"))
+ CPPUNIT_FAIL("Wrong formula");
+
+ xNewDocSh->DoClose();
+}
+
void ScExportTest::testCellValuesExportODS()
{
// Start with an empty document