summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-08-15 11:04:59 +0200
committerTomaž Vajngerl <quikee@gmail.com>2013-08-15 17:18:20 +0200
commitef947839c9e6e5e86e11f7a7cbf13470010ca48f (patch)
treeff0b6e0ee938eec7de56099c781df0cb310562bc /sfx2
parente06e0fd5ead2eeb7fcf221e53b646ea7efc337ef (diff)
fdo#59524 Enable encryption for docx, pptx and standard OOXML formats
Change-Id: Id00fde15188be3fb7209d8f14f2f2f07ebd211b0
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index b9132ebef151..60de2670b61f 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -122,6 +122,21 @@ using namespace ::cppu;
namespace sfx2
{
+namespace
+{
+ bool lclSupportsOOXMLEncryption(OUString aFilterName)
+ {
+ return aFilterName == "Calc MS Excel 2007 XML"
+ || aFilterName == "MS Word 2007 XML"
+ || aFilterName == "Impress MS PowerPoint 2007 XML"
+ || aFilterName == "Impress MS PowerPoint 2007 XML AutoPlay"
+ || aFilterName == "Calc Office Open XML"
+ || aFilterName == "Impress Office Open XML"
+ || aFilterName == "Impress Office Open XML AutoPlay"
+ || aFilterName == "Office Open XML Text";
+ }
+}
+
const OUString* GetLastFilterConfigId( FileDialogHelper::Context _eContext )
{
static const OUString aSD_EXPORT_IDENTIFIER( "SdExportLastFilter" );
@@ -2719,7 +2734,8 @@ ErrCode RequestPassword(const SfxFilter* pCurrentFilter, OUString& aURL, SfxItem
// TODO/LATER: The filters should show the password dialog themself in future
if ( bMSType )
{
- if ( pCurrentFilter->GetFilterName() == "Calc MS Excel 2007 XML" )
+ // Check if filter supports OOXML encryption
+ if ( lclSupportsOOXMLEncryption( pCurrentFilter->GetFilterName() ) )
{
::comphelper::SequenceAsHashMap aHashData;
aHashData[ OUString( "Password" ) ] <<= pPasswordRequest->getPassword();