To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=55913
Issue #:|55913
Summary:|OLE Automation Bridge doesn't convert properly a
|com.sun.star.lang.PropertyValue array
Component:|api
Version:|OOO 2.0 Beta2
Platform:|PC
URL:|
OS/Version:|Windows XP
Status:|UNCONFIRMED
Status whiteboard:|
Keywords:|
Resolution:|
Issue type:|DEFECT
Priority:|P3
Subcomponent:|code
Assigned to:|sw
Reported by:|jsanchezlara
------- Additional comments from [EMAIL PROTECTED] Thu Oct 13 04:37:04 -0700
2005 -------
I found this misfunctionality accessing to the OOo through OLE Automation Bridge
for manipulating the toolbars. According to the API defined for a
XIndexContainer implementation object, this method expects for 2 parameters: Any
Object and the index where the first one must be inserted (in the underlaying
data structure). The problem appears when for adding a item to a toolbar is
needed to use this method, passing it a com.sun.star.lang.PropertyValue array as
parameter (where it is defined the properties of a new toolbar item). Despite of
following the instructions described on the Developers Guide about how to
construct OOo specific objects and arrays for being used thrugh OLE Automation
Bridge, the problem appears when this method was called.
-ERROR REPRODUCTION-
Environment: Windows XP (SP1), OOo Beta 2, a minimal VB.NET application(*)
(*)
Private Sub createToolbarB_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles createToolbarB.Click
Dim objSM As Object = CreateObject("com.sun.star.ServiceManager")
Dim CoreRef As Object =
objSM.CreateInstance("com.sun.star.reflection.CoreReflection")
Dim classPV As Object =
CoreRef.forName("com.sun.star.beans.PropertyValue")
Dim aToolbarItemProp1 As Object
classPV.CreateObject(aToolbarItemProp1)
Dim aToolbarItemProp2 As Object
classPV.CreateObject(aToolbarItemProp2)
Dim aToolbarItemProp3 As Object
classPV.CreateObject(aToolbarItemProp3)
Dim properties As System.Array
properties = System.Array.CreateInstance(aToolbarItemProp1.GetType, 3)
aToolbarItemProp1.Name = "CommandURL"
aToolbarItemProp1.Value = "macro:///standard.module1.TestIt"
aToolbarItemProp2.Name = "Label"
aToolbarItemProp2.Value = "Test"
aToolbarItemProp3.Name = "Type"
aToolbarItemProp3.Value = 0
properties(0) = aToolbarItemProp1
properties(1) = aToolbarItemProp2
properties(2) = aToolbarItemProp3
Dim Doc As Object
Dim dummy As System.Array
Dim objDummy As Object = New Object()
dummy = System.Array.CreateInstance(objDummy.GetType, 0)
Doc =
objSM.createInstance("com.sun.star.frame.Desktop").loadComponentFromURL("private:factory/swriter",
"_blank", 2, dummy)
Dim LayoutManager As Object = Doc.currentController.Frame.LayoutManager
LayoutManager.createElement("private:resource/toolbar/user_toolbar1")
LayoutManager.showElement("private:resource/toolbar/user_toolbar1")
Dim ToolBar As Object =
LayoutManager.getElement("private:resource/toolbar/user_toolbar1")
Dim settings As Object = ToolBar.getSettings(True)
settings.insertByIndex(0, properties) '<== ERROR IS THROWN IN THIS LINE
ToolBar.setSettings(settings)
End Sub
The message error shown by application is following:
"com.sun.star.lang.IllegalArgumentException: Type must be
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >"
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]