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

            Bug ID: 130307
           Summary: Support For Each loop for objects exposing
                    XIndexAccess
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: mikekagan...@hotmail.com

Currently it's impossible to iterate over objects contained in UNO objects
exposing XIndexAccess

E.g., execute this macro in a writer document:

Sub bookmks
oDoc=thisComponent
bookmarks = oDoc.Bookmarks
For Each bookmark in bookmarks()
    print bookmark.Name
Next bookmark
End Sub

This fails on "For Each" with "Inadmissible value or data type. Data type
mismatch." error. One needs to use index access:

Sub bookmks1
oDoc=thisComponent
bookmarks = oDoc.Bookmarks
For i = 0 to bookmarks.Count-1
    print bookmarks.getByIndex(i).Name
Next i
End Sub

I suppose that having the syntactic sugar for objects exposing XIndexAccess
would be nice.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to