[poppler] poppler/qt4/src: poppler-document.cc, 1.8, 1.9 poppler-qt4.h, 1.7, 1.8

Brad Hards bradh at freedesktop.org
Sat Aug 6 12:16:00 EST 2005


Update of /cvs/poppler/poppler/qt4/src
In directory gabe:/tmp/cvs-serv29585/qt4/src

Modified Files:
	poppler-document.cc poppler-qt4.h 
Log Message:
Add password arguments to document constructor.


Index: poppler-document.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-document.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- poppler-document.cc	28 Jul 2005 17:34:19 -0000	1.8
+++ poppler-document.cc	6 Aug 2005 02:15:58 -0000	1.9
@@ -1,5 +1,6 @@
 /* poppler-document.cc: qt interface to poppler
  * Copyright (C) 2005, Net Integration Technologies, Inc.
+ * Copyright (C) 2005, Brad Hards <bradh at frogmouth.net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,13 +32,16 @@
 
 namespace Poppler {
 
-    Document *Document::load(const QString &filePath)
+  Document *Document::load(const QString &filePath, const QByteArray &ownerPassword,
+			   const QByteArray &userPassword)
     {
 	if (!globalParams) {
 	    globalParams = new GlobalParams("/etc/xpdfrc");
 	}
 
-	DocumentData *doc = new DocumentData(new GooString(QFile::encodeName(filePath)), NULL, NULL);
+	DocumentData *doc = new DocumentData(new GooString(QFile::encodeName(filePath)), 
+					     new GooString(ownerPassword.data()),
+					     new GooString(userPassword.data()));
 	Document *pdoc;
 	if (doc->doc.isOk() || doc->doc.getErrorCode() == errEncrypted) {
 	    pdoc = new Document(doc);

Index: poppler-qt4.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-qt4.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- poppler-qt4.h	7 Jul 2005 21:15:09 -0000	1.7
+++ poppler-qt4.h	6 Aug 2005 02:15:58 -0000	1.8
@@ -205,7 +205,9 @@
 
 	   \param filePath the name (and path, if required) of the file to load
 	*/
-	static Document *Document::load(const QString & filePath);
+	static Document *Document::load(const QString & filePath,
+					const QByteArray &ownerPassword=QByteArray(),
+					const QByteArray &userPassword=QByteArray());
   
 	/**
 	   Get a specified page



More information about the poppler mailing list