About Linguistic2::getHyphenationPositions()

Stephan Bergmann sbergman at redhat.com
Mon Jun 1 00:45:13 PDT 2015


On 06/01/2015 01:38 AM, Matteo Casalin wrote:
>      while converting some sal_uInt16 to sal_Int32 in
> cui/source/dialogs/hyphen.cxx, I noticed that getHyphenationPositions()
> returns a sequence of short/sal_Int16. The surrounding code suggests
> that sal_Int32 would be more appropriate, but I see that this function
> is listed in some .idl files and I can't say if changing it would break
> some published API.

Looking at cui/source/dialogs/hyphen.cxx, you probably mean method 
getHyphenationPositions of UNO interface 
css.linguistic2.XPossibleHyphens.  Which is indeed published, so cannot 
be changed, for backwards compatibility.

So if there is really convincing reason to change this to e.g. 
sequence<long>, either introduce a css.linguistic2.XPossibleHyphens2 
etc. or discuss what the implications would be of incompatibly changing 
css.linguistic.XPossibleHyphens.

Otherwise, best document that getHyphenationPositions unfortunately has 
a poor return type for historic reasons, and ensure that its 
implementations do reasonable things (e.g., do not include too large 
positions in the returned sequence but emit a SAL_WARN instead).


More information about the LibreOffice mailing list