summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-02-25 15:07:19 +0000
committerAndras Timar <andras.timar@collabora.com>2018-03-27 12:23:01 +0200
commit9554b95413c82ee4e18e08a69fb7a6477b0c9e22 (patch)
tree9b713b8b2dac21709af81639ee68baa7a982dfd6 /uui
parentfdc21b3f40b66efeb98ca81b8caee5cd3e76673e (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> (cherry picked from commit 25e4b59b2e9805ebd3c38c40e5591125a05ed5b0)
Diffstat (limited to 'uui')
-rw-r--r--uui/inc/ids.hrc2
-rw-r--r--uui/inc/ids.hxx1
-rw-r--r--uui/source/iahndl.cxx25
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 2d7be0930178..c89a4d038bc7 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)
{