[poppler] Branch 'poppler-0.10' - qt4/src

Pino Toscano pino at kemper.freedesktop.org
Tue Jan 6 12:54:39 PST 2009


 qt4/src/poppler-document.cc |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 5618041108d825fbf9b557e6920a1c5efcb652b1
Author: Pino Toscano <pino at kde.org>
Date:   Tue Jan 6 21:49:25 2009 +0100

    [Qt4] make Document::fonts() working also when called more than once for each document.
    
    Instead of relying on the "broken" Document::scanForFonts(), create and use an own FontInfoScanner.
    This fixes bug #19405 also in poppler 0.10.

diff --git a/qt4/src/poppler-document.cc b/qt4/src/poppler-document.cc
index cf94062..1bc9189 100644
--- a/qt4/src/poppler-document.cc
+++ b/qt4/src/poppler-document.cc
@@ -181,7 +181,18 @@ namespace Poppler {
     QList<FontInfo> Document::fonts() const
     {
 	QList<FontInfo> ourList;
-	scanForFonts(numPages(), &ourList);
+
+	FontInfoScanner fontInfoScanner( m_doc->doc );
+	GooList *items = fontInfoScanner.scan( numPages() );
+
+	if ( NULL == items )
+	    return ourList;
+
+	for ( int i = 0; i < items->getLength(); ++i ) {
+	    ourList.append( FontInfo(FontInfoData((::FontInfo*)items->get(i))) );
+	}
+	deleteGooList(items, ::FontInfo);
+
 	return ourList;
     }
 


More information about the poppler mailing list