[poppler] qt4/src

Pino Toscano pino at kemper.freedesktop.org
Sat Dec 20 13:29:06 PST 2008


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

New commits:
commit c976770c64e4c991fff27e413414473583b6fd86
Author: Pino Toscano <pino at kde.org>
Date:   Sat Dec 20 22:25:55 2008 +0100

    [Qt4] use QHash instead of QMap where applicable
    
    using a hash table instead of a map mapes lookup faster;
    in these cases we don't need the sorting a map gives

diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc
index 50c733e..bef5d0a 100644
--- a/qt4/src/poppler-page.cc
+++ b/qt4/src/poppler-page.cc
@@ -22,6 +22,7 @@
 
 #include <poppler-qt4.h>
 
+#include <QtCore/QHash>
 #include <QtCore/QMap>
 #include <QtCore/QVarLengthArray>
 #include <QtGui/QImage>
@@ -365,7 +366,7 @@ QList<TextBox*> Page::textList(Rotation rotate) const
     return output_list;
   }
   
-  QMap<TextWord *, TextBox*> wordBoxMap;
+  QHash<TextWord *, TextBox*> wordBoxMap;
   
   for (int i = 0; i < word_list->getLength(); i++) {
     TextWord *word = word_list->get(i);
@@ -502,7 +503,7 @@ QList<Annotation*> Page::annotations() const
 
     // ID to Annotation/PopupWindow maps
     QMap< int, Annotation * > annotationsMap;
-    QMap< AnnotPopup *, PopupWindow * > popupsMap;
+    QHash< AnnotPopup *, PopupWindow * > popupsMap;
     // lists of Windows and Revisions that needs resolution
     QLinkedList< ResolveRevision > resolveRevList;
     QLinkedList< ResolveWindow > resolvePopList;
@@ -1171,7 +1172,7 @@ QList<Annotation*> Page::annotations() const
         }
 
         // clear data
-        QMap< AnnotPopup *, PopupWindow * >::Iterator dIt = popupsMap.begin(), dEnd = popupsMap.end();
+        QHash< AnnotPopup *, PopupWindow * >::Iterator dIt = popupsMap.begin(), dEnd = popupsMap.end();
         for ( ; dIt != dEnd; ++dIt )
         {
             PopupWindow * p = dIt.value();


More information about the poppler mailing list