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>
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 2630484..af619d1 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
index 9553ba9..f16d8b1 100644
--- a/sc/qa/extras/testdocuments/tdf107885.xlsm
+++ b/sc/qa/extras/testdocuments/tdf107885.xlsm
Binary files differ