diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2020-07-13 21:58:37 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-07-15 19:51:23 +0200 |
commit | f013b5127e3048914d829cf918df2a43f133d108 (patch) | |
tree | 08c1d9808c5920db3612f114c8071bdfddd637c6 /sc | |
parent | 81a60c1589593504bad27558f0c9f20861b9752c (diff) |
tdf#107885: sc_macros_test: Add unittest
Split unit test for auto filter into two separate functions testing
string and numeric conditions.
Change-Id: I940718215bf3d1de490726a6e430b3cdd7b62f2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98694
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/macros-test.cxx | 14 | ||||
-rw-r--r-- | sc/qa/extras/testdocuments/tdf107885.xlsm | bin | 7917 -> 15021 bytes |
2 files changed, 13 insertions, 1 deletions
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index 2630484e4122..af619d12459c 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -388,9 +388,10 @@ void ScMacrosTest::testTdf107885() CPPUNIT_ASSERT(!rDoc.RowHidden(3,0)); CPPUNIT_ASSERT(!rDoc.RowHidden(4,0)); + // Call auto filter macro using a string condition SfxObjectShell::CallXScript( xComponent, - "vnd.sun.Star.script:VBAProject.Module1.AF?language=Basic&location=document", + "vnd.sun.Star.script:VBAProject.Module1.AFString?language=Basic&location=document", aParams, aRet, aOutParamIndex, aOutParam); //Without the fix in place, all rows in autofilter would have been hidden @@ -399,6 +400,17 @@ void ScMacrosTest::testTdf107885() CPPUNIT_ASSERT(!rDoc.RowHidden(3,0)); CPPUNIT_ASSERT(!rDoc.RowHidden(4,0)); + // Call auto filter macro using a numeric condition without any locale + SfxObjectShell::CallXScript( + xComponent, + "vnd.sun.Star.script:VBAProject.Module1.AFNumeric?language=Basic&location=document", + aParams, aRet, aOutParamIndex, aOutParam); + + CPPUNIT_ASSERT(rDoc.RowHidden(1,0)); + CPPUNIT_ASSERT(rDoc.RowHidden(2,0)); + CPPUNIT_ASSERT(!rDoc.RowHidden(3,0)); + CPPUNIT_ASSERT(!rDoc.RowHidden(4,0)); + pDocSh->DoClose(); } diff --git a/sc/qa/extras/testdocuments/tdf107885.xlsm b/sc/qa/extras/testdocuments/tdf107885.xlsm Binary files differindex 9553ba9d88ca..f16d8b1b3837 100644 --- a/sc/qa/extras/testdocuments/tdf107885.xlsm +++ b/sc/qa/extras/testdocuments/tdf107885.xlsm |