Bug 159438 - ODF export: bookmarks' starts and ends interleave
Summary: ODF export: bookmarks' starts and ends interleave
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:24.8.0 target:24.2.2
Keywords: bibisectNotNeeded, regression
Depends on:
Blocks:
 
Reported: 2024-01-30 09:25 UTC by Mike Kaganski
Modified: 2024-02-12 11:42 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Three bookmarks, meeting in one position (580 bytes, application/vnd.oasis.opendocument.text)
2024-01-30 09:25 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-01-30 09:25:43 UTC
Created attachment 192248 [details]
Three bookmarks, meeting in one position

The attached document has a single word "foo" and three bookmarks: "bookmark1" spans over "foo"; "bookmark2" is between "foo" and "bar"; and "bookmark3" spans over "bar".

Save it as (F)ODT, and inspect the XML. The content of the paragraph becomes

<text:bookmark-start text:name="bookmark1"/>foo<text:bookmark-start text:name="bookmark3"/><text:bookmark-end text:name="bookmark1"/><text:bookmark text:name="bookmark2"/>bar<text:bookmark-end text:name="bookmark3"/>

i.e., between "foo" and "bar", first "bookmark3" starts; then "bookmark1" ends; and then "bookmark2" appears. I.e., "Bookmark1" and "bookmark3" interleave; "bookmark2" gets inside "bookmark3".

This is basically re-appearance of #i58438#, happened after commit 76a4305d1e90b6617054dd33036e64f005dbcf04 (sw: fix inconsistent bookmark behavior -around at-char/as-char anchored frames, 2017-12-21).
Comment 1 Commit Notification 2024-01-30 17:50:31 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1d7ce421480d9170316533de03feb8d04eb5c767

tdf#159438: when there's no frame, close previous bookmark first

It will be available in 24.8.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 2 Commit Notification 2024-02-12 11:42:35 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/3af133c23544839bcad6592c910e5f04e8f85c38

tdf#159438: when there's no frame, close previous bookmark first

It will be available in 24.2.2.

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.