diff options
author | tushar <tusharrai282@gmail.com> | 2021-01-10 21:22:11 +0530 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-01-18 12:44:05 +0100 |
commit | 3b3591d3c127c306f4d5f6bbb34118b03c3124c0 (patch) | |
tree | f7e95f886626270848ae47add84817b31696d74a /sc | |
parent | 5405bd8cb81f09d1631aeebd95bd6b00926ae931 (diff) |
tdf#133887 Set flag of variable when formal parameter is not expecting variant.
If there is no param info for formal paramter then type of formal parameter and actual parameter will be same
and there is no need to set the flag in that case.
Change-Id: I12af64f82fc5b2d6d7fb920bde1cb96f8c7bd51b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109070
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/macros-test.cxx | 33 | ||||
-rw-r--r-- | sc/qa/extras/testdocuments/tdf133887.ods | bin | 0 -> 8465 bytes |
2 files changed, 33 insertions, 0 deletions
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index b5a48353b4e4..00c8474a38b6 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -52,6 +52,7 @@ public: void testTdf128218(); void testTdf71271(); void testTdf43003(); + void testTdf133887(); CPPUNIT_TEST_SUITE(ScMacrosTest); CPPUNIT_TEST(testStarBasic); @@ -70,6 +71,7 @@ public: CPPUNIT_TEST(testTdf128218); CPPUNIT_TEST(testTdf71271); CPPUNIT_TEST(testTdf43003); + CPPUNIT_TEST(testTdf133887); CPPUNIT_TEST_SUITE_END(); }; @@ -864,6 +866,37 @@ void ScMacrosTest::testTdf43003() xCloseable->close(true); } +void ScMacrosTest::testTdf133887() +{ + OUString aFileName; + createFileURL(u"tdf133887.ods", aFileName); + auto xComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument"); + + CPPUNIT_ASSERT_MESSAGE("Failed to load the doc", xComponent.is()); + + css::uno::Any aRet; + css::uno::Sequence<sal_Int16> aOutParamIndex; + css::uno::Sequence<css::uno::Any> aOutParam; + css::uno::Sequence<css::uno::Any> aParams{ css::uno::Any(sal_Int16(0)) }; + + SfxObjectShell::CallXScript( + xComponent, + "vnd.sun.Star.script:Standard.Module1.TestInvoke?language=Basic&location=document", aParams, + aRet, aOutParamIndex, aOutParam); + + double aReturnValue; + aOutParam[0] >>= aReturnValue; + + // Without the fix in place, this test would have failed with + // - Expected: 6.75 + // - Actual : 7 + + CPPUNIT_ASSERT_EQUAL(6.75, aReturnValue); + + 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/tdf133887.ods b/sc/qa/extras/testdocuments/tdf133887.ods Binary files differnew file mode 100644 index 000000000000..92d135f5834a --- /dev/null +++ b/sc/qa/extras/testdocuments/tdf133887.ods |