Bug 170588 - FILESAVE DOCX: bookmark starts do not always match bookmark ends
Summary: FILESAVE DOCX: bookmark starts do not always match bookmark ends
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:26.8.0
Keywords: filter:docx
Depends on:
Blocks: Bookmarks
  Show dependency treegraph
 
Reported: 2026-02-03 18:28 UTC by Justin L
Modified: 2026-02-05 15:59 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
tdf115719.docx: unit test in ooxmlexport11.cxx (18.23 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2026-02-03 18:28 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2026-02-03 18:28:04 UTC
Created attachment 205343 [details]
tdf115719.docx: unit test in ooxmlexport11.cxx

When DOCX exports bookmarks, it often duplicates the start position. Therefore not all bookmark starts have a bookmark end. Although this is silently handled by LO and MS Word, it is sloppy (and breaks the correct bookmark span as well).

Steps to reproduce:
1.) open tdf115719.docx in LO and save as DOCX
2.) unzip the round-tripped file and look for 'bookmark' in word/document.xml

Notice that <w:bookmarkStart w:name="_GoBack"/> has 4 starts and two ends.
Comment 1 Commit Notification 2026-02-05 14:00:19 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#170588 docx export: stop duplicating bookmark starts

It will be available in 26.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 2026-02-05 15:31:33 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#170588 docx export: stop duplicating bookmark in empty w:r

It will be available in 26.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.