<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Support For Each loop for objects exposing XIndexAccess"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=130307">130307</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Support For Each loop for objects exposing XIndexAccess
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>BASIC
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mikekaganski@hotmail.com
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>