[poppler] qt4/src
Pino Toscano
pino at kemper.freedesktop.org
Mon Mar 2 06:21:04 PST 2009
qt4/src/poppler-pdf-converter.cc | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
New commits:
commit de3131ae38fc9442b198d4d7b0c57c6939ad66ce
Author: Pino Toscano <pino at kde.org>
Date: Mon Mar 2 15:20:07 2009 +0100
[Qt4] adapt to the new PDFDoc saving API
store the error code instead of the bool
diff --git a/qt4/src/poppler-pdf-converter.cc b/qt4/src/poppler-pdf-converter.cc
index 995d46e..d0fed5b 100644
--- a/qt4/src/poppler-pdf-converter.cc
+++ b/qt4/src/poppler-pdf-converter.cc
@@ -25,6 +25,8 @@
#include <QtCore/QFile>
+#include <ErrorCodes.h>
+
namespace Poppler {
class PDFConverterPrivate : public BaseConverterPrivate
@@ -79,18 +81,18 @@ bool PDFConverter::convert()
if (QFile *file = qobject_cast<QFile*>(dev))
deleteFile = !file->exists();
- bool success;
+ int errorCode = errNone;
QIODeviceOutStream stream(dev);
if (d->opts & WithChanges)
{
- success = d->document->doc->saveAs(&stream);
+ errorCode = d->document->doc->saveAs(&stream);
}
else
{
- success = d->document->doc->saveWithoutChangesAs(&stream);
+ errorCode = d->document->doc->saveWithoutChangesAs(&stream);
}
d->closeDevice();
- if (!success)
+ if (errorCode != errNone)
{
if (deleteFile)
{
@@ -98,7 +100,7 @@ bool PDFConverter::convert()
}
}
- return success;
+ return (errorCode == errNone);
}
}
More information about the poppler
mailing list