Bug 148405 - FILEOPEN: Font direct formatting of a hyperlink disappears after reload (perhaps document specific)
Summary: FILEOPEN: Font direct formatting of a hyperlink disappears after reload (perh...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Clear-Formatting Hyperlink Formatting-Text-Diverse
  Show dependency treegraph
 
Reported: 2022-04-05 19:57 UTC by J William Cupp
Modified: 2023-11-03 14:42 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Default hyperlink font overrides applied setting (3.53 MB, application/vnd.oasis.opendocument.text)
2022-05-09 14:06 UTC, J William Cupp
Details
Minimal reproducer (1.00 KB, application/vnd.oasis.opendocument.text)
2023-11-03 14:40 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description J William Cupp 2022-04-05 19:57:17 UTC
Description:
In Writer, I prepare reports with numerous hyperlink text entries.  The reports are desired to be in a specified font.  When I enter the URL, Writer automatically detects a web address and creates a hyperlink (good).  Since the current text is in (say,) Times New Roman, this is applied to the hyperlink as well (good).  But the specific font does not persist.

It is necessary to create each hyperlink, save the document, re-open it, and re-apply the Times New Roman font.  This behavior is very consistent.  Once the document has been saved, re-opened and edited to replace the default hyperlink font with Times New Roman, and saved again, the Times New Roman font persists.

Changing the default settings for various things (like hyperlink text) is a crude work-around that is not effective: this works only if one knows in advance what font faces are to be desired in *every* document (or changes the default setting often).

Steps to Reproduce:
1. Create a document in any font (other than the default font face set for hyperlinks).
2. Type in a web URL.  Observe the current font face applied to the hyperlink display text.
3. Save the document and close it.
4. Re-open the document and observe the surrounding text is is the desired font (e.g., Times New Roman) but the hyperlinked text has been modified to the default setting for hyperlink text.
5. Edit the document to a) select ONLY the hyperlink text, b) re-apply the desired font face, and c) re-save the document.  Close the document.
6. Open the document and observe the desired font selection has persisted.

Actual Results:
The document is correctly formatted with the selected font face after step 6 has been applied.  However, after step 3, the desired font has been replaced with whatever the default font setting for hyperlink text is.

Expected Results:
The intended font, which had been applied to the hyperlink text, should override the default setting on saving the document.  It should not be necessary to save the document, close it, re-open it, and replace the font face to override the default setting.  NOTE: step 5a above is critical.  If more than exactly just the hyperlinked text is selected when the desired font is applied, it will not persist when saved.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes

Version: 7.3.1.3 / LibreOffice Community
Build ID: a69ca51ded25f3eefd52d7bf9a5fad8c90b87951
CPU threads: 4; OS: Linux 5.16; UI render: default; VCL: gtk3
Locale: en-US (en_US.utf8); UI: en-US
Calc: threaded

$ glxinfo | grep OpenGL
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) HD Graphics 620 (KBL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.3.8
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.3.8
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.3.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
Comment 1 Dieter 2022-04-21 07:11:16 UTC
I can't reproduce with

Version: 7.3.3.1 (x64) / LibreOffice Community
Build ID: 1688991ca59a3ca1c74bc2176b274fba1b034928
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Font of "Default Paragraph Style" is Liberation Serif
Font of Character Style "Internet Link" is Arial.

Steps:
1. Write some text with Default Paragraph Style
2. Add an URL => Settings (including font) from character style "Internet link" is applied, although text has still no character style
3. Save, close and reopen

Actual result: Setting remain
Comment 2 J William Cupp 2022-04-21 12:37:21 UTC
In Comment 1 the reporter says he cannot reproduce the situation.  However, it appears the text in the paragraph is set to the default text font and, while not sure, it seems to me that the hyperlink is also set to the default.

Here is the situation reported: both text and hyperlinks have default fonts, set to differing values.

In the report being written, a font is expected that is other than either of these defaults.  The paragraph of text, including hyperlinks, is changed to some other font.  The font changes take and are applied, including to the hyperlink.

However, when the document is saved, closed, and re-opened, the new font is no longer applied to the hyperlink.  The hyperlink has been modified back to its default font setting.  (The new font has been applied and remains on the paragraph text outside of hyperlinked areas.)

To repair this, the hyperlink -- only! -- must be re-selected and changed to the desired new font.  Thereafter, the font modification persists when the document is closed and re-opened.  It appears that the font change settings must be applied such that they start and end exactly concurrently with the hyperlinked text limits.

A cumbersome work around is to repeatedly modify the default settings for normal text and hyperlinks.  While this admittedly works, it is cumbersome when one prepares reports and various formats expect different fonts.  One continually is changing defaults.   It seems that manually applying a font change to replace a default setting should persist, and not be replaced with the default font.  It also seems that it ought not be required to separately apply font changes to various classes of text, normal versus hyperlinked.
Comment 3 Dieter 2022-05-04 08:58:23 UTC
J. William, it's not clear to me, if you use paragraph style, character style, direct formatting. But this is important to know.

So waht result do you get, if you follow my steps on comment 1? If possible, you can also add a sample document.
=> NEEDINFO

Additional informations: I've changed earliest affected version to 7.3.1.3 (information of your initial bug report). Please correct it, if you've also tested with earlier versions.
Comment 4 J William Cupp 2022-05-04 17:16:05 UTC
Okay, I just followed the steps in Comment 1 and tried to prepare a sample document to submit.  In that, the failure did not reproduce.

Then I returned to one of the reports of the kind with which I have had the problem (I have one in progress most all of the time) and the situation does reproduce there.  Cannot explain that.

Possibly there are confounding variables such as length of report, number of inserted images, etc.  These reports often run to more than 30 pages (the one I just checked is presently eleven pages long) and contain many dozens -- possibly hundreds of images.  Could these possibly influence the behavior?

[Sorry, I just cannot submit one of these reports as a sample because of included private and proprietary information.]  In the one I just did, at the current place of additional text entry the font face is set to New Times Roman.  The default hyperlink text font face is DejaVu Sans Mono.  On initial entry, full URLs are entered and appear in Times Roman along with the rest of the text in the paragraph.  Once the document is saved, closed, and re-opened, the hyperlinks (only) show in DejaVu Sans Mono.  Selecting just the hyperlink text, changing the font to Times New Roman, and saving the document again works -- the desired font persists.

A work around is to change the default hyperlink text font to the desired Times New Roman for this report.  However, this requires changing the default hyperlink text font settings for different kinds of reports.

Can you help me think of things to try, in order to produce a test document that I can actually submit?  I do have this problem, have had it for a long time, and eventually got tired enough to create this bug report.  (No, I cannot recall which version was the first one in Writer this appeared.  Years and years ago.)
Comment 5 QA Administrators 2022-05-05 03:54:13 UTC Comment hidden (obsolete)
Comment 6 Dieter 2022-05-06 13:16:57 UTC
(In reply to J William Cupp from comment #4)
> Can you help me think of things to try, in order to produce a test document
> that I can actually submit?

Please try to reduce the document to a minimum. I'm sure you can delete all images and I hope a one-page-document would be sufficient. Please make sure, that you still can reproduce the bug with that smaller document. If it still contains private confidential parts you can send it to me in private, if you like.
Comment 7 J William Cupp 2022-05-09 14:06:46 UTC
Created attachment 180016 [details]
Default hyperlink font overrides applied setting
Comment 8 J William Cupp 2022-05-09 14:07:38 UTC
I have managed to produce a sample document I feel comfortable submitting.  I took one example of the kinds of report I have been preparing, added a dummy entry, and reproduced the effect there.  (In the end, I also left in the last real entry but cleaned it up a bit for privacy.)

When the document is saved and reopened the applied font does not persist.  It was left that way.  Should the document now be edited and the preferred font applied only to the link text, it will persist.
Comment 9 Dieter 2022-05-10 18:56:26 UTC
Now I see, what has happened. Paragraph has character style "Teletype" with font "DejaVu Sans Mono". If you insert a hyperlink (and also after saving) it has still that character style and the direct formatted font Times New Roman. But if you reload or reopen document direct formatting gets lost.

Version: 7.3.3.2 (x64) / LibreOffice Community
Build ID: d1d0ea68f081ee2800a922cac8f79445e4603348
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Additional information
But I can't confirm with a fresh document, but when I copy part of attachment 180016 [details] into a new document, I can reproduce. So it might be related to other settings in attached document.
Comment 10 J William Cupp 2022-05-10 23:54:33 UTC
If I am doing something wrong then I just need to know what.  This behavior has been consistent for a very long time; I just put up with it.  But I finally figured, others may be having the same issue.  So let's open up a bug report and see if this is something that can be overcome.

Thanks for looking at it.
Comment 11 Mike Kaganski 2023-11-03 14:40:01 UTC
Created attachment 190634 [details]
Minimal reproducer

Repro also in OOo 2.2.

The attached file (the minimal reproducer) has part of its paragraph direct-formatted using Liberation Sans + *underline: none*.

The *underline:none* is what creates the problem. Hyperlink seems to drop all DF, when it includes such an underline formatting.
Comment 12 Mike Kaganski 2023-11-03 14:42:30 UTC
(In reply to Mike Kaganski from comment #11)
> Created attachment 190634 [details]
> Minimal reproducer

Steps:
1. Open the attachment.
2. Put cursor between "ipsum" and "dolor" (i.e., inside the direct-formatted part).
3. Type " www.example.org " (with spaces, to make sure it auto-converts to a hyperlink).
4. See that the hyperlink still has Liberation Sans font.
5. Save and reload

=> the hyperlink reverts to Liberation Serif, the default font.