Apache OpenOffice (AOO) Bugzilla – Issue 28900
I18N: make checkScriptType available via API
Last modified: 2013-02-24 21:09:36 UTC
Please make the mentioned function (or sth that can be used that way) available via API. When we implemented Hangul/Hanja conversion you said I should copy that code for the user dictionaries in order to be able to check the new entries properly for their scripttype. This worked fine until lately when you changed the ScriptTypeList due to a bug. With the change in I18N applied but not for the user dictionary code it was no longer possible to add words to a Hangul/Hanja user-defined conversion dictionary. In order to avoid this kind of problem I think it would be nice to have that function be part of the API or somewhere else in a project that I can link to. I think svtools would be suitable for the latter. Or maybe there should be a project like i18nimpl where all the non-API implementations go but that can be linked with other projects. That way we wouldn't need a new API for every new tiny thing we may like to have in the future (e.g. I remember to had use for a function that checks if a character is a white space in a specified language). Do you see other solutions for this? When you have implemented a function that I can call to check the scripttype please hand this bug to me in order to make the change in my code.
.
Karl->TL: ICU provides a function to check script type. Here is what I am going to change in checkScriptType(), #inlcude "unicode/uscript.h" sal_Int16 SAL_CALL checkScriptType(sal_Unicode c) throw (RuntimeException) { UErrorCode status = U_ZERO_ERROR; UScriptCode scriptCode = uscript_getScript(c, &status); if ( !U_SUCCESS(status) ) throw RuntimeException(); return scriptCode == USCRIPT_HANGUL ? SCRIPT_HANGUL : scriptCode == USCRIPT_HAN ? SCRIPT_HANJA : SCRIPT_OTHERS; } You could link icu library $(ICUUCLIB), which contains uscript_getScript(), unicode/uscript.h is exported by icu project.
Fixed in CWS gt08hangulhanja. Files changed: linguistic. - hhconvdic.cxx 1.2.4.2 - makefile.mk 1.13.4.1
TL: OK in CWS gt08hangulhanja
closing