diff options
author | Eike Rathke <erack@redhat.com> | 2019-11-30 01:26:32 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-11-30 04:04:04 +0100 |
commit | 8bf39e6cfd988089bd0eab0958c96f8fc3413b9d (patch) | |
tree | 413caf0c29a186558ac1e23da116a502ab027431 /sfx2 | |
parent | e076a853fba28378bfce94eb597703a9a0c5a341 (diff) |
Resolves: tdf#97086 Allow "unlimited" password length for OOXML encryption
Change-Id: I51175424e19ad02b81120c3fdea22732cd481a8d
Reviewed-on: https://gerrit.libreoffice.org/84097
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit adb7106a7c805d332c8098891996a75e6ec4caf8)
Reviewed-on: https://gerrit.libreoffice.org/84100
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index a6a9dc675054..8e99b47bd4bd 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2660,8 +2660,11 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, uno::Reference<task::XInteractionHandler2> xInteractionHandler = task::InteractionHandler::createWithParent(::comphelper::getProcessComponentContext(), rParent); // TODO: need a save way to distinguish MS filters from other filters // for now MS-filters are the only alien filters that support encryption - bool bMSType = !pCurrentFilter->IsOwnFormat(); - ::comphelper::DocPasswordRequestType eType = bMSType ? + const bool bMSType = !pCurrentFilter->IsOwnFormat(); + // For OOXML we can use the standard password ("unlimited" characters) + // request, otherwise the MS limited password request is needed. + const bool bOOXML = bMSType && lclSupportsOOXMLEncryption( pCurrentFilter->GetFilterName()); + const ::comphelper::DocPasswordRequestType eType = bMSType && !bOOXML ? ::comphelper::DocPasswordRequestType::MS : ::comphelper::DocPasswordRequestType::Standard; @@ -2696,8 +2699,7 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, // TODO/LATER: The filters should show the password dialog themself in future if ( bMSType ) { - // Check if filter supports OOXML encryption - if ( lclSupportsOOXMLEncryption( pCurrentFilter->GetFilterName() ) ) + if (bOOXML) { ::comphelper::SequenceAsHashMap aHashData; aHashData[ OUString( "OOXPassword" ) ] <<= pPasswordRequest->getPassword(); |