Bug 133221 - FILEOPEN: Bookmark at end of file not read from DOCX files.
Summary: FILEOPEN: Bookmark at end of file not read from DOCX files.
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx
Depends on:
Blocks:
 
Reported: 2020-05-21 10:20 UTC by Phil Walter
Modified: 2022-05-23 10:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Screen shot of the end of the document. (18.12 KB, image/png)
2020-05-21 10:20 UTC, Phil Walter
Details
Sample document showing the bookmark error (.DOCX format) (13.52 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-05-22 10:56 UTC, Phil Walter
Details
Sample document showing the bookmark works (.DOC format) (26.50 KB, application/msword)
2020-05-22 10:58 UTC, Phil Walter
Details
Comparison MSO 2010 and LibreOffice 7.0 master (68.66 KB, image/png)
2020-05-22 11:11 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Walter 2020-05-21 10:20:43 UTC
Created attachment 161072 [details]
Screen shot of the end of the document.

When reading MS Word created DOCX files with a bookmark which is defined at the very end of the file, it is not read.  See attachment.

This works correctly if the file is saved as a .DOC file.

DOCX and DOC files were created with MS Office 2010.

If there are any characters after the bookmark or any blank paragraphs then the bookmark is correctly read.  For the fault to show it must be after the very last character in the document.

The attachment is shown with punctuation characters turned on and the bookmark is defined immediately in front of the final closing paragraph marker.
Comment 1 Xisco Faulí 2020-05-22 10:42:17 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Comment 2 Phil Walter 2020-05-22 10:56:47 UTC
Created attachment 161129 [details]
Sample document showing the bookmark error (.DOCX format)

This sample document was created using MS Word 2010 and then saved as a DOCX file format.  The document attempts to show the page number of the end of document bookmark but fails.
Comment 3 Phil Walter 2020-05-22 10:58:43 UTC
Created attachment 161130 [details]
Sample document showing the bookmark works (.DOC format)

This is the same sample document as previous attachment (161129) but has been saved in the .DOC format.  Here the bookmark page number is correctly shown as page 1 (in red).
Comment 4 Phil Walter 2020-05-22 11:04:10 UTC
Two versions of the same sample document provided.  Both created using MS Word 2010 on 64 bit Windows 10.

The docx version shows the error (in red) when attempting to reference the page number of the end of document bookmark.  The bookmark is created after the final sentence of the document - this is critical creating it any earlier in the document or with a blank paragraph after it does not show the fault.

The doc version of the same file shows the expected document where the page number of the end of document bookmark is shown as 1 (again in red).  This version loads correctly.
Comment 5 Xisco Faulí 2020-05-22 11:11:48 UTC
Created attachment 161134 [details]
Comparison MSO 2010 and LibreOffice 7.0 master
Comment 6 Xisco Faulí 2020-05-22 11:12:09 UTC
Reproduced in

Version: 7.0.0.0.alpha1+
Build ID: 8209c2569f5726f9ed29f75d30efdccb94f98fe5
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 7 Xisco Faulí 2020-05-22 11:15:04 UTC
Also reproduced in

Version: 5.2.0.0.alpha0+
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.19; Render: default; 

and

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 8 Xisco Faulí 2020-05-22 11:15:45 UTC
@NISZ Team, I thought you might be interested in this issue
Comment 9 QA Administrators 2022-05-23 03:37:20 UTC Comment hidden (obsolete)
Comment 10 Phil Walter 2022-05-23 10:09:53 UTC
This has just been tested on the latest version of Libra Office and I can confirm that the bug is no longer present.  Well done to the team for fixing this.

Version: 7.3.3.2 (x64) / LibreOffice Community
Build ID: d1d0ea68f081ee2800a922cac8f79445e4603348
CPU threads: 8; OS: Windows 10.0 Build 22000; UI render: Skia/Vulkan; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: threaded