tdf#136427: Attempt opening native documents for known protocols only.

Only try to open native documents (ODT, ODS, etc.) in frame for known protocols.

This is to prevent LO from trying to handle internal protocol links when the
file has a native extension.

Change-Id: I908783b0d24330ec44caa9ddeca2511426001cf7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131449
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index a2e3fc5..89d8266 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -843,9 +843,18 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
                return;
            }

            const OUString aTypeName { xTypeDetection->queryTypeByURL( aURL.Main ) };
            SfxFilterMatcher& rMatcher = SfxGetpApp()->GetFilterMatcher();
            std::shared_ptr<const SfxFilter> pFilter = rMatcher.GetFilter4EA( aTypeName );
            std::shared_ptr<const SfxFilter> pFilter{};

            // attempt loading native documents only if they are from a known protocol
            // it might be sensible to limit the set of protocols even further, but that
            // may cause regressions, needs further testing
            // see tdf#136427 for details
            if (aINetProtocol != INetProtocol::NotValid) {
                const OUString aTypeName { xTypeDetection->queryTypeByURL( aURL.Main ) };
                SfxFilterMatcher& rMatcher = SfxGetpApp()->GetFilterMatcher();
                pFilter = rMatcher.GetFilter4EA( aTypeName );
            }

            if (!pFilter || !lcl_isFilterNativelySupported(*pFilter))
            {
                // hyperlink does not link to own type => special handling (http, ftp) browser and (other external protocols) OS