summaryrefslogtreecommitdiff
path: root/sc/qa/extras
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/extras')
-rw-r--r--sc/qa/extras/macros-test.cxx26
-rw-r--r--sc/qa/extras/testdocuments/tdf105558.odsbin0 -> 9459 bytes
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 06f921ca35e9..fa58d7e51f33 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -56,6 +56,7 @@ public:
void testTdf133887();
void testTdf133889();
void testTdf138646();
+ void testTdf105558();
CPPUNIT_TEST_SUITE(ScMacrosTest);
CPPUNIT_TEST(testStarBasic);
@@ -79,6 +80,7 @@ public:
CPPUNIT_TEST(testTdf133887);
CPPUNIT_TEST(testTdf133889);
CPPUNIT_TEST(testTdf138646);
+ CPPUNIT_TEST(testTdf105558);
CPPUNIT_TEST_SUITE_END();
};
@@ -1024,6 +1026,30 @@ void ScMacrosTest::testTdf138646()
pDocSh->DoClose();
}
+void ScMacrosTest::testTdf105558()
+{
+ OUString aFileName;
+ createFileURL(u"tdf105558.ods", aFileName);
+ auto xComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument");
+ CPPUNIT_ASSERT(xComponent);
+
+ SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent);
+ CPPUNIT_ASSERT(pFoundShell);
+
+ ScDocShellRef xDocSh = dynamic_cast<ScDocShell*>(pFoundShell);
+ CPPUNIT_ASSERT(xDocSh);
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 5.5
+ // - Actual : 0
+ CPPUNIT_ASSERT_EQUAL(5.5, rDoc.GetValue(ScAddress(0, 0, 0)));
+
+ css::uno::Reference<css::util::XCloseable> xCloseable(xComponent, css::uno::UNO_QUERY_THROW);
+ xCloseable->close(true);
+}
+
ScMacrosTest::ScMacrosTest()
: UnoApiTest("/sc/qa/extras/testdocuments")
diff --git a/sc/qa/extras/testdocuments/tdf105558.ods b/sc/qa/extras/testdocuments/tdf105558.ods
new file mode 100644
index 000000000000..0ea77ee66888
--- /dev/null
+++ b/sc/qa/extras/testdocuments/tdf105558.ods
Binary files differ