Commit 2c57eeb6 authored by Pino Toscano's avatar Pino Toscano

reach only to 0..n-1 queries for fonts, and only in the proper order

svn path=/trunk/KDE/kdegraphics/okular/; revision=753867
parent 1aab311b
......@@ -307,7 +307,7 @@ OKULAR_EXPORT_PLUGIN(PDFGenerator, createAboutData())
PDFGenerator::PDFGenerator( QObject *parent, const QVariantList &args )
: Generator( parent, args ), pdfdoc( 0 ), ready( true ),
pixmapRequest( 0 ), docInfoDirty( true ), docSynopsisDirty( true ),
docEmbeddedFilesDirty( true ), pdfOptionsPage( 0 )
docEmbeddedFilesDirty( true ), nextFontPage( 0 ), pdfOptionsPage( 0 )
{
setFeature( TextExtraction );
setFeature( FontInfo );
......@@ -472,6 +472,7 @@ bool PDFGenerator::doCloseDocument()
docEmbeddedFilesDirty = true;
qDeleteAll(docEmbeddedFiles);
docEmbeddedFiles.clear();
nextFontPage = 0;
return true;
}
......@@ -675,10 +676,13 @@ static Okular::FontInfo::EmbedType embedTypeForPopplerFontInfo( const Poppler::F
return ret;
}
Okular::FontInfo::List PDFGenerator::fontsForPage( int /*page*/ )
Okular::FontInfo::List PDFGenerator::fontsForPage( int page )
{
Okular::FontInfo::List list;
if ( page != nextFontPage )
return list;
QList<Poppler::FontInfo> fonts;
userMutex()->lock();
pdfdoc->scanForFonts( 1, &fonts );
......@@ -695,6 +699,8 @@ Okular::FontInfo::List PDFGenerator::fontsForPage( int /*page*/ )
list.append( of );
}
++nextFontPage;
return list;
}
......
......@@ -132,6 +132,7 @@ class PDFGenerator : public Okular::Generator, public Okular::ConfigInterface, p
Okular::DocumentSynopsis docSyn;
mutable bool docEmbeddedFilesDirty;
mutable QList<Okular::EmbeddedFile*> docEmbeddedFiles;
int nextFontPage;
QVector<bool> rectsGenerated;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment