Symptoms: The attached code returns 'ra=dio'. Expected behaviour: The word 'radio' shouldn't be hyphenated. Steps to reproduce: Execute the attached code. Thanks, Stephan Hennig Sub Main Dim oHyphen As Object Dim oLocale As New com.sun.star.lang.Locale Dim emptyArgs(2) As New com.sun.star.beans.PropertyValue emptyArgs(0).Name = "HyphMinLeading" emptyArgs(0).Value = 4 emptyArgs(1).Name = "HyphMinTrailing" emptyArgs(1).Value = 4 emptyArgs(2).Name = "HyphMinWordLength" emptyArgs(2).Value = 9 Dim vReturn Dim sWord, sHyphWord As String Dim msg As String oHyphen = createUnoService("com.sun.star.linguistic2.Hyphenator") oLocale.Language = "en" oLocale.Country = "US" sWord = "radio" vReturn = oHyphen.createPossibleHyphens(sWord, oLocale, emptyArgs()) If IsNull(vReturn) Then sHyphWord = "Null" Else sHyphWord = vReturn.getPossibleHyphens() End If msg = "Hyphenating " & sWord & CHR$(10) & _ "Result: " & sHyphWord & CHR$(10) MsgBox msg, 0, "Hyphenate Words" End Sub
lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx Hyphenator::createPossibleHyphens is the implementation of createPossibleHyphens and forwards the details to "libhyphen", a standalone hyphenation project. Debug to find out if the passed in values are given to Hyphenator::createPossibleHyphens as expected, more than likely the issue is either that hnj_hyphen_hyphenate3 doesn't honour it, or the dictionary override it, or something of that nature. The language may matter also.
hum, looks like the settings stuff in hyphenation will only use the optimized "name already mapped to number" case, not the "name only" path, or some such, this is fixable anyway
here's a hackaround, the "Handle"s 6,7,8 are from my dev build, they may change between versions, i.e. they're an internal speedup. But it might work for you as a temporary workaround Sub Main Dim oHyphen As Object Dim oLocale As New com.sun.star.lang.Locale Dim emptyArgs(2) As New com.sun.star.beans.PropertyValue emptyArgs(0).Name = "HyphMinLeading" emptyArgs(0).Value = 4 emptyArgs(0).Handle = 6 emptyArgs(1).Name = "HyphMinTrailing" emptyArgs(1).Value = 4 emptyArgs(1).Handle = 7 emptyArgs(2).Name = "HyphMinWordLength" emptyArgs(2).Value = 9 emptyArgs(2).Handle = 8 Dim vReturn Dim sWord, sHyphWord As String Dim msg As String oHyphen = createUnoService("com.sun.star.linguistic2.Hyphenator") oLocale.Language = "en" oLocale.Country = "US" sWord = "radio" vReturn = oHyphen.createPossibleHyphens(sWord, oLocale, emptyArgs()) If IsNull(vReturn) Then sHyphWord = "Null" Else sHyphWord = vReturn.getPossibleHyphens() End If msg = "Hyphenating " & sWord & CHR$(10) & _ "Result: " & sHyphWord & CHR$(10) MsgBox msg, 0, "Hyphenate Words" End Sub
http://cgit.freedesktop.org/libreoffice/core/commit/?id=be26307116092a844ce97115fe7f5a2f0b2bd53d should fix this specific problem anyway (for 3.5).
Confirmed, I cannot reproduce the wrong hyphenation anymore. LibO 3.5 RC2 on Windows XP Thanks, Stephan Hennig