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-27 12:23:01 +0200 |
commit | 9554b95413c82ee4e18e08a69fb7a6477b0c9e22 (patch) | |
tree | 9b713b8b2dac21709af81639ee68baa7a982dfd6 /include | |
parent | fdc21b3f40b66efeb98ca81b8caee5cd3e76673e (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 'include')
-rw-r--r-- | include/comphelper/documentconstants.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/docfilt.hxx | 3 | ||||
-rw-r--r-- | include/sfx2/objsh.hxx | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/include/comphelper/documentconstants.hxx b/include/comphelper/documentconstants.hxx index 9447a7b17fc6..89d5178d33d5 100644 --- a/include/comphelper/documentconstants.hxx +++ b/include/comphelper/documentconstants.hxx @@ -83,6 +83,7 @@ // Preferred - preferred filter for a particular type // 3rdPartyFilter - implemented as a UNO component // Default - default filter for this document type +// Exotic - an unusual/legacy file-format, we don't normally see // // (The 3rdPartyFilter flag is here called StarONE) // @@ -106,6 +107,7 @@ enum class SfxFilterFlags CONSULTSERVICE = 0x00040000L, STARONEFILTER = 0x00080000L, PACKED = 0x00100000L, + EXOTIC = 0x00200000L, COMBINED = 0x00800000L, ENCRYPTION = 0x01000000L, @@ -118,7 +120,7 @@ enum class SfxFilterFlags namespace o3tl { - template<> struct typed_flags<SfxFilterFlags> : is_typed_flags<SfxFilterFlags, 0x779f157fL> {}; + template<> struct typed_flags<SfxFilterFlags> : is_typed_flags<SfxFilterFlags, 0x77bf157fL> {}; } #define SFX_FILTER_NOTINSTALLED (SfxFilterFlags::MUSTINSTALL | SfxFilterFlags::CONSULTSERVICE) diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx index 2e8cc62c177d..ceeae3cf980f 100644 --- a/include/sfx2/docfilt.hxx +++ b/include/sfx2/docfilt.hxx @@ -82,7 +82,10 @@ public: bool GetSupportsSigning() const { return bool(nFormatType & SfxFilterFlags::SUPPORTSSIGNING); } bool GetGpgEncryption() const { return bool(nFormatType & SfxFilterFlags::GPGENCRYPTION); } bool IsOwnTemplateFormat() const { return bool(nFormatType & SfxFilterFlags::TEMPLATEPATH); } + /// not our built-in format bool IsAlienFormat() const { return bool(nFormatType & SfxFilterFlags::ALIEN); } + /// an unusual/legacy file to be loading + bool IsExoticFormat() const { return bool(nFormatType & SfxFilterFlags::EXOTIC); } bool CanImport() const { return bool(nFormatType & SfxFilterFlags::IMPORT); } bool CanExport() const { return bool(nFormatType & SfxFilterFlags::EXPORT); } SfxFilterFlags GetFilterFlags() const { return nFormatType; } diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index b514989055bc..a17583b31c01 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -743,6 +743,9 @@ public: SAL_DLLPRIVATE void ImplSign( bool bScriptingContent = false ); SAL_DLLPRIVATE bool QuerySaveSizeExceededModules_Impl( const css::uno::Reference< css::task::XInteractionHandler >& xHandler ); + SAL_DLLPRIVATE bool QueryAllowExoticFormat_Impl( const css::uno::Reference< css::task::XInteractionHandler >& xHandler, + const OUString& rURL, + const OUString& rFilterUIName); SAL_DLLPRIVATE void CheckOut( ); SAL_DLLPRIVATE void CancelCheckOut( ); |