https://bugs.freedesktop.org/show_bug.cgi?id=46983

             Bug #: 46983
           Summary: Macros: Macro to set filter in Calc does not work with
                    .StringValue
    Classification: Unclassified
           Product: LibreOffice
           Version: LibO 3.5.0 Release
          Platform: Other
        OS/Version: All
            Status: UNCONFIRMED
 Status Whiteboard: BSA
          Severity: normal
          Priority: medium
         Component: BASIC
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created attachment 58042
  --> https://bugs.freedesktop.org/attachment.cgi?id=58042
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

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to