Created attachment 139324 [details] Example file from Excel 2013 If we create a shape with Microsoft Excel 2010/2013/2016 and we establish a link from the shape to a workbook, the link stops working after exporting the file as XLSX in Calc. The main problem here is the path. The target we set in the spreadsheet (Munka2!A1) gets transformed to a full path when the file is saved as XLSX in LibreOffice Calc: (file:///E:/Link-to-Workbook-from-Shapes/Link-To-Workbook_LO-60.xlsx#Munka2!A1). This issue can only be reproduced with links from shapes, internal links from simple cells work just fine. Steps to reproduce: 1. Create a new spreadsheet with Microsoft Excel 2010/2013/2016. 2. Click on Insert-→Shapes-→select a shape (a rectangle) and insert it to the workbook. 3. Fill the shape with a text and create a hyperlink from the text/shape to an another sheet’s A1 cell. 4. Save the file as XLSX. 5. Open the file with LibreOffice Calc and test the link. (It will work, if you press the ‘CTRL’ and then click) 6. “Save as” the file *.XLSX and then reload. The link stops working. Actual results: After we export the XLSX file the hyperlink stops working. The target “Munka2!A1” was fine, but, because of the file path (file:///E:/Link-to-Workbook-from-Shapes/Link-To-Workbook_LO-60.xlsx) which was added to the hyperlink, the link did not work. Expected results: The internal links from shapes should work even after saving the file as XLSX and reloading it, just like links from cells do. Version: 6.0.0.0.beta1+ Build ID: 29228e83df009cf76ac819ed024527be1092f065 CPU threads: 4; OS: Windows 6.1; UI render: default; TinderBox: Win-x86@42, Branch:libreoffice-6-0, Time: 2017-12-04_23:15:34 Locale: hu-HU (hu_HU); Calc: group threaded
Created attachment 139325 [details] Same file saved from LO 6
Created attachment 139326 [details] The original file and the one saved by LO side by side
Created attachment 139327 [details] Opening the original in LO
Confirmed with LibreOffice 6.0.0.3 Ubuntu 16.04
The root cause of problem is in file: drawing1.xml.rels After saving by LO, TargetMode="External" is added: <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="#Munka2!A1" TargetMode="External"/> </Relationships> after deleting TargetMode="External", everything works as espected: <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="#Munka2!A1"/> </Relationships>
The code responsible for always evaluation to external is in: oox/source/export/shapes.cxx:803 OUString sRelId = mpFB->addRelation( mpFS->getOutputStream(), oox::getRelationship(Relationship::HYPERLINK), mpURLTransformer->getTransformedString(sURL), mpURLTransformer->isExternalURL(sURL)); isExternalURL(sURL) is always returns true, and this function needs to be modified.
Dear Bartosz, This bug has been in ASSIGNED status for more than 3 months without any activity. Resetting it to NEW. Please assigned it back to yourself if you're still working on this.
*** Bug 123644 has been marked as a duplicate of this bug. ***
tundet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/186a9aae2d9612a9d6408e4871bc49963d4f9bb6%5E%21 tdf#115192 XLSX export: fix hyperlink inserted to shape It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.