Issue 70645 - XScriptProvider is seen in Basic as incorrect object
Summary: XScriptProvider is seen in Basic as incorrect object
Status: ACCEPTED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows XP
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-20 12:27 UTC by bmarcelly
Modified: 2017-07-14 15:25 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.3
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bmarcelly 2006-10-20 12:27:37 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.
Comment 1 jsc 2006-10-20 13:06:49 UTC
jsc -> ab: Andreas can you please take a look on it
Comment 2 ab 2006-10-27 14:20:34 UTC
getScriptProvider is implemented in sfxbasemodel.cxx. Not sure if
this is a framework or scripting framework problem. 2,x
Comment 3 Martin Hollmichel 2007-11-09 17:27:54 UTC
set target from 2.x to 3.x according to
http://wiki.services.openoffice.org/wiki/Target_3x
Comment 4 Marcus 2017-05-20 11:27:42 UTC
Reset assigne to the default "issues@openoffice.apache.org".
Comment 5 oooforum (fr) 2017-07-14 15:24:57 UTC
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