[Libreoffice-bugs] [Bug 134896] New: No documentation about proper conversion of system file names into URLs in Calc

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Jul 17 09:56:59 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=134896

            Bug ID: 134896
           Summary: No documentation about proper conversion of system
                    file names into URLs in Calc
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Documentation
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: mikekaganski at hotmail.com
                CC: erack at redhat.com, olivier.hallot at libreoffice.org

There is HYPERLINK function in Calc, that is documented [1] [2] to take
URL/IRI. There's also ENCODEURL [3] to properly URL-encode various strings.
Yet, the latter function is not enough to convert random system filepath into
proper file: URL on all platforms. E.g., on Windows, the conversion also
includes replacing backslashes '\' with forward-slashes '/'. A naive attempt to
concatenate "file://" with "c:\path to\file.ext" would result in invalid URL;
also concatenating "file://" with ENCODEURL("c:\path to\file.ext") is not
correct.

But in fact, LibreOffice does the magic of proper conversion of system
filepaths into URLs: clicking on a cell with

> =HYPERLINK("c:\path to\file.ext")

would result in attempt to open proper "file:///c:/path%20to/file.ext". The
magic happens in ScGlobal::OpenURL calling ScGlobal::GetAbsDocName.

I suppose it's worth mentioning that on HYPERLINK help page, to avoid users
trying to create file URLs in various wrong ways.

Refs: https://ask.libreoffice.org/en/question/255719/,
https://ask.libreoffice.org/en/question/142052/

[1]
https://help.libreoffice.org/6.4/en-US/text/scalc/01/04060109.html?DbPAR=CALC#bm_id9959410
[2]
docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018226_715980110
[3]
https://help.libreoffice.org/6.4/en-US/text/scalc/01/func_webservice.html?DbPAR=CALC#bm_id811517136840444

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200717/d5c92d51/attachment.htm>


More information about the Libreoffice-bugs mailing list