To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=84040
Issue #|84040
Summary|allow to create Exception instances in Basic
Component|scripting
Version|OOo 2.3
Platform|All
URL|
OS/Version|All
Status|NEW
Status whiteboard|
Keywords|
Resolution|
Issue type|PATCH
Priority|P3
Subcomponent|code
Assigned to|ab
Reported by|fs
------- Additional comments from [EMAIL PROTECTED] Wed Nov 28 11:20:56 +0000
2007 -------
With
Dim oFoo as new com.sun.star.module.Foo
it is possible in Basic to create instances of the css.module.Foo type, provided
it is a UNO structure. Also, there exists a method CreateUnoStruct, taking the
name of the structure to create.
For some purposes, it is useful to also be able to create instances of
*exceptions* in Basic. For instances, there is an UNO service in css.sdb which
takes a css.sdbc.SQLException as parameter. Normally, this property is filled
with errors got elsewhere, but sometimes, I wish to fill it with a newly created
exception instance for testing purposes.
Sadly, attempts to do
(1) Dim oError as new com.sun.star.sdbc.SQLException
or
(2) Dim oError as Object
oError = CreateUnoStruct( "com.sun.star.sdbc.SQLException" )
don't work at all - the former yields a compile-time error, the latter simply
creates a NULL object.
Technically, the only difference between exceptions and structs in UNO is that
the former can be thrown, where the latter can't. Besides this, they're both a
collection of fields. So, I don't see a reason why (1) from above should not
work.
The attached patch implements this.
---------------------------------------------------------------------
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]