Bug 91417 - FILEOPEN: docx HYPERLINK field code misinterprets \h (history) switch
Summary: FILEOPEN: docx HYPERLINK field code misinterprets \h (history) switch
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.8.2 release
Hardware: Other All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: target:5.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-20 21:27 UTC by Ryan Tandy
Modified: 2016-09-19 16:15 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test document showing the issue (12.70 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-05-20 21:27 UTC, Ryan Tandy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Tandy 2015-05-20 21:27:05 UTC
Created attachment 115759 [details]
test document showing the issue

Steps to reproduce:

1. In MS Word 2010, create a new document containing a hyperlink, save it as .docx.

2. Extract the .docx, edit word/document.xml, find the hyperlink element, change the w:history value to "0" or "false" or remove the w:history attribute, re-pack the docx.

3. Open the result in Word, save-as with a different name to get a new copy.

Expected results: hovering over the link in LO Writer shows the hyperlink URL.

Actual results: hovering over the link in LO Writer shows the URL as "\h".

Analysis:

The .docx created after step 1 contains a w:hyperlink with w:history="1".

After step 3 the hyperlink is no longer saved as a w:hyperlink, but as a HYPERLINK field with a \h switch. I'm attaching the resulting docx.

I don't know how documents like this happen in the wild, but a user sent me one. I found one other reference to the \h switch online: http://www.aspose.com/community/forums/thread/119680/problem-converting-hyperlinks-to-docx-format.aspx

I couldn't find any documentation about the \h switch, but the corresponding w:history attribute is documented: http://officeopenxml.com/WPhyperlink.php

Originally reported against 4.2.8, reproduced with a current master build:

Version: 5.0.0.0.alpha1+
Build ID: 2a886adb500fe481e1ea61573551b19e99c55b8b
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-05-20_00:31:27
Locale: en-US (en_US.UTF-8)
Comment 1 Buovjaga 2015-05-25 11:05:05 UTC
(In reply to Ryan Tandy from comment #0) 
> Actual results: hovering over the link in LO Writer shows the URL as "\h".

Confirmed.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: b9630867d17c01ec41f6461b1e96288f3932248c
TinderBox: Win-x86@39, Branch:master, Time: 2015-05-25_00:45:41
Locale: fi-FI (fi_FI)
Comment 2 Commit Notification 2015-10-06 05:51:09 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=501e757649b760229cca1327ac2cf1945dc745a4

tdf#91417: import hyperlink with history flag correctly

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 3 Xisco Faulí 2016-09-15 22:15:49 UTC
Hello,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?