Bug 45435 - XLS/XSLX Calc corrects hyperlinks at save and open
Summary: XLS/XSLX Calc corrects hyperlinks at save and open
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Spreadsheet (show other bugs)
Version: 3.5.0 release
Hardware: All Linux (All)
: high normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-31 03:42 UTC by Sergey Savko
Modified: 2014-11-24 02:32 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Sergey Savko 2012-01-31 03:42:14 UTC
Problem description: Don't correct save and open link in hyperlink, in all versions LibO

Steps to reproduce:
1. In LibO Calc -> Insert -> Hyperlink, in right window select "Document" and set path to PDF or JPG url (for me /home/user/Desktop/32.png) -> Apply -> Close  -> Save File in desktop folder.
2. Then I copy file from desktop folder in document folder in my profile.
3. When I open the document and see the hyperlink path, I see /home/user/Desktop/Documents/32.png

Current behavior: Don't open file from hyperlink if file is copy in other folder.

Expected behavior: Should open the link.

Platform (if different from the browser): 
Kubuntu 8.04, 10.04;
Browser: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.15 (KHTML, like Gecko) Ubuntu/10.04 Chromium/18.0.996.0 Chrome/18.0.996.0 Safari/535.15
Comment 1 rpr 2012-03-03 06:45:35 UTC
This is not a bug actually as LibreOffice has the following option enabled by
default:
Tools -> Options -> Load/Save -> General -> Save URLs relative to file system

When you use Insert -> Hyperlink to create a hyperlink to a file in the file
system, Calc saves a relative path from the document to the linked file.

For example, if you are editing /home/user/Desktop/test.ods
and insert a hyperlink to /home/user/Desktop/a.pdf
Calc internally saves the following path: ../a.pdf
(ODS is actually a ZIP archive. You can copy test.ods to test.zip and then open
in with an archiver. There is the content.xml file inside the archive in which
you can see the "../a.pdf" path.)

If you move the spreadsheet to /home/user/Documents/test.ods
the hyperlink now links to /home/user/Documents/a.pdf
(/home/user/Documents/test.ods + ../a.pdf = /home/user/Documents/a.pdf)
although the text shown in the cell still reads /home/user/Desktop/a.pdf
which can be corrected by Insert -> Hyperlink.

This behaviour can be very useful if you have a set of linked files and move
them as a group keeping their relative positions in the file system. If you
want that hyperlinks use absolute paths then disable the following option:
Tools -> Options -> Load/Save -> General -> Save URLs relative to file system

I've tested this in LibO Calc 3.5.0 on Ubuntu 11.10.
Comment 2 Sergey Savko 2012-03-06 06:49:10 UTC
Hmm, you right. In version 3.3.4 it does not work, in 3.5.0 work fine.
Thank you very much
Comment 3 Sergey Savko 2012-03-29 07:09:25 UTC
LibreOffice 3.5.1.
So, if i save in ods it's works. If i'm save file in xls, hyperlinks is wrong.
Comment 4 ign_christian 2013-06-29 02:56:47 UTC
Hi Sergey, is it still happen on latest stable release?
Comment 5 Thomas Arnhold 2013-10-16 17:29:16 UTC
Reproduced on Windows 7 with:

Version: 4.1.2.3
Build ID: 40b2d7fde7e8d2d7bc5a449dc65df4d08a7dd38

When saving as XLS or XSLX and moving the file afterwards the link is broken.
Comment 6 chtfn 2014-11-24 01:57:11 UTC
This is getting very confusing:

I just tested this in LO 4.3.3.2 on Ubuntu 14.04:

1. Insert hyperling to document in cell A1 in new spreadsheet
2. Save either in ods, xls or xlsx
3. Move the linked document to a diffent folder

None of the three formats updated the path, even though the box for "Save URLs relative to file system" is ticked!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.