Created attachment 58042 [details] calc example Problem description: Steps to reproduce: 1. Download file attached and start macro 'filter' OR 1. Open Calc and fill in cells A2:'1', A3:'libre' 2. Open Basic IDE, insert and start the following macro: Sub Filter Dim oFilterDef as Object 'Filterdescriptor Dim oFilterfield as Object 'Filterkriterium Dim oArea as Object 'Filterarea oFilterfield = createUnoStruct("com.sun.star.sheet.TableFilterField") With oFilterfield .Field = 0 .IsNumeric = False .Operator = com.sun.star.sheet.FilterOperator.EQUAL .NumericValue = 1 .StringValue = "libre" end with oArea = ThisComponent.Sheets.getbyIndex(0).getCellRangebyPosition(0, 0, 3, 6) oFilterDef = oArea.createFilterDescriptor(True) With oFilterDef .setFilterFields(Array(oFilterfield)) .ContainsHeader = True .UseRegularExpressions = False .IsCaseSensitive = False end with oArea.Filter(oFilterDef) end sub Current behavior: Macro filters the given .NumericValue (in the example it is set to '1' just for demonstration) Expected behavior: Macro should filter the .StringValue 'libre'. That works fine with LO 3.4, but not in version 3.5 (German). Struct com.sun.star.sheet.TableFilterField2 and com.sun.star.sheet.TableFilterField3 behave in the same way. Platform (if different from the browser): tested on WindowsXP and Ubuntu 11.10 Browser: Opera/9.80 (Windows NT 5.1; U; de) Presto/2.10.229 Version/11.61
Reproduced with LibO 3.5.2 on Debian wheezy.
Takeshi Abe committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=84a1ca6d9136c71bf20514307876824c1f915c0a fdo#46983 Macros: Macro to set filter in Calc does not work with .StringValue
Takeshi Abe committed a patch related to this issue. It has been pushed to "libreoffice-3-5": http://cgit.freedesktop.org/libreoffice/core/commit/?id=5920b681eaf2f1203efd5af581827db2e1a81bc8&g=libreoffice-3-5 fdo#46983 Macros: Macro to set filter in Calc does not work with .StringValue It will be available in LibreOffice 3.5.3.
This is fixed now.
Thanks for fixing this bug