Bug 152952 - FILEOPEN RTF Hyperlinks text is hyphenated
Summary: FILEOPEN RTF Hyperlinks text is hyphenated
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0 all versions
Hardware: All All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:7.6.0 target:7.5.1
Keywords:
Depends on:
Blocks: RTF-Paragraph
  Show dependency treegraph
 
Reported: 2023-01-09 22:59 UTC by Gabor Kelemen (allotropia)
Modified: 2023-01-19 12:42 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file with document level hyphenation enabled (58.57 KB, application/msword)
2023-01-09 22:59 UTC, Gabor Kelemen (allotropia)
Details
The example file in Word 2016 and Writer (203.52 KB, image/png)
2023-01-09 23:01 UTC, Gabor Kelemen (allotropia)
Details
Another example file made in Word from scratch (42.60 KB, application/msword)
2023-01-10 10:45 UTC, Gabor Kelemen (allotropia)
Details
Second example file in Word and Writer, with document level hyphenation off (114.55 KB, image/png)
2023-01-10 10:50 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2023-01-09 22:59:01 UTC
Created attachment 184547 [details]
Example file with document level hyphenation enabled

Attached RTF document has the hyphauto property set, which is imported correctly - long words are hyphenated.
In Word, the long hyperlink text is not hyphenated, but in Writer it is.

1. Open attached document

Notice the hyperlink text is hyphenated, but it should not.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 44355a90b3450111ad87ad4b6607a564e41d7b54
CPU threads: 14; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (hu_HU); UI: en-US
Calc: threaded

This started in 5.0 with

https://git.libreoffice.org/core/+/830abf307aab9f9611db60b5c734fbafd3b3d8a3%5E%21/#F0

author	Miklos Vajna <vmiklos@collabora.co.uk>	Fri Apr 17 16:52:46 2015 +0200
committer	Miklos Vajna <vmiklos@collabora.co.uk>	Fri Apr 17 17:52:14 2015 +0200

RTF filter: import \hyphauto

So the import is correct, the behavior is inconsistent.
Comment 1 Gabor Kelemen (allotropia) 2023-01-09 23:01:22 UTC
Created attachment 184548 [details]
The example file in Word 2016 and Writer
Comment 2 Gabor Kelemen (allotropia) 2023-01-09 23:20:44 UTC
Also happens with doc/docx files, this is not really RTF specific.
For the hyphenation to work you need the respective German language pack installed both in MSO and LO.
Comment 3 Gabor Kelemen (allotropia) 2023-01-10 10:45:52 UTC
Created attachment 184554 [details]
Another example file made in Word from scratch

A counter-example file: when making it from scratch in Word 2013 this attribute is not added. 
This can be changed in Word on Page Layout ribbon - Hyphenation - None (current, first example has it as Automatic).
This way the hyperlink is still not hyphenated in Word, neither is in Writer.
Comment 4 Gabor Kelemen (allotropia) 2023-01-10 10:50:05 UTC
Created attachment 184555 [details]
Second example file in Word and Writer, with document level hyphenation off
Comment 5 Commit Notification 2023-01-13 15:51:24 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#152952 sw: don't hyphenate URLs by default

It will be available in 7.6.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 6 Michael Stahl (allotropia) 2023-01-13 16:28:00 UTC
testing indicates that Word doesn't only do that for hyperlinks but for plain text that's a URL.

fixed on master, for new documents too, with a compat setting to hyphenate URLs for existing ODTs
Comment 7 BogdanB 2023-01-14 20:25:01 UTC
Verified.

About comment 2: "For the hyphenation to work you need the respective German language pack installed both in MSO and LO." 

I selected all the text and changed the text to Romanian. In 7.5 the text is hyphenated. In 7.6 is not.


Versions used for tests
Version: 7.5.0.1 (X86_64) / LibreOffice Community
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: af8fdba1194e657237f9abc460381a1c4bc49982
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 8 Commit Notification 2023-01-19 12:42:39 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/84526ec730029fbf81242253bfaed67c85bcfbbd

tdf#152952 sw: don't hyphenate URLs by default

It will be available in 7.5.1.

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.