[poppler] qt4/src

Albert Astals Cid aacid at kemper.freedesktop.org
Thu Mar 10 15:25:11 PST 2011


 qt4/src/poppler-private.cc |    5 +----
 qt4/src/poppler-private.h  |   12 ++++++++----
 2 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit f2fcafdc2b982d9bbed3c01bc7d45c8bd0603f19
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Mar 10 23:27:41 2011 +0000

    Create the globalParams before the pdfdoc

diff --git a/qt4/src/poppler-private.cc b/qt4/src/poppler-private.cc
index d6e3265..c47fbe8 100644
--- a/qt4/src/poppler-private.cc
+++ b/qt4/src/poppler-private.cc
@@ -239,7 +239,7 @@ namespace Debug {
         }
       }
     
-    void DocumentData::init(GooString *ownerPassword, GooString *userPassword)
+    void DocumentData::init()
     {
         m_fontInfoIterator = 0;
         m_backend = Document::SplashBackend;
@@ -247,9 +247,6 @@ namespace Debug {
         paperColor = Qt::white;
         m_hints = 0;
         m_optContentModel = 0;
-        // It might be more appropriate to delete these in PDFDoc
-        delete ownerPassword;
-        delete userPassword;
       
         if ( count == 0 )
         {
diff --git a/qt4/src/poppler-private.h b/qt4/src/poppler-private.h
index 7d0b1a3..a104bf8 100644
--- a/qt4/src/poppler-private.h
+++ b/qt4/src/poppler-private.h
@@ -76,8 +76,10 @@ namespace Poppler {
     public:
 	DocumentData(GooString *filePath, GooString *ownerPassword, GooString *userPassword)
 	    {
+		init();
 		doc = new PDFDoc(filePath, ownerPassword, userPassword);
-		init(ownerPassword, userPassword);
+		delete ownerPassword;
+		delete userPassword;
 	    }
 	
 	DocumentData(const QByteArray &data, GooString *ownerPassword, GooString *userPassword)
@@ -86,11 +88,13 @@ namespace Poppler {
 		fileContents = data;
 		obj.initNull();
 		MemStream *str = new MemStream((char*)fileContents.data(), 0, fileContents.length(), &obj);
-	        doc = new PDFDoc(str, ownerPassword, userPassword);
-		init(ownerPassword, userPassword);
+		init();
+		doc = new PDFDoc(str, ownerPassword, userPassword);
+		delete ownerPassword;
+		delete userPassword;
 	    }
 	
-	void init(GooString *ownerPassword, GooString *userPassword);
+	void init();
 	
 	~DocumentData();
 	


More information about the poppler mailing list