[api-dev] Optional Parameters in NetBeans

2009-10-28 Thread Irné Barnard
I'm trying to port one of my Basic macros for custom calc formulas to an UNO extension. So I tried to use NetBeans. Unfortunately some of the functions have optional parameters. I know that Java doesn't have such a thing as optional parameters. Does anyone know how I could do this? Simply

Re: [api-dev] Optional Parameters in NetBeans

2009-10-28 Thread Juergen Schmidt
Hi, i am not sure about which tutorial you are talking but it is quite simple. As the reference documentation of an addin (http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/AddIn.html) describes, optional parameters can be defined as a sequence of Any and that only as the last

Re: [api-dev] OpenOffice.org Basic - Sear ch and Replace in code…

2009-10-28 Thread Jan Holst Jensen
Andrew Douglas Pitonyak wrote: You should post your code... On 10/24/2009 06:05 AM, Johnny Rosenberg wrote: One example: Search for: ([a-zA-Z0-9\(\)])([\+|\-|\*|\/])([a-zA-Z0-9\(\)]) Replace with: $1 $2 $3 I tried this in OpenOffice.org Writer and it works perfectly. Before: a+b

Re: [api-dev] Optional Parameters in NetBeans

2009-10-28 Thread Irné Barnard
Thanks I tried that. The compile worked fine, however testing in OOo3.1 crashes if I use the formula wizard. Here's the code: IDL: string Num2Eng([in] double nValue, [in] sequence any sFormat); Java: public String Num2Eng(double nValue, Object[] sFormat) { String sResult = new

Re: [api-dev] Optional Parameters in NetBeans

2009-10-28 Thread Juergen Schmidt
i tried it with a OOo 3.1.1 and a development build dev300m61. Both works as expected. Have you used the NB plugin wizard to create your project? How does your CalcAddins.xcu looks like? Well i have no real idea what's going wrong in your case. Juergen Irné Barnard wrote: Thanks I tried

Re: [api-dev] Optional Parameters in NetBeans

2009-10-28 Thread Irné Barnard
Juergen Schmidt wrote: i tried it with a OOo 3.1.1 and a development build dev300m61. Both works as expected. Have you used the NB plugin wizard to create your project? How does your CalcAddins.xcu looks like? Well i have no real idea what's going wrong in your case. Juergen Irné

[api-dev] BASIC: Change toolbar button icon ?

2009-10-28 Thread Jan Holst Jensen
Hi all. I am trying to emulate a togglebutton/checkbox in a custom toolbar. Right now I have settled for having two toolbar buttons with different icons. Only one of them is visible and when it's pressed it toggles the visibility of both buttons using the code below (which sets visibility of

[api-dev] Re: How to copy all properties from a style

2009-10-28 Thread Michael Stahl
Laurent Godard wrote: Hi bernard newStyle.ParentStyle = oldStyle.Name oStyles.insertByName(myNewStyle, newStyle) does it work with different spreadsheets ? i'm not sure, i'll test when time but really not sure actually, i loop on all properties. that is the quickest way i explored

Re: [api-dev] OpenOffice.org Basic - Search and Repl ace in code…

2009-10-28 Thread Johnny Rosenberg
2009/10/28 Jan Holst Jensen j...@biochemfusion.com: Andrew Douglas Pitonyak wrote: You should post your code... On 10/24/2009 06:05 AM, Johnny Rosenberg wrote: One example: Search for: ([a-zA-Z0-9\(\)])([\+|\-|\*|\/])([a-zA-Z0-9\(\)]) Replace with: $1 $2 $3 I tried this in

[api-dev] Possible bug with MySQL and OOo ResultSet

2009-10-28 Thread Sergio Corato
I have this code: oStmt = oConn.createStatement() oStmt.setPropertyValue(ResultSetType, com.sun.star.sdbc.ResultSetType.SCROLL_INSENSITIVE) oStmt.setPropertyValue(ResultSetConcurrency, com.sun.star.sdbc.ResultSetConcurrency.READ_ONLY) oRs = oStmt.executeQuery(sql_string) oRs.next c =