[poppler] 2 commits - qt4/src

Pino Toscano pino at kemper.freedesktop.org
Sat Feb 9 08:58:59 PST 2008


 qt4/src/poppler-qiodeviceoutstream.cc |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit afb255366d56551bdc307766199bef9c5021d3ac
Merge: 8c44b17... 8cb0e75...
Author: Pino Toscano <pino at kde.org>
Date:   Sat Feb 9 17:58:49 2008 +0100

    Merge branch 'master' of ssh://pino@git.freedesktop.org/git/poppler/poppler

commit 8c44b175081983c492821858341109fee9e86b16
Author: Pino Toscano <pino at kde.org>
Date:   Sat Feb 9 17:57:57 2008 +0100

    Do not rely on GNU extensions, but at least use Qt.

diff --git a/qt4/src/poppler-qiodeviceoutstream.cc b/qt4/src/poppler-qiodeviceoutstream.cc
index 11fab97..e79314e 100644
--- a/qt4/src/poppler-qiodeviceoutstream.cc
+++ b/qt4/src/poppler-qiodeviceoutstream.cc
@@ -20,10 +20,10 @@
 
 #include <QtCore/QIODevice>
 
-#include <iostream>
-
 #include <stdio.h>
 
+#define QIODeviceOutStreamBufSize 8192
+
 namespace Poppler {
 
 QIODeviceOutStream::QIODeviceOutStream(QIODevice* device)
@@ -58,14 +58,11 @@ void QIODeviceOutStream::printf(const char *format, ...)
 {
   va_list ap;
   va_start(ap, format);
-  char* buf = 0;
+  char buf[QIODeviceOutStreamBufSize];
   size_t bufsize = 0;
-  FILE* stream = open_memstream(&buf, &bufsize);
-  vfprintf(stream, format, ap);
+  bufsize = qvsnprintf(buf, QIODeviceOutStreamBufSize - 1, format, ap);
   va_end(ap);
-  fclose(stream);
   m_device->write(buf, bufsize);
-  free(buf);
 }
 
 }


More information about the poppler mailing list