[poppler] qt4/src
Albert Astals Cid
aacid at kemper.freedesktop.org
Tue Nov 1 16:56:04 PDT 2011
qt4/src/poppler-document.cc | 6 +++---
qt4/src/poppler-private.h | 17 +++++++++++++++--
2 files changed, 18 insertions(+), 5 deletions(-)
New commits:
commit e0f5bc1deebaa9861baffd7c9ba31ea31585cd1d
Author: Hib Eris <hib at hiberis.nl>
Date: Tue Nov 1 14:15:09 2011 +0100
qt4: Use PDFDoc(wchar_t *, ...) on Windows
Bug 35378
diff --git a/qt4/src/poppler-document.cc b/qt4/src/poppler-document.cc
index 04c56c6..7b3e1af 100644
--- a/qt4/src/poppler-document.cc
+++ b/qt4/src/poppler-document.cc
@@ -3,7 +3,7 @@
* Copyright (C) 2005, 2008, Brad Hards <bradh at frogmouth.net>
* Copyright (C) 2005-2010, Albert Astals Cid <aacid at kde.org>
* Copyright (C) 2006-2010, Pino Toscano <pino at kde.org>
- * Copyright (C) 2010 Hib Eris <hib at hiberis.nl>
+ * Copyright (C) 2010, 2011 Hib Eris <hib at hiberis.nl>
*
* 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
@@ -50,7 +50,7 @@ namespace Poppler {
Document *Document::load(const QString &filePath, const QByteArray &ownerPassword,
const QByteArray &userPassword)
{
- DocumentData *doc = new DocumentData(new GooString(QFile::encodeName(filePath)),
+ DocumentData *doc = new DocumentData(filePath,
new GooString(ownerPassword.data()),
new GooString(userPassword.data()));
return DocumentData::checkDocument(doc);
@@ -128,7 +128,7 @@ namespace Poppler {
}
else
{
- doc2 = new DocumentData(new GooString(m_doc->doc->getFileName()),
+ doc2 = new DocumentData(m_doc->m_filePath,
new GooString(ownerPassword.data()),
new GooString(userPassword.data()));
}
diff --git a/qt4/src/poppler-private.h b/qt4/src/poppler-private.h
index 6d2b315..36af055 100644
--- a/qt4/src/poppler-private.h
+++ b/qt4/src/poppler-private.h
@@ -4,6 +4,7 @@
* Copyright (C) 2006-2009, 2011 by Albert Astals Cid <aacid at kde.org>
* Copyright (C) 2007-2009, 2011 by Pino Toscano <pino at kde.org>
* Copyright (C) 2011 Andreas Hartmetz <ahartmetz at gmail.com>
+ * Copyright (C) 2011 Hib Eris <hib at hiberis.nl>
* Inspired on code by
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos at terra.es>
* Copyright (C) 2004 by Enrico Ros <eros.kde at email.it>
@@ -75,10 +76,21 @@ namespace Poppler {
class DocumentData {
public:
- DocumentData(GooString *filePath, GooString *ownerPassword, GooString *userPassword)
+ DocumentData(const QString &filePath, GooString *ownerPassword, GooString *userPassword)
{
init();
- doc = new PDFDoc(filePath, ownerPassword, userPassword);
+ m_filePath = filePath;
+
+#if defined(_WIN32)
+ wchar_t *fileName = new WCHAR[filePath.length()];
+ int length = filePath.toWCharArray(fileName);
+ doc = new PDFDoc(fileName, length, ownerPassword, userPassword);
+ delete fileName;
+#else
+ GooString *fileName = new GooString(QFile::encodeName(filePath));
+ doc = new PDFDoc(fileName, ownerPassword, userPassword);
+#endif
+
delete ownerPassword;
delete userPassword;
}
@@ -173,6 +185,7 @@ namespace Poppler {
static Document *checkDocument(DocumentData *doc);
PDFDoc *doc;
+ QString m_filePath;
QByteArray fileContents;
bool locked;
FontIterator *m_fontInfoIterator;
More information about the poppler
mailing list