[poppler] 3 commits - qt4/tests utils/pdftoabw.cc

Pino Toscano pino at kemper.freedesktop.org
Sat Feb 9 18:19:37 PST 2008


 qt4/tests/poppler-attachments.cpp |    4 +++-
 qt4/tests/poppler-fonts.cpp       |    6 ++++--
 qt4/tests/stress-poppler-dir.cpp  |   11 +++++++----
 qt4/tests/stress-poppler-qt4.cpp  |   11 +++++++----
 qt4/tests/test-password-qt4.cpp   |   12 +++++++-----
 qt4/tests/test-poppler-qt4.cpp    |   14 +++++++++-----
 utils/pdftoabw.cc                 |    6 +++---
 7 files changed, 40 insertions(+), 24 deletions(-)

New commits:
commit 5915e57e7785370ce305cbbb3c2fedf36886689f
Author: Pino Toscano <pino at kde.org>
Date:   Sun Feb 10 03:19:18 2008 +0100

    const & in foreach

diff --git a/qt4/tests/poppler-fonts.cpp b/qt4/tests/poppler-fonts.cpp
index 7861449..6b66ec4 100644
--- a/qt4/tests/poppler-fonts.cpp
+++ b/qt4/tests/poppler-fonts.cpp
@@ -27,7 +27,7 @@ int main( int argc, char **argv )
     std::cout << "------------------------------------ ------------ --- --- ---------";
     std::cout << std::endl;
   
-    foreach( Poppler::FontInfo font, doc->fonts() ) {
+    foreach( const Poppler::FontInfo &font, doc->fonts() ) {
 	if (font.name().isNull()) {
 	    std::cout << qPrintable( QString("%1").arg(QString("[none]"), -37) );
 	} else {
diff --git a/qt4/tests/stress-poppler-dir.cpp b/qt4/tests/stress-poppler-dir.cpp
index 6d38814..1ec7ec3 100644
--- a/qt4/tests/stress-poppler-dir.cpp
+++ b/qt4/tests/stress-poppler-dir.cpp
@@ -16,7 +16,7 @@ int main( int argc, char **argv )
     t.start();
 
     QDir directory( argv[1] );
-    foreach ( const QString fileName, directory.entryList() ) {
+    foreach ( const QString &fileName, directory.entryList() ) {
         if (fileName.endsWith("pdf") ) {
 	    qDebug() << "Doing" << fileName.toLatin1().data() << ":";
 	    Poppler::Document *doc = Poppler::Document::load( directory.canonicalPath()+"/"+fileName );
diff --git a/qt4/tests/stress-poppler-qt4.cpp b/qt4/tests/stress-poppler-qt4.cpp
index 09f0287..7fedae2 100644
--- a/qt4/tests/stress-poppler-qt4.cpp
+++ b/qt4/tests/stress-poppler-qt4.cpp
@@ -25,7 +25,7 @@ int main( int argc, char **argv )
     QStringList excludeSubDirs;
     excludeSubDirs << "000048" << "000607";
 
-    foreach ( QString subdir, dbDir.entryList(QStringList() << "0000*", QDir::Dirs) ) {
+    foreach ( const QString &subdir, dbDir.entryList(QStringList() << "0000*", QDir::Dirs) ) {
 	if ( excludeSubDirs.contains(subdir) ) {
 	    // then skip it
 	} else {
diff --git a/qt4/tests/test-password-qt4.cpp b/qt4/tests/test-password-qt4.cpp
index f267338..abc2f4f 100644
--- a/qt4/tests/test-password-qt4.cpp
+++ b/qt4/tests/test-password-qt4.cpp
@@ -119,7 +119,7 @@ int main( int argc, char **argv )
     qDebug() << "OK to add notes: " << doc->okToAddNotes();
     qDebug() << "      Page mode: " << doc->pageMode();
     QStringList fontNameList;
-    foreach( Poppler::FontInfo font, doc->fonts() )
+    foreach( const Poppler::FontInfo &font, doc->fonts() )
 	fontNameList += font.name();
     qDebug() << "          Fonts: " << fontNameList.join( ", " );
 
diff --git a/qt4/tests/test-poppler-qt4.cpp b/qt4/tests/test-poppler-qt4.cpp
index a9493f5..ac3aa23 100644
--- a/qt4/tests/test-poppler-qt4.cpp
+++ b/qt4/tests/test-poppler-qt4.cpp
@@ -144,7 +144,7 @@ int main( int argc, char **argv )
     qDebug() << "      Page mode: " << doc->pageMode();
     qDebug() << "       Metadata: " << doc->metadata();
     QStringList fontNameList;
-    foreach( Poppler::FontInfo font, doc->fonts() )
+    foreach( const Poppler::FontInfo &font, doc->fonts() )
 	fontNameList += font.name();
     qDebug() << "          Fonts: " << fontNameList.join( ", " );
 
commit d8374e0c2eb3ba05be101687e20c5fcbc42c1ad0
Author: Pino Toscano <pino at kde.org>
Date:   Sun Feb 10 01:32:24 2008 +0100

    Include only what needed; remove extra includes.

diff --git a/qt4/tests/poppler-attachments.cpp b/qt4/tests/poppler-attachments.cpp
index 8889c8a..992dc56 100644
--- a/qt4/tests/poppler-attachments.cpp
+++ b/qt4/tests/poppler-attachments.cpp
@@ -1,4 +1,6 @@
-#include <QtCore/QtCore>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
+
 #include <iostream>
 
 #include <poppler-qt4.h>
diff --git a/qt4/tests/poppler-fonts.cpp b/qt4/tests/poppler-fonts.cpp
index f5130c3..7861449 100644
--- a/qt4/tests/poppler-fonts.cpp
+++ b/qt4/tests/poppler-fonts.cpp
@@ -1,4 +1,6 @@
-#include <QtCore/QtCore>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
+
 #include <iostream>
 
 #include <poppler-qt4.h>
diff --git a/qt4/tests/stress-poppler-dir.cpp b/qt4/tests/stress-poppler-dir.cpp
index 3cdd6bc..6d38814 100644
--- a/qt4/tests/stress-poppler-dir.cpp
+++ b/qt4/tests/stress-poppler-dir.cpp
@@ -1,7 +1,10 @@
+#include <QtCore/QDebug>
+#include <QtCore/QDir>
+#include <QtCore/QTime>
+#include <QtGui/QApplication>
+#include <QtGui/QImage>
+
 #include <iostream>
-#include <QtCore/QtCore>
-#include <QtGui/QtGui>
-#include <ctype.h>
 
 #include <poppler-qt4.h>
 
diff --git a/qt4/tests/stress-poppler-qt4.cpp b/qt4/tests/stress-poppler-qt4.cpp
index 975b523..09f0287 100644
--- a/qt4/tests/stress-poppler-qt4.cpp
+++ b/qt4/tests/stress-poppler-qt4.cpp
@@ -1,7 +1,10 @@
+#include <QtCore/QDebug>
+#include <QtCore/QDir>
+#include <QtCore/QTime>
+#include <QtGui/QApplication>
+#include <QtGui/QImage>
+
 #include <iostream>
-#include <QtCore/QtCore>
-#include <QtGui/QtGui>
-#include <ctype.h>
 
 #include <poppler-qt4.h>
 
diff --git a/qt4/tests/test-password-qt4.cpp b/qt4/tests/test-password-qt4.cpp
index 736be3a..f267338 100644
--- a/qt4/tests/test-password-qt4.cpp
+++ b/qt4/tests/test-password-qt4.cpp
@@ -1,7 +1,9 @@
-#include <stdlib.h>
-#include <QtCore/QtCore>
-#include <QtGui/QtGui>
-#include <ctype.h>
+#include <QtCore/QDebug>
+#include <QtGui/QApplication>
+#include <QtGui/QImage>
+#include <QtGui/QPainter>
+#include <QtGui/QPaintEvent>
+#include <QtGui/QWidget>
 
 #include <poppler-qt4.h>
 
diff --git a/qt4/tests/test-poppler-qt4.cpp b/qt4/tests/test-poppler-qt4.cpp
index 6fba0a0..a9493f5 100644
--- a/qt4/tests/test-poppler-qt4.cpp
+++ b/qt4/tests/test-poppler-qt4.cpp
@@ -1,7 +1,11 @@
-#include <stdlib.h>
-#include <QtCore/QtCore>
-#include <QtGui/QtGui>
-#include <ctype.h>
+#include <QtCore/QDebug>
+#include <QtCore/QFile>
+#include <QtGui/QApplication>
+#include <QtGui/QImage>
+#include <QtGui/QLabel>
+#include <QtGui/QPainter>
+#include <QtGui/QPaintEvent>
+#include <QtGui/QWidget>
 
 #include <poppler-qt4.h>
 
commit fa01a1115c4554b18c3462b568d76860d2fbe17b
Author: Pino Toscano <pino at kde.org>
Date:   Sun Feb 10 01:09:57 2008 +0100

    Comment out unused vars.

diff --git a/utils/pdftoabw.cc b/utils/pdftoabw.cc
index 1688481..646f996 100644
--- a/utils/pdftoabw.cc
+++ b/utils/pdftoabw.cc
@@ -40,7 +40,7 @@ GBool stout = gFalse;
 static char ownerPassword[33] = "";
 static char userPassword[33] = "";
 
-static char textEncName[128] = "";
+// static char textEncName[128] = "";
 
 static ArgDesc argDesc[] = {
   {"-f",      argInt,      &firstPage,     0,
@@ -63,9 +63,9 @@ static ArgDesc argDesc[] = {
 int main(int argc, char *argv[]) {
   PDFDoc *doc = NULL;
   GooString *fileName = NULL;
-  GooString *abwFileName = NULL;
+//  GooString *abwFileName = NULL;
   ABWOutputDev *abwOut = NULL;
-  GBool ok;
+//  GBool ok;
   GooString *ownerPW, *userPW;
   Object info;
 


More information about the poppler mailing list