r22269 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Thu Dec 21 23:32:37 UTC 2017
Author: jghali
Date: Thu Dec 21 23:32:37 2017
New Revision: 22269
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22269
Log:
adapt code to poppler 0.62.0: on Windows, file names must now use UTF-8 encoding
Modified:
trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22269&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp Thu Dec 21 23:32:37 2017
@@ -82,7 +82,11 @@
globalParams = new GlobalParams();
if (globalParams)
{
+#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
+ GooString *fname = new GooString(pdfFile.toUtf8().data());
+#else
GooString *fname = new GooString(QFile::encodeName(pdfFile).data());
+#endif
globalParams->setErrQuiet(gTrue);
PDFDoc *pdfDoc = new PDFDoc(fname, NULL, NULL, NULL);
if (pdfDoc)
@@ -401,7 +405,11 @@
GooString *userPW = NULL;
if (globalParams)
{
+#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
+ GooString *fname = new GooString(fn.toUtf8().data());
+#else
GooString *fname = new GooString(QFile::encodeName(fn).data());
+#endif
globalParams->setErrQuiet(gTrue);
GBool hasOcg = gFalse;
QList<OptionalContentGroup*> ocgGroups;
@@ -421,7 +429,11 @@
QString text = QInputDialog::getText(mw, tr("Open PDF-File"), tr("Password"), QLineEdit::Normal, "", &ok);
if (ok && !text.isEmpty())
{
+#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
+ fname = new GooString(fn.toUtf8().data());
+#else
fname = new GooString(QFile::encodeName(fn).data());
+#endif
userPW = new GooString(text.toLocal8Bit().data());
pdfDoc = new PDFDoc(fname, userPW, userPW, NULL);
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
More information about the scribus-commit
mailing list