Bug 64431 - FILESAVE: Broken hyperlink to another file in PPT
Summary: FILESAVE: Broken hyperlink to another file in PPT
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
(earliest affected) release
Hardware: All All
: low normal
Assignee: Not Assigned
: 51940 (view as bug list)
Depends on:
Blocks: Hyperlink PPT
  Show dependency treegraph
Reported: 2013-05-10 14:52 UTC by ign_christian
Modified: 2022-09-20 21:25 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:

Broken hyperlink.ppt (70.50 KB, application/vnd.ms-powerpoint)
2013-05-10 14:52 UTC, ign_christian
Attachment 1.png (118.58 KB, image/png)
2013-05-10 14:53 UTC, ign_christian
Attachment 2.png (125.86 KB, image/png)
2013-05-10 14:54 UTC, ign_christian
Broken hyperlink.ppt (70.50 KB, application/vnd.ms-powerpoint)
2013-05-10 14:56 UTC, ign_christian

Note You need to log in before you can comment on or make changes to this bug.
Description ign_christian 2013-05-10 14:52:27 UTC
Created attachment 79099 [details]
Broken hyperlink.ppt

Steps to reproduce:
1. Create new blank presentation
2. Write a few words (in this sample: "Testing hyperlink")
3. Mark all that words ("Testing hyperlink") 
4. Menu: Insert > Hyperlink > Document > Path / Open File > select a document (in this sample: '/home/christian/Downloads/Test File.odp') > Apply > Close
5. Save that presentation as : 'Broken hyperlink.ppt'
6. Test the hyperlink by clicking the words (Attachment 1.png) > Target document will open > close it
7. Close that presentation file (Broken hyperlink.ppt) 
8. Reopen 'Broken hyperlink.ppt' (Attachment 2.png)

From screenshot 'Attachment 2.png' we see:
- hyperlink changed to '/.../Downloads/Test File.odp'
- fonts color of "Testing hyperlink" changed to grey
Comment 1 ign_christian 2013-05-10 14:53:36 UTC
Created attachment 79100 [details]
Attachment 1.png
Comment 2 ign_christian 2013-05-10 14:54:19 UTC
Created attachment 79101 [details]
Attachment 2.png
Comment 3 ign_christian 2013-05-10 14:56:21 UTC
Created attachment 79102 [details]
Broken hyperlink.ppt
Comment 4 ign_christian 2013-05-10 14:58:54 UTC
This bug happen on:
- LO (Ubuntu 12.04.2 LTS 32bit)
- LO (Win7 Home Premium 32bit)
Comment 5 Julien Nabet 2013-05-10 18:15:49 UTC
On pc Debian x86-64 with master sources updated today, I reproduce this problem.

Thorsten: one for you?
Comment 6 ign_christian 2013-06-03 11:53:45 UTC
*** Bug 51940 has been marked as a duplicate of this bug. ***
Comment 7 QA Administrators 2015-07-18 17:42:52 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2015-10-16 20:00:55 UTC
Repro from scratch.

Win 7 Pro 64-bit Version:
Build ID: 186f32f63434e16ff5776251657f902d5808ed3d
TinderBox: Win-x86@39, Branch:master, Time: 2015-10-16_09:42:47
Locale: en-US (fi_FI)
Comment 9 QA Administrators 2018-08-22 02:36:18 UTC Comment hidden (obsolete)
Comment 10 Buovjaga 2019-09-25 14:06:15 UTC
Still repro

Lowering priority due to obsoleteness of PPT export. Changing meta bug as this doesn't appear to be a limitation in the file format

Version: (x64)
Build ID: e1b51d4588b4b39592bb94dd5bb90de5e04d061e
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-09-23_09:16:11
Locale: fi-FI (fi_FI); UI-Language: en-US
Calc: threaded
Comment 11 QA Administrators 2022-09-16 03:40:22 UTC Comment hidden (obsolete)
Comment 12 Stéphane Guillou (stragu) 2022-09-17 20:47:05 UTC
Bug still present in:

Version: / LibreOffice Community
Build ID: 3752e8eaa81a50b018669d03dc59b3753a5248ef
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Link works in PPTX and ODP but not in PPT.
Comment 13 Julien Nabet 2022-09-20 21:25:59 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

First, since the hyperlink from the ppt seemed to succeed before reopening and failed after reopening, I thought it was import pb (sd/source/filter/ppt/pptin.cxx:410 (aPropItem.Read( aHyperlink.aTarget ))
but in fact it's in export part. I must recognize I don't know why it succeeds before the reloading.

Anyway, with this patch, it works:
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index eae0e5d8c4ab..c2232bbf3ba3 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -342,14 +342,6 @@ sal_uInt32 PPTWriter::ImplInsertBookmarkURL( const OUString& rBookmarkURL, const
     sal_uInt32 nHyperId = ++mnExEmbed;
     OUString sBookmarkURL( rBookmarkURL );
-    INetURLObject aBaseURI( maBaseURI );
-    INetURLObject aBookmarkURI( rBookmarkURL );
-    if( aBaseURI.GetProtocol() == aBookmarkURI.GetProtocol() )
-    {
-        OUString aRelUrl( INetURLObject::GetRelURL( maBaseURI, rBookmarkURL ) );
-        if ( !aRelUrl.isEmpty() )
-            sBookmarkURL = aRelUrl;
-    }
     maHyperlink.emplace_back( sBookmarkURL, nType );
     mpExEmbed->WriteUInt16( 0xf )

Eike: I noticed this commit: 6ad3c553a9bd3b8fb91c45204f0c833f52c52431
impress212: #i97241# added relative links
* found as LGPLv3-only fix at svn rev 1167624 (http://svn.apache.org/viewvc?view=revision&revision=1167624)

from 2011 (!!).

I'm afraid to break something here but do you know which use case it would break?