1 # -*- mode: python ; coding: utf-8 -*-
3 # Copyright (c) 2008 by Hartmut Goebel <h.goebel@goebel-consult.de>
4 # Licenced under the GNU General Public License v3 (GPLv3)
5 # see file LICENSE-gpl-3.0.txt
8 __author__ = "Hartmut Goebel <h.goebel@goebel-consult.de>"
9 __copyright__ = "Copyright (c) 2008 by Hartmut Goebel <h.goebel@goebel-consult.de>"
10 __licence__ = "GPLv3 - GNU General Public License v3"
13 from com.sun.star.beans import PropertyValue
15 def iter(elems, prefix=''):
16 # todo: getByIndex verwenden??
17 if hasattr(elems, 'createEnumeration'):
18 enumerator = elems.createEnumeration()
19 while enumerator.hasMoreElements():
20 yield enumerator.nextElement()
22 for name in elems.ElementNames:
23 if name.startswith(prefix):
24 yield elems.getByName(name)
27 return [PropertyValue(k, 0, v,0)
28 for k,v in dict.iteritems()]