Hi,
the crash is a bug in the pyuno bridge, see
(http://qa.openoffice.org/issues/show_bug.cgi?id=82156). Anyway, you
code is still errornous, you have to replacce
locale = uno.getClass("com.sun.star.lang.Locale")
with
locale = uno.getClass("com.sun.star.lang.Locale")()
. And even nicer, you should write
import uno
from com.sun.star.lang import Locale
def main():
currentContext = XSCRIPTCONTEXT.getComponentContext()
smgr = currentContext.ServiceManager
spellchecker = \
smgr.createInstanceWithContext("com.sun.star.linguistic2.SpellChecker",\
currentContext)
spellcheckResult = spellchecker.isValid( \
"word", Locale("da","DK",""),())
print spellcheckResult
Bye,
Joerg
Finn Gruwier Larsen wrote:
Thanks, Bernard, for correcting my syntax. I have tried different
syntaxes, but now I at least know what the syntax *should* look like :-)
Anyway - OOo crashes when I run this code:
import uno
def main():
currentContext = XSCRIPTCONTEXT.getComponentContext()
smgr = currentContext.ServiceManager
spellchecker =
smgr.createInstanceWithContext("com.sun.star.linguistic2.SpellChecker",
currentContext)
locale = uno.getClass("com.sun.star.lang.Locale")
locale.Language = "da"
locale.Country = "DK"
spellcheckResult = spellchecker.isValid("word", locale)
Finn
---------------------------------------------------------------------
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]