[Libreoffice-bugs] [Bug 144245] New: Unlike VBA, the 'Key' string parameter of the 'Add' method of the 'Collection' object, although case insensitive, is only for ANSII characters.

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Sep 1 18:32:24 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=144245

            Bug ID: 144245
           Summary: Unlike VBA, the 'Key' string parameter of the 'Add'
                    method of the 'Collection' object, although case
                    insensitive, is only for ANSII characters.
           Product: LibreOffice
           Version: 7.2.0.4 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: eeigor at inbox.ru

Description:
The heading reflects the problem.
The Collection object is not documented, but works well in native mode.

Steps to Reproduce:
1. Create an instance of the 'Collection' object.
2. Add two items to the collection using the key as non-ANSII characters, such 
   as "Д" and "д" (Cyrillic).
3. Sample code is shown below.

Actual Results:
Both items will be added without error.

Expected Results:
Duplicate key error should occur when adding the second item.


Reproducible: Always


User Profile Reset: No



Additional Info:
A similar problem:
https://bugs.documentfoundation.org/show_bug.cgi?id=132389

VBA code. Compare:

    Sub Test_Collection()
        Dim c As Collection, item

        On Error Resume Next
        Set c = New Collection
        c.Add 1, "D"
        c.Add 2, "d"
        c.Add 3, "Д"  'Cyrillic
        c.Add 4, "д"  'Cyrillic; for LibreOffice you have to set: UCase("д")
        On Error GoTo 0

        Debug.Print "Count: " & c.Count
        For Each item In c
            Debug.Print item
        Next
    End Sub

OUTPUT
Count: 2
1
3

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210901/c7d3e411/attachment.htm>


More information about the Libreoffice-bugs mailing list