diff options
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/ods/formula-quote-in-sheet-name.ods | bin | 0 -> 7044 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/formula-quote-in-sheet-name.ods b/sc/qa/unit/data/ods/formula-quote-in-sheet-name.ods Binary files differnew file mode 100644 index 000000000000..ef66f21e0ddd --- /dev/null +++ b/sc/qa/unit/data/ods/formula-quote-in-sheet-name.ods 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 |