Bug 56392 - Writer: hyphenation is not always used in line break algorithm
Summary: Writer: hyphenation is not always used in line break algorithm
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.3.0
Keywords:
Depends on:
Blocks: mab4.0
  Show dependency treegraph
 
Reported: 2012-10-25 13:18 UTC by stfhell
Modified: 2014-06-30 23:17 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Package with test file and screenshots (307.69 KB, application/zip)
2012-10-25 13:18 UTC, stfhell
Details
test file with different test cases (14.11 KB, application/vnd.oasis.opendocument.text)
2013-09-26 10:30 UTC, László Németh
Details
screenshots (bad and fixed hyphenation) (77.57 KB, image/png)
2013-09-26 10:31 UTC, László Németh
Details
More test cases (with regressions of the first patch) (36.57 KB, application/vnd.oasis.opendocument.text)
2014-05-29 07:26 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stfhell 2012-10-25 13:18:48 UTC
Created attachment 69068 [details]
Package with test file and screenshots

Writer sometimes breaks a paragraph into lines without trying to hyphenate words.

In a German language text with enabled hyphenation, Writer spontaneously ignores hyphenation possibilities for some words. "Spontaneously" meaning that I have never been able to find out when or why this happens.

Attached document shows this: The 5th word could be hyphenated („un-un-ter-bro-chen“) but is not (screenshot 1). Hyphenation just does not work with this word, other words in the paragraph are hyphenated.
If you omit the quotation marks around the word, LO hyphenates it correctly (screenshot 2). The quotation marks cannot generally be a problem, however, because if you make a new paragraph containing
„ununterbrochen“, „ununterbrochen“, „ununterbrochen“, „ununterbrochen“
the word is hyphenated again.

Tested with LO 3.5.4.2 and 3.6.2.2 under Ubuntu 12.04 64/32 bit. But the bug is probably rather old. I had a similar problem nearly 2 years ago with OpenOffice: In a complex 2-column document, OpenOffice suddenly did not use hyphenation to a very large degree. Sometimes I could make it hyphenate by just adding text to a paragraph (even if I deleted it again afterwards), sometimes I had to insert soft hyphens manually. This may be related to the same bug.
Comment 1 Thomas Hackert 2013-06-25 08:32:40 UTC
Hello stfhell,
I have tested your bug with LO Version: 4.1.0.1 Build ID: 1b3956717a60d6ac35b133d7b0a0f5eb55e9155 and installed Germanophone help- as well as langpack under Debian Testing AMD64. I can confirm it either with your attached document as well with one, I have created myself ... :( And there is no difference, if the text is – like in your document – centered nor left aligned ... :( I have also used "Tools - Language - Hyphenation..." to force it, but to no avail ... :(

Interestingly, if I open your document in LO Version 4.0.4.2 (Build ID: 9e9821abd0ffdbc09cd8c52eaa574fa09eb08f2) w/ installed Germanophone lang- as well as helppack, all is well ... ;) Could you confirm it?

So I change your bug to "New" to hopefully get it to the attention of the developers ... ;)

Sorry for the inconvenience
Thomas.
Comment 2 Michael Meeks 2013-07-01 21:11:05 UTC
A MAB for 4.1 involving hyphenation - I forget who the expert is here :-) help appreciated identifing someone good for this.
Comment 3 Jacques Guilleron 2013-07-01 22:52:01 UTC
Hi Michael,

László Németh, perhaps?

Jacques
Comment 4 László Németh 2013-07-02 10:51:05 UTC
This is not a regression, “only” an annoying hyphenation bug. It seems, the algorithm doesn't care about the non-breaking sequence of punctuation marks, only the first punctuation mark, ie. „ununterbrochen“ with its closing quotation mark seems to fit perfectly in the previous line without hyphenation, but with the full stop the result will be bad.

I will try to fix the problem.

Workaround: add a neutral character formatting boundary to the closing quotation mark, ie. Upper case character formatting.
Comment 5 Michael Meeks 2013-07-02 12:35:33 UTC
a non-regression; if so IFF it is a MAB - it should be for 3.6 - so updating it thus; we need to focus only on bugs specific to 4.1 in that tracker :-) thanks.
Comment 6 tommy27 2013-08-03 17:45:47 UTC
moving from the mab3.6 page to the mab4.0 collection.
Comment 7 László Németh 2013-09-17 00:39:06 UTC
A real workaround: use Unicode character "word joiner" (U+2060) at punctuation marks.

I will fix this problem soon trying to solve a similar hyphenation bug (words with hyphen characters), too.
Comment 8 Commit Notification 2013-09-26 08:41:35 UTC
Laszlo Nemeth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=968f4d72a23bb28d097a7694d66f0b866b3b33f0

fdo#56392 fix hyphenation of words with punctuation



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 László Németh 2013-09-26 10:30:15 UTC
Created attachment 86631 [details]
test file with different test cases
Comment 10 Commit Notification 2013-09-26 10:30:39 UTC
Laszlo Nemeth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=634f1d11d2a027887807494b3ca67f33825d5d23

fdo#56392 fix hyph. of words with single punctuation marks



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 László Németh 2013-09-26 10:31:13 UTC
Created attachment 86632 [details]
screenshots (bad and fixed hyphenation)
Comment 12 László Németh 2013-09-26 10:35:12 UTC
Fixed this problem and the other one (compound words with hyphen signs) in master.
Comment 13 László Németh 2013-09-26 12:09:29 UTC
A post about the fix: http://libreoffice.hu/2013/09/26/better-document-layout-interoperability-by-fixing-old-and-ugly-hyphenation-bugs/

stfhell: many thanks for your bug report!
Comment 14 László Németh 2014-05-29 07:26:49 UTC
Created attachment 100082 [details]
More test cases (with regressions of the first patch)
Comment 15 László Németh 2014-05-29 07:48:28 UTC
The previous patch is removed from LibreOffice (except its hard hyphen related part), because it had regressions, see Bug 79372.
Comment 16 László Németh 2014-06-30 23:17:10 UTC
Minor modification of the original patch has solved this bug and the regression reported in Bug 79372 (see there).