Bernard Marcelly skrev:
Message de Finn Gruwier Larsen date 2007-10-01 09:15 :
Thanks, Bernard, for correcting my syntax.
This was not syntax errors but misunderstanding of the API and of the
Python bridge routines. For what you are doing you need a lot of
knowledge in both.
True.
Anyway - OOo crashes when I run this code:
( ...)
spellcheckResult = spellchecker.isValid("word", locale)
When I run the equivalent code in Basic I get an exception, not a crash.
The exception says the number of arguments is incorrect (Arguments len
differ!).
I have implemented this macro in Basic already, and it works perfectly.
Just wanted to give Python a try...
Read again in the SDK the IDL description of .isValid() method : there
is a third argument. In the general case it is an empty array. This
should work better:
spellcheckResult = spellchecker.isValid("word", locale, ())
I know there are three arguments. In the Basic equivalent I wrote
something likes this:
Dim emptyArgs(0) As New com.sun.star.beans.PropertyValue
result = speller.isValid(word, locale, emptyArgs())
But I didn't know how to do that in Python, so I just guessed that the
third argument was optional (which would be reasonable, since it usually
contains no information). I think we can conclude that the third
argument is not optional - anyway, giving a wrong number of arguments
should not make OOo crash. Using () as a third argument doesn't change
this - OOo still crashes.
My conclusion is that Python in OOo is still premature and unstable, so
I'll probably have to stick with Basic for a while. Or maybe I'll give
Java a try - at least, there's a lot of documentation there.
Finn
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]