Bug 168817 - FILESAVE: Document corruption when combining hyperlinks and phonetic guides
Summary: FILESAVE: Document corruption when combining hyperlinks and phonetic guides
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:26.2.0 target:25.8.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2025-10-11 21:43 UTC by helios.vmg
Modified: 2025-10-20 15:09 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
A sample for testing (30.42 KB, application/vnd.oasis.opendocument.text)
2025-10-11 22:45 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description helios.vmg 2025-10-11 21:43:35 UTC
Description:
When the same section of text is given *both* an Asian phonetic guide *and* a link, Writer generates a file that it cannot later parse once it's unloaded, destroying work.

Steps to Reproduce:
1. Type an Asian text. For example, "一日".
2. Add a phonetic guide to it. For example, "ついたち".
3. Add a hyperlink to the same selection. For example, https://en.wiktionary.org/wiki/一日#Japanese
4. Save and close the document.
5. Attempt to re-open the document.

Actual Results:
Writer reports an error in content.xml.

Expected Results:
Writer blocks invalid operations, does not permit saving the offending file in order to not lose data, or saves a file that it later open normally.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Tested on both Linux and Windows. It doesn't matter which one saves the file and which one tries to read it.
Comment 1 Mike Kaganski 2025-10-11 22:45:41 UTC
Regression in v.7.4.
Comment 2 Mike Kaganski 2025-10-11 22:45:58 UTC
Created attachment 203288 [details]
A sample for testing
Comment 3 Saburo 2025-10-12 02:43:16 UTC
bibisected with linux-64-7.4
commit c50fbdceafdd4b857954f098e38cae03e8bc6064
author	Mike Kaganski <mike.kaganski@collabora.com>	Wed Jul 13 11:37:30 2022 +0300

tdf#148198: merge identical hyperlinks of adjacent text ranges on ODF export

The true hyperlink boundaries are available as SwpHints starts/ends, which are used
in DOC(X) export (see SwWW8AttrIter::OutAttrWithRange).

However, I don't see a reasonable way to expose this information to xmloff, so I
decided instead to just merge the identical hyperlink properties of adjacent ranges
into a single hyperlink. This will allow to fix already split hyperlinks saved in
previous versions. The downside is that this disallows to have separate adjacent
identical hyperlinks - I hope that this would not be a real issue.

Change-Id: I901e6035a5e89bc515b5742c6a5f564c77faf05b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137013
Comment 4 Mike Kaganski 2025-10-12 12:03:12 UTC
https://gerrit.libreoffice.org/c/core/+/192249
Comment 5 Commit Notification 2025-10-12 18:15:43 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#168817: don't emit hyperlink markup for Ruby portions

It will be available in 26.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 6 helios.vmg 2025-10-17 18:20:37 UTC
I've tested the fixed build on Windows and Linux, and it seems to work now. The generated ODT files are readable by older versions of Writer as well.
Comment 7 Commit Notification 2025-10-20 15:09:26 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/58561ba4dea22e59b7a7fb36170d574cbbcae936

tdf#168817: don't emit hyperlink markup for Ruby portions

It will be available in 25.8.3.

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.