Apache OpenOffice (AOO) Bugzilla – Issue 70645
XScriptProvider is seen in Basic as incorrect object
Last modified: 2017-07-14 15:25:24 UTC
1 - Basic code: Dim sp as variant, v as variant sp = thisComponent.getScriptProvider() v = sp.ElementNames The last instruction throws Basic runtime error: Inadmissible value or data type. Index out of defined range. Yet, Introspection/reflection says property ElementNames do exist in the object and it is an array of strings. 2 - Basic code: dim sp as variant, s as string sp = thisComponent.getScriptProvider() s = sp.DBG_Properties The last instruction throws Basic runtime error: An exception occurred Type: Unknown Message: PackageMasterScriptProvider is unitialised. In fact you get the same error message for any inexistent property like sp.xyz The message is incorrect and DBG_xxx properties should be supported for Basic.
jsc -> ab: Andreas can you please take a look on it
getScriptProvider is implemented in sfxbasemodel.cxx. Not sure if this is a framework or scripting framework problem. 2,x
set target from 2.x to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Reset assigne to the default "issues@openoffice.apache.org".
Confirmed with AOO 4.1.3 A workaround is to use getChildNodes method: oDoc = thisComponent() oSP = oDoc.getScriptProvider() Elems = oSP.getChildNodes() For each Elem in Elems() sOut = sOut & Elem.name & chr(10) Next msgBox sOut