diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2008-04-24 17:36:20 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2008-04-24 17:36:20 +0000 |
commit | f9fef426a220079258a8d81f5debebe21318f3f3 (patch) | |
tree | f82a49bfbe9c300bb331d1711762eea33bbf81e4 /xpdf | |
parent | a40c5862f8bf0c0bc496b6018a1e8579b1287076 (diff) |
INTEGRATION: CWS pdfimportfix (1.1.4); FILE MERGED
2008/04/22 09:04:45 akhva 1.1.4.1: PDF perpitions handling
Diffstat (limited to 'xpdf')
-rw-r--r-- | xpdf/wrapper/wrapper_gpl.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/xpdf/wrapper/wrapper_gpl.cxx b/xpdf/wrapper/wrapper_gpl.cxx index c3b1c5c4dbe2..c7b379614af1 100644 --- a/xpdf/wrapper/wrapper_gpl.cxx +++ b/xpdf/wrapper/wrapper_gpl.cxx @@ -4,9 +4,9 @@ * * $RCSfile: wrapper_gpl.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: thb $ $Date: 2007-12-05 14:16:44 $ + * last change: $Author: ihi $ $Date: 2008-04-24 18:36:20 $ * * The Contents of this file are made available subject to * the terms of GNU General Public License Version 2. @@ -35,6 +35,7 @@ ************************************************************************/ #include "pdfioutdev_gpl.hxx" +#include "SecurityHandler.h" #ifdef WNT # include <io.h> # include <fcntl.h> /*_O_BINARY*/ @@ -93,9 +94,21 @@ int main(int argc, char **argv) PDFDoc aDoc( pFileName, pOwnerPasswordStr, pUserPasswordStr ); + // Check various permissions. + if ( !aDoc.okToPrint() || + !aDoc.okToChange()|| + !aDoc.okToCopy()|| + !aDoc.okToAddNotes() ) + { + return 1; + } + + if( !aDoc.isOk() ) return 1; + if ((userPassword[0] != '\001')||(ownerPassword[0] != '\001')) + return 1; pdfi::PDFOutDev* pOutDev( new pdfi::PDFOutDev(&aDoc) ); |