diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-02-25 15:07:19 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-16 21:33:50 +0100 |
commit | 25e4b59b2e9805ebd3c38c40e5591125a05ed5b0 (patch) | |
tree | f8b27df1faf8cda23717a7686985e6bff279f824 /uui | |
parent | 2937661f0e9381f84067a025f76e5554b8a1a457 (diff) |
First cut at annotating 'exotic' filters.
The idea being that we can improve security by warning for these.
Change-Id: I7d993417bfb6a8fe868bc3e07ccbcfe71bf285ff
Reviewed-on: https://gerrit.libreoffice.org/50387
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'uui')
-rw-r--r-- | uui/inc/ids.hrc | 2 | ||||
-rw-r--r-- | uui/inc/ids.hxx | 1 | ||||
-rw-r--r-- | uui/source/iahndl.cxx | 25 |
3 files changed, 28 insertions, 0 deletions
diff --git a/uui/inc/ids.hrc b/uui/inc/ids.hrc index d5a418918ec5..84d409f083ef 100644 --- a/uui/inc/ids.hrc +++ b/uui/inc/ids.hrc @@ -34,6 +34,8 @@ const std::pair<const char*, ErrCode> RID_UUI_ERRHDL[] = ERRCODE_UUI_IO_TARGETALREADYEXISTS }, { NC_("RID_UUI_ERRHDL", "You are about to save/export a password protected basic library containing module(s) \n$(ARG1)\nwhich are too large to store in binary format. If you wish users that don't have access to the library password to be able to run macros in those module(s) you must split those modules into a number of smaller modules. Do you wish to continue to save/export this library?"), ERRCODE_UUI_IO_MODULESIZEEXCEEDED }, + { NC_("RID_UUI_ERRHDL", "Beware!\n\nYou are about to load a very unusual sort of file ($(ARG2)) from the URL:\n\n$(ARG1)\n\nAre you certain that this file is a legacy document created many years ago?"), + ERRCODE_UUI_IO_EXOTICFILEFORMAT }, { NC_("RID_UUI_ERRHDL", "The data from $(ARG1) has an incorrect checksum."), ERRCODE_UUI_IO_BADCRC }, { NC_("RID_UUI_ERRHDL", "The object $(ARG1) cannot be created in directory $(ARG2)."), diff --git a/uui/inc/ids.hxx b/uui/inc/ids.hxx index 2d3b6d4e7408..71beff973f02 100644 --- a/uui/inc/ids.hxx +++ b/uui/inc/ids.hxx @@ -86,6 +86,7 @@ #define ERRCODE_UUI_LOCKING_NOT_LOCKED ErrCode(ErrCodeArea::Uui, 61) #define ERRCODE_UUI_LOCKING_LOCK_EXPIRED ErrCode(ErrCodeArea::Uui, 62) #define ERRCODE_UUI_CANNOT_ACTIVATE_FACTORY ErrCode(ErrCodeArea::Uui, 63) +#define ERRCODE_UUI_IO_EXOTICFILEFORMAT ErrCode(ErrCodeArea::Uui, 64) #endif diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 228ff20af632..6dbe7df63e76 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/configuration/backend/StratumCreationException.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/document/BrokenPackageRequest.hpp> +#include <com/sun/star/document/ExoticFileLoadException.hpp> #include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp> #include <com/sun/star/java/WrongJavaVersionException.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -434,6 +435,30 @@ UUIInteractionHelper::handleRequest_impl( return true; } + document::ExoticFileLoadException aExoticFileLoadException; + if (aAnyRequest >>= aExoticFileLoadException) + { + std::vector< OUString > aArguments; + + if( !aExoticFileLoadException.URL.isEmpty() ) + { + aArguments.push_back( aExoticFileLoadException.URL ); + } + if( !aExoticFileLoadException.FilterUIName.isEmpty() ) + { + aArguments.push_back( aExoticFileLoadException.FilterUIName ); + } + + handleErrorHandlerRequest( task::InteractionClassification_WARNING, + ERRCODE_UUI_IO_EXOTICFILEFORMAT, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; + } + ucb::NameClashException aNCException; if (aAnyRequest >>= aNCException) { |