Bug 103454

Summary: Relative hyperlink is not exported in SVG
Product: LibreOffice Reporter: loic.machado
Component: DrawAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: minor CC: buzea.bogdan, ilmari.lauhakangas, raal
Priority: medium    
Version: 5.1.5.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 107733, 111450    
Attachments: steps to reproduce with ODG and SVG files of example

Description loic.machado 2016-10-24 09:20:24 UTC
Description:
In Draw, I draw a schema with a Rectangle Box and Text in it.
On text I add a document link.
The hyperlink's value is set to a relative path
Then I export the schema to a SVG file.
The SVG file contains no link.


Steps to Reproduce:
1.Draw a Rectangle
2.Edit text of this rectangle
3.Select the text (I use Ctrl+A)
4.Click on menu Insert > Hyperlink (I use Ctrl+K)
5.Select Document Link
6.In Form, set the hyperlink value to "./insect.html"
7.Click on OK button
8.Click on menu : File > Export
9.Select SVG file type
10.Click on save button

Actual Results:  
1.Open SVG file with a text editor (I use Notepad++)
2.Look for anchor "a" tag
3.See there is no anchor
4.Re-open Hyperlink Dialog on the text
5.See the value of hyperlink is now changed to an absolute path
6.If you re-export to a new SVG file, the hyperlink is present as an absolute path...

Expected Results:
In SVG file, it should have defined the hyperlink to the relative path value.
In Draw, it should not convert the relative path to an absolute path.


Reproducible: Always

User Profile Reset: No

Additional Info:
I wish to use draw to create schemas in an online documentation.
I need to keep relative path in my SVG file because I don't know in advance where it will be placed on server and because it will be easier to maintain.
To me, this bug is related to 103453 because I need the links to be open in the parent frame.


User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
Comment 1 loic.machado 2016-10-24 09:30:59 UTC
Created attachment 128200 [details]
steps to reproduce with ODG and SVG files of example
Comment 2 Buovjaga 2016-11-04 18:37:53 UTC
Confirmed.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.3.0.0.alpha1+
Build ID: 6dc8f25ecf676a2e4d1a1018b729fef4096df8e7
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on October 28th 2016
Comment 3 QA Administrators 2018-08-22 02:38:09 UTC Comment hidden (obsolete)
Comment 4 raal 2020-03-25 22:07:44 UTC
bug still present in Version: 7.0.0.0.alpha0+
Build ID: 5a2c340e00050e21f29ae880593ef4f9ec1ba08d
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: cs-CZ (cs_CZ.UTF-8); UI-Language: en-US
Comment 5 QA Administrators 2022-03-26 03:35:45 UTC Comment hidden (obsolete)
Comment 6 BogdanB 2023-10-30 16:54:50 UTC
In the text editor I see this

<tspan id="id4" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400" fill="rgb(38,121,219)" stroke="none" class="UrlField" xlink:href="#./insect.html"><a xlink:href="#./insect.html">dsdds</a></tspan></tspan></tspan>

If I reopen the document, I have the same link.


Please check if this bug have been solved in newer versions:

Tested with
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b7d2a9c824aca1a4dfd1b857a3620e73ade6bc0d
CPU threads: 16; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 7 Buovjaga 2023-10-31 08:16:13 UTC
(In reply to BogdanB from comment #6)
> In the text editor I see this
> 
> <tspan id="id4" font-family="Liberation Sans, sans-serif" font-size="635px"
> font-weight="400" fill="rgb(38,121,219)" stroke="none" class="UrlField"
> xlink:href="#./insect.html"><a
> xlink:href="#./insect.html">dsdds</a></tspan></tspan></tspan>
> 
> If I reopen the document, I have the same link.

I can't reproduce your result. The result with the latest build I get is the completely non-working

<tspan class="TextParagraph"><desc>512: FIELD_SEQ_BEGIN; ./insect.html</desc><desc>134</desc><desc>138</desc><desc>136</desc><desc>135</desc><desc>113</desc><desc class="TextPortion">type: TextField; content: Insect; text field type: URL; content: Insect; url: </desc><tspan class="TextPosition" x="7528" y="9970"><tspan font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400" fill="rgb(41,128,185)" stroke="none" style="white-space: pre">Insect</tspan><desc>512: XTEXT_EOC</desc><desc>512: XTEXT_EOC</desc><desc>512: XTEXT_EOC</desc><desc>512: XTEXT_EOC</desc><desc>512: XTEXT_EOC</desc><desc>512: XTEXT_EOC</desc><desc>512: FIELD_SEQ_END</desc><desc>512: XTEXT_EOL</desc><desc>512: XTEXT_EOP</desc><desc>512: XTEXT_PAINTSHAPE_END</desc></tspan></tspan>

Testing with older versions, the behaviour of the export and the hyperlink dialog has changed several times. These should be all bibisected.

In the oldest of 7.6, it keeps applying the link in the Hyperlink dialog to Internet instead of Document.

In the oldest of 24.2, the result is:

<tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="9519" y="13602"><tspan fill="rgb(0,0,128)" stroke="none" style="white-space: pre">Insect</tspan></tspan></tspan>
Comment 8 Buovjaga 2023-11-01 09:58:01 UTC
(In reply to Buovjaga from comment #7)
> (In reply to BogdanB from comment #6)
> > In the text editor I see this
> > 
> > <tspan id="id4" font-family="Liberation Sans, sans-serif" font-size="635px"
> > font-weight="400" fill="rgb(38,121,219)" stroke="none" class="UrlField"
> > xlink:href="#./insect.html"><a
> > xlink:href="#./insect.html">dsdds</a></tspan></tspan></tspan>
> > 
> > If I reopen the document, I have the same link.
> 
> I can't reproduce your result. The result with the latest build I get is the
> completely non-working
> 
> <tspan class="TextParagraph"><desc>512: FIELD_SEQ_BEGIN;
> ./insect.html</desc><desc>134</desc><desc>138</desc><desc>136</
> desc><desc>135</desc><desc>113</desc><desc class="TextPortion">type:
> TextField; content: Insect; text field type: URL; content: Insect; url:
> </desc><tspan class="TextPosition" x="7528" y="9970"><tspan
> font-family="Liberation Sans, sans-serif" font-size="635px"
> font-weight="400" fill="rgb(41,128,185)" stroke="none" style="white-space:
> pre">Insect</tspan><desc>512: XTEXT_EOC</desc><desc>512:
> XTEXT_EOC</desc><desc>512: XTEXT_EOC</desc><desc>512:
> XTEXT_EOC</desc><desc>512: XTEXT_EOC</desc><desc>512:
> XTEXT_EOC</desc><desc>512: FIELD_SEQ_END</desc><desc>512:
> XTEXT_EOL</desc><desc>512: XTEXT_EOP</desc><desc>512:
> XTEXT_PAINTSHAPE_END</desc></tspan></tspan>

I think the extra stuff seen here is due to me using a debug build. I'm not seeing it in a fresh Windows master build.

> In the oldest of 7.6, it keeps applying the link in the Hyperlink dialog to
> Internet instead of Document.

This was actually the behaviour already in 5.2. This unexpected behaviour stopped with a9cea0ddeb5cd51db0720f96af75af75120908d9
tdf#90496 - Remember last used view in hyperlink dialog