diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-08-15 12:35:30 +0300 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2018-08-16 12:04:04 +0200 |
commit | e9e18b5a3a0e9651b7161278a61c6a7ce0b9df0b (patch) | |
tree | c49b797b90e38f9b7cf4c7cffa698c2a7f61d44e /sc/source/filter/excel | |
parent | 9b01a1a47453300dfda59e3bbacf80e960169654 (diff) |
tdf#118990: use full URI for absolute references
Previously (since commit 7eb5e135422f1a5830a44d129300bc3fafb4627d)
only path relative to reference host was stored, and host itself
was dropped. That resulted in URIs like "/share/file.xlsx", even
without scheme. For Windows shares, this broke UNC paths like
"\\HOSTNAME\share\file.xlsx" (which are stored in XLSX by Excel as
"file:///\\HOSTNAME\share\file.xlsx"), and on subsequent import,
this resulted in paths on the same drive as the document (like
"C:\share\file.xlsx").
With this change, we will store "file://HOSTNAME/share/file.xlsx",
which is correctly processed by both LibreOffice and MS Excel.
Change-Id: I3f13aa0b3ae8dc41ec28eaa1416d536469c4562a
Reviewed-on: https://gerrit.libreoffice.org/59064
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit f24b0ec13c5c8edda5ffb1336b0eb6da173dfc97)
Reviewed-on: https://gerrit.libreoffice.org/59141
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sc/source/filter/excel')
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index aa92499f135b..2ab4cc9cc668 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -457,7 +457,8 @@ OUString XclExpHyperlink::BuildFileName( sal_uInt16& rnLevel, bool& rbRel, const OUString& rUrl, const XclExpRoot& rRoot, bool bEncoded ) { INetURLObject aURLObject( rUrl ); - OUString aDosName( bEncoded ? aURLObject.GetURLPath() : aURLObject.getFSysPath( FSysStyle::Dos ) ); + OUString aDosName(bEncoded ? aURLObject.GetMainURL(INetURLObject::DecodeMechanism::ToIUri) + : aURLObject.getFSysPath(FSysStyle::Dos)); rnLevel = 0; rbRel = rRoot.IsRelUrl(); |