summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-09-13 13:17:05 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-09-13 16:24:09 +0200
commitded2c1eee423235bc26ff4ab467988ab286e59d4 (patch)
tree215c1aeaba0c749d56c2a8a5444dc82657d843f5
parent53165f584ff777df429fc43a451614d88914627d (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>
-rw-r--r--sc/qa/extras/macros-test.cxx29
-rw-r--r--sc/qa/extras/testdocuments/tdf144085.odsbin0 -> 10899 bytes
2 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;
diff --git a/sc/qa/extras/testdocuments/tdf144085.ods b/sc/qa/extras/testdocuments/tdf144085.ods
new file mode 100644
index 000000000000..2493695768b5
--- /dev/null
+++ b/sc/qa/extras/testdocuments/tdf144085.ods
Binary files differ