diff options
author | Albert Astals Cid <aacid@kde.org> | 2011-03-10 23:27:41 +0000 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2011-03-10 23:27:41 +0000 |
commit | f2fcafdc2b982d9bbed3c01bc7d45c8bd0603f19 (patch) | |
tree | 4419108659751014f3d8ce4248068a18b68b0b61 /qt4 | |
parent | f956b03604b195623ab034a06942a39547adf905 (diff) |
Create the globalParams before the pdfdoc
Diffstat (limited to 'qt4')
-rw-r--r-- | qt4/src/poppler-private.cc | 5 | ||||
-rw-r--r-- | qt4/src/poppler-private.h | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/qt4/src/poppler-private.cc b/qt4/src/poppler-private.cc index d6e3265d..c47fbe83 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 7d0b1a33..a104bf87 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(); |