Bug 164005 - Hyphenator service: can't call createPossibleHyphens until I call getLocales
Summary: Hyphenator service: can't call createPossibleHyphens until I call getLocales
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.4
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-23 04:36 UTC by Mike Kaganski
Modified: 2024-11-25 11:36 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-11-23 04:36:47 UTC
Consider this Basic code:


sub testHyphenator
 hyphenator = createUnoService("com.sun.star.linguistic2.Hyphenator")
 locale = new com.sun.star.lang.Locale
 locale.Language = "en"
 locale.Country = "US"
 result = hyphenator.createPossibleHyphens("hyphenate", locale, array())
 MsgBox IsNull(result)
 hyphenator.getLocales()
 result = hyphenator.createPossibleHyphens("hyphenate", locale, array())
 MsgBox IsNull(result)
 MsgBox result.getPossibleHyphens()
end sub

Restart LibreOffice (to make sure that hyphenation service has not yet been used), and run it in Basic IDE.
The first MsgBox shows an unexpected True.
Comment 1 Mike Kaganski 2024-11-23 06:17:38 UTC
https://gerrit.libreoffice.org/c/core/+/177076
Comment 2 Commit Notification 2024-11-23 09:03:54 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/29091962399dfae3707b1bbd981ce037c97684ec

tdf#164005: make sure to initialize locales before use of Hyphenator

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2024-11-24 10:29:13 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7eaf28b0a210a9ad7b22372a2a850a8c514d7593

tdf#164005: also initialize locales in hyphenate()

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2024-11-25 11:36:24 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/c899fd58d259c927aae1dcc73829b11252778b5f

tdf#164005: make sure to initialize locales before use of Hyphenator

It will be available in 24.8.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2024-11-25 11:36:29 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/da7ed89441a98adbba917fd9611c38415368a8b6

tdf#164005: also initialize locales in hyphenate()

It will be available in 24.8.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.