diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2023-11-27 09:56:27 +0100 |
---|---|---|
committer | Aron Budea <aron.budea@collabora.com> | 2024-03-11 05:11:48 +0100 |
commit | 1278be1beeb2200c5df89fb3189342491fc42b2d (patch) | |
tree | 7406613a1a5afb2ec8f2d335b37299e8126a3609 | |
parent | d02b2d23c8d3dec8585df17cd2fe6f68e0a707b3 (diff) |
lok: Block requests to load external references
- currently in LOK case we don't open multiple files in
one "environment"
- currently it opens import dialog which is synchronous - and that
blocks whole app
Change-Id: I11c2c7f602ecf1e29b3d6fb2930ce873749bc2ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159984
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit 42109bda9972738b6e7a4448127458c7d24be4dc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164505
-rw-r--r-- | sc/source/core/tool/webservicelink.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/docshell/externalrefmgr.cxx | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/core/tool/webservicelink.cxx b/sc/source/core/tool/webservicelink.cxx index 12fe4785ebca..a1c307eb8e70 100644 --- a/sc/source/core/tool/webservicelink.cxx +++ b/sc/source/core/tool/webservicelink.cxx @@ -7,6 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <sfx2/linkmgr.hxx> #include <sfx2/bindings.hxx> @@ -35,6 +36,13 @@ sfx2::SvBaseLink::UpdateResult ScWebServiceLink::DataChanged(const OUString&, co aResult.clear(); bHasResult = false; + if (comphelper::LibreOfficeKit::isActive()) + { + SAL_WARN("sc.ui", "ScWebServiceLink::DataChanged: blocked access to external file: \"" + << aURL << "\""); + return ERROR_GENERAL; + } + css::uno::Reference<css::ucb::XSimpleFileAccess3> xFileAccess = css::ucb::SimpleFileAccess::create(comphelper::getProcessComponentContext()); if (!xFileAccess.is()) diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 4e0512a711a6..329a7274b7e7 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -2530,6 +2530,12 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt if (!isFileLoadable(aFile)) return nullptr; + if (comphelper::LibreOfficeKit::isActive()) + { + SAL_WARN( "sc.ui", "ScExternalRefManager::loadSrcDocument: blocked access to external file: \"" << aFile << "\""); + return nullptr; + } + OUString aOptions = pFileData->maFilterOptions; if ( !pFileData->maFilterName.isEmpty() ) rFilter = pFileData->maFilterName; // don't overwrite stored filter with guessed filter |