[Libreoffice-bugs] [Bug 136427] hyperlink with custom protocol handler isn't handled when url ends with .ods or .odt

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Sep 3 18:56:33 UTC 2020


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

--- Comment #7 from Maxim Monastirsky <momonasmon at gmail.com> ---
Well, in sfx2/source/appl/appopen.cxx in the SfxApplication::OpenDocExec_Impl
method:

845    const OUString aTypeName { xTypeDetection->queryTypeByURL( aURL.Main )
};
846    SfxFilterMatcher& rMatcher = SfxGetpApp()->GetFilterMatcher();
847    std::shared_ptr<const SfxFilter> pFilter = rMatcher.GetFilter4EA(
aTypeName );
848    if (!pFilter || !lcl_isFilterNativelySupported(*pFilter))
849    {
850        // hyperlink does not link to own type => special handling (http,
ftp) browser and (other external protocols) OS
...
908                    sfx2::openUriExternally(
909                        aURL.Complete, pFilter == nullptr);

queryTypeByURL is the so-called "flat" type detection, which returns the file
type based solely on the file extension. So basically we pass the link to an
external OS handler only if the extension isn't of a native LO file type. The
reason is that we want to load native documents internally as documents, not to
open them in an external app. One possible solution might be to limit this
native format handling to a set of known protocols, or even just to file://.
But I'm not familiar with this hyperlink stuff, so don't know whether it's a
good idea to change anything here, or what scenarios we attempt to support.

-- 
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/20200903/2a90d0fe/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list