diff options
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index a2e3fc5e3f10..89d8266aa9bd 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 |