diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-08-24 10:27:01 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-08-24 13:14:44 +0200 |
commit | 185a14525f114e58b48236284ed8e8644bc40e48 (patch) | |
tree | 1e2e481ddc6d3480f474078a9cf01effba8e0285 /filter | |
parent | 91a70317a34826549ed2b1089b3a8e5b0200bdd6 (diff) |
iRelated rhbz#1618703: Properly handle failure en-/decoding PDF file
...when e.g. FIPS mode makes the various calls to rtl_cipher_initARCFOUR fail.
Change-Id: Id1b2222249c151470e233ab814b21228f3a8b561
Reviewed-on: https://gerrit.libreoffice.org/59543
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/pdf/impdialog.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 861611cc51c9..255aaa7d0257 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -22,6 +22,7 @@ #include "impdialog.hxx" #include <strings.hrc> #include <officecfg/Office/Common.hxx> +#include <vcl/errinf.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> @@ -1173,6 +1174,15 @@ IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, weld::Button&, void) mbHaveOwnerPassword = !aOwnerPW.isEmpty(); mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW ); + if (!mxPreparedPasswords.is()) { + OUString msg; + ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); //TOOD: handle failure + std::unique_ptr<weld::MessageDialog>( + Application::CreateMessageDialog( + GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, msg)) + ->run(); + return; + } if( mbHaveOwnerPassword ) { |