diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-09-13 13:17:05 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-09-13 16:24:09 +0200 |
commit | ded2c1eee423235bc26ff4ab467988ab286e59d4 (patch) | |
tree | 215c1aeaba0c749d56c2a8a5444dc82657d843f5 /sc/qa/extras/macros-test.cxx | |
parent | 53165f584ff777df429fc43a451614d88914627d (diff) |
tdf#144085: sc_macros_test: Add unittest
Change-Id: I8f5d8fa6efebaeb686baca280c7b9850a6192aad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122031
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/extras/macros-test.cxx')
-rw-r--r-- | sc/qa/extras/macros-test.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index 885c7d351f6e..50eba8cbc7b6 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -65,6 +65,7 @@ public: void testTdf105558(); void testTdf90278(); void testTdf143582(); + void testTdf144085(); void testMacroButtonFormControlXlsxExport(); CPPUNIT_TEST_SUITE(ScMacrosTest); @@ -92,6 +93,7 @@ public: CPPUNIT_TEST(testTdf105558); CPPUNIT_TEST(testTdf90278); CPPUNIT_TEST(testTdf143582); + CPPUNIT_TEST(testTdf144085); CPPUNIT_TEST(testMacroButtonFormControlXlsxExport); CPPUNIT_TEST_SUITE_END(); @@ -1024,6 +1026,33 @@ void ScMacrosTest::testTdf143582() xCloseable->close(true); } +void ScMacrosTest::testTdf144085() +{ + OUString aFileName; + createFileURL(u"tdf144085.ods", aFileName); + auto xComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument"); + + css::uno::Any aRet; + css::uno::Sequence<css::uno::Any> aParams; + css::uno::Sequence<css::uno::Any> aOutParam; + css::uno::Sequence<sal_Int16> aOutParamIndex; + + SfxObjectShell::CallXScript( + xComponent, + "vnd.sun.Star.script:Standard.Module1.TestScriptInvoke?language=Basic&location=document", + aParams, aRet, aOutParamIndex, aOutParam); + + OUString aReturnValue; + aRet >>= aReturnValue; + + // Without the fix in place, this test would have failed with + // - Expected: $Sheet1.$B$5:$E$17 + // - Actual : $Sheet1.$B$5:$C$10 + CPPUNIT_ASSERT_EQUAL(OUString("$Sheet1.$B$5:$E$17"), aReturnValue); + + css::uno::Reference<css::util::XCloseable> xCloseable(xComponent, css::uno::UNO_QUERY_THROW); + xCloseable->close(true); +} void ScMacrosTest::testTdf138646() { OUString aFileName; |