Bug Hunting Session
Bug 44196 - FILEOPEN: Open .html file into Calc adds absolute path to relative HREF= URL
Summary: FILEOPEN: Open .html file into Calc adds absolute path to relative HREF= URL
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.3.4 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks: HTML-Import
  Show dependency treegraph
 
Reported: 2011-12-27 13:06 UTC by g434
Modified: 2017-08-21 21:11 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Saved by the editor, just before step 10. (866 bytes, text/html)
2012-05-03 17:07 UTC, g434
Details
file abc.html at step 16. (960 bytes, text/html)
2012-05-03 17:09 UTC, g434
Details

Note You need to log in before you can comment on or make changes to this bug.
Description g434 2011-12-27 13:06:28 UTC
Problem description: 
Gratuitous change hyperlink HREF= from relative to absolute on opening a .html file.

Steps to reproduce:

0) Open Calc by clicking on desktop shortcut to <LibreOffice 3.4/program/scalc.exe>.

1) Both "Save URLs relative" boxes are checked in Tools/Options/Load-Save/General.

2) Type "Text with HYPERLINK" into cell A1.

3) Select cell A1 and hi-lite HYPERLINK in Formula Toolbar.

4) Click hyperlink icon in Standard Toolbar and select DOCUMENT.

5) Type  link.html  in Path. Click APPLY and CLOSE.

6) Click SAVE and save file as File Name: abc  and Type: HTML  on the Desktop.  Choose "Keep Current Format".   File "abc.html" is created.

7) Exit Calc using X in upper right corner.


8) Drag&drop abc.html onto a text editor (I use EditPlus)

9) See  HREF="link.html"  in the <A>...</A> directive.

   NOTE: This behavior is what we expect since "link.html" was what was entered in the hyperlink interaction above (#5).

10) Close the editor.



11) Drag&drop abc.html onto the Calc desktop shortcut.

12) OPTIONAL: Select cell A1 and hi-lite HYPERLINK in Formula Toolbar. Click hyperlink icon in Standard Toolbar.  OBSERVE: Path is now absolute, starting with "C:".

13) Using SAVE AS, save the page/sheet as File Name: abc  and Type: HTML & Keep Current Format.  Select "overwrite" to save the new abc.html over the previous one.

14) Exit Calc using X in upper right corner.



15) Drag&drop abc.html into the text editor again.

16) See that  HREF=  is now:

     HREF="file:///C:/Documents and Settings/username/Desktop/link.html"

17) It's now been changed to an **ABSOLUTE** path and the abc.html file can only operate properly when it resides on the desktop. If it were moved (along with "link.html") to another folder it would not be able to find "link.html"...


Platform (if different from the browser): WinXPpro V5.1 SP3
                            
Browser: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0
Comment 1 g434 2011-12-27 16:42:08 UTC
I just tried this procedure on 3.5.0 Beta2.  Same behavior. Sorry.  73, Gary
Comment 2 sasha.libreoffice 2012-05-03 02:38:42 UTC
Thanks for bugreport
Please, attach document produced on step 10
Comment 3 g434 2012-05-03 17:07:29 UTC
Created attachment 61004 [details]
Saved by the editor, just before step 10.

File abc.html as saved by the editor at step 9-10. Saved as abc-step10.html
Comment 4 g434 2012-05-03 17:09:47 UTC
Created attachment 61005 [details]
file abc.html at step 16.

File abc.html as saved by the editor at step 16.
Comment 5 g434 2012-05-03 20:05:38 UTC
Recommend you ignore step 12 (OPTIONAL)... It may change conditions of the test and you can see the result in the final .html file anyway...
Comment 6 sasha.libreoffice 2012-05-03 22:44:05 UTC
Thanks for attachment.
reproduced in 3.3.4 and 3.5.3 on Fedora 64 bit
reproducible also by copy-paste from web-browser

step 12 is important because we see where problem occurs. In this case in import filter. IMHO it done intentedly because Calc not always works with relative path correctly.

PS: first attachment is from step 7. But it is not problem. I changed it for there appears this text: <a href="link.html">HYPERLINK</a>

Changing version to 3.3.4 as most early reproducible
Comment 7 Thomas Arnhold 2013-10-16 03:00:05 UTC
Right, but this behavior is expected. If you copy your HTML example right from freedesktop.org the resulting link is:

http://bugs.freedesktop.org/list.html

Without the absolute path the link would be broken and without any context. Maybe we should leave local links as they are, but add the absolute path for websites. But I'm undecided...

I've changed the component, because Writer does the same.
Comment 8 QA Administrators 2015-04-01 14:42:39 UTC Comment hidden (obsolete)
Comment 9 Buovjaga 2015-04-24 17:10:56 UTC
Reproduced.

Win 7 Pro 64-bit Version: 5.0.0.0.alpha1+ (x64)
Build ID: f3375fa07f27bd2ade519af3c07d69040d10eaa9
TinderBox: Win-x86_64@42, Branch:master, Time: 2015-04-22_23:38:50
Locale: fi_FI
Comment 10 QA Administrators 2016-09-20 09:33:40 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present on a currently supported version of LibreOffice 
(5.1.5 or 5.2.1  https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the version of LibreOffice and 
your operating system, and any changes you see in the bug behavior
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave 
a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3)

http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to "inherited from OOo";
4b. If the bug was not present in 3.3 - add "regression" to keyword


Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug-20160920