andreas542 Newbie

Joined: 30 Dec 2010 Posts: 2
|
Posted: Thu Dec 30, 2010 3:12 am Post subject: [OLE] Spellcheck issues using Swedish dictionary |
|
|
Hi! I've been developing a PowerBuilder application which used OpenOffice for spellchecking of text in a text box. I've created a locale and used this to set up the spellchecker as follows:
| Code: |
string ls_exceptionMsg, ls_language, ls_dialect, ls_variant
ls_language = "sv"
ls_dialect = "SE"
ls_variant = ""
OLEObject lo_locale
lo_localClass = io_coreReflection.forName( 'com.sun.star.lang.Locale')
lo_localClass.CreateObject( REF lo_locale )
lo_locale.Language = ls_language
lo_locale.Country = ls_dialect
lo_locale.Variant = ls_variant
OLEObject lo_propertyValue[]
io_propertyClass.CreateObject(REF lo_propertyValue[1])
OLEObject lo_LSM
lo_LSM = io_servicemanager.CreateInstance("com.sun.star.linguistic2.LinguServiceManager")
OLEObject lo_spellchecker
lo_spellchecker = lo_LSM.getspellchecker()
any la_tempReturn
//Simple test to check spellchecker is set up correctly
la_tempReturn = lo_spellchecker.spell( "bol" ,lo_locale , lo_propertyValue)
IF NOT isValid(la_tempReturn) THEN
RETURN FAILURE
END IF |
The above code also does a quick spellcheck test with the string "bol" which is not a valid word. The code works perfectly (i.e. does not return FAILURE) if the language string used is "en" with country code "US", but "sv" "SE" does not. I've checked the word "bol" in the OpenOffice software and the spellchecker makes about 10 word suggestions in Swedish.
I've checked with the ISO codes I found in another thread and "sv" "SE" is the right combination for Swedish, and I've also followed this thread:
http://user.services.openoffice.org/en/forum/viewtopic.php?f=74&t=16512 and ensured that my dictionary is correctly installed and configured.
What might the problem be?
Thanks! |
|