I fully agree with Paolo, this kind of API is a complex solution to a simple
need.
I tried to make it work like this:
Dim keyType As Object, valueType As Object, reflect As Object
reflect = CreateUnoService("com.sun.star.reflection.CoreReflection")
keyType = reflect.forName("string")
valueType = reflect.forName("long")
enuMap = com.sun.star.container.EnumerableMap.create(keyType, valueType)
' --> error : com.sun.star.uno.Type expected.
If you look at the mapping of simple types for Basic in the Dev'Guide
<http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Basic/Mapping_of_Simple_Types>
you see that the UNO "type" is mapped in Basic to
com.sun.star.reflection.XIdlClass
So my code (and yours) should be accepted.
Regards
Bernard
Message de Ariel Constenla-Haile date 2010-12-19 02:00 :
On Saturday 18 December 2010, 21:34:00, Ariel Constenla-Haile wrote:
IMHO the wrong choice was to use the UNO type instead of
com.sun.star.uno.TypeClass.
With TypeClass and the support for new-style service constructor, it could
have been as simple as:
Dim aMap
aMap = com.sun.star.container.EnumerableMap.create(_
com.sun.star.uno.TypeClass.SHORT,_
com.sun.star.uno.TypeClass.STRING)
looking at
http://api.openoffice.org/docs/common/ref/com/sun/star/container/EnumerableMap.html
I see this won't work, because the EnumerableMap also takes other types than
simple ones, like ENUM and INTERFACE; sure in this cases the UNO type is need
and the uno.TypeClass is not enough.
Regards
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org