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()) ...@@ -307,7 +307,7 @@ OKULAR_EXPORT_PLUGIN(PDFGenerator, createAboutData())
PDFGenerator::PDFGenerator( QObject *parent, const QVariantList &args ) PDFGenerator::PDFGenerator( QObject *parent, const QVariantList &args )
: Generator( parent, args ), pdfdoc( 0 ), ready( true ), : Generator( parent, args ), pdfdoc( 0 ), ready( true ),
pixmapRequest( 0 ), docInfoDirty( true ), docSynopsisDirty( true ), pixmapRequest( 0 ), docInfoDirty( true ), docSynopsisDirty( true ),
docEmbeddedFilesDirty( true ), pdfOptionsPage( 0 ) docEmbeddedFilesDirty( true ), nextFontPage( 0 ), pdfOptionsPage( 0 )
{ {
setFeature( TextExtraction ); setFeature( TextExtraction );
setFeature( FontInfo ); setFeature( FontInfo );
...@@ -472,6 +472,7 @@ bool PDFGenerator::doCloseDocument() ...@@ -472,6 +472,7 @@ bool PDFGenerator::doCloseDocument()
docEmbeddedFilesDirty = true; docEmbeddedFilesDirty = true;
qDeleteAll(docEmbeddedFiles); qDeleteAll(docEmbeddedFiles);
docEmbeddedFiles.clear(); docEmbeddedFiles.clear();
nextFontPage = 0;
return true; return true;
} }
...@@ -675,10 +676,13 @@ static Okular::FontInfo::EmbedType embedTypeForPopplerFontInfo( const Poppler::F ...@@ -675,10 +676,13 @@ static Okular::FontInfo::EmbedType embedTypeForPopplerFontInfo( const Poppler::F
return ret; return ret;
} }
Okular::FontInfo::List PDFGenerator::fontsForPage( int /*page*/ ) Okular::FontInfo::List PDFGenerator::fontsForPage( int page )
{ {
Okular::FontInfo::List list; Okular::FontInfo::List list;
if ( page != nextFontPage )
return list;
QList<Poppler::FontInfo> fonts; QList<Poppler::FontInfo> fonts;
userMutex()->lock(); userMutex()->lock();
pdfdoc->scanForFonts( 1, &fonts ); pdfdoc->scanForFonts( 1, &fonts );
...@@ -695,6 +699,8 @@ Okular::FontInfo::List PDFGenerator::fontsForPage( int /*page*/ ) ...@@ -695,6 +699,8 @@ Okular::FontInfo::List PDFGenerator::fontsForPage( int /*page*/ )
list.append( of ); list.append( of );
} }
++nextFontPage;
return list; return list;
} }
......
...@@ -132,6 +132,7 @@ class PDFGenerator : public Okular::Generator, public Okular::ConfigInterface, p ...@@ -132,6 +132,7 @@ class PDFGenerator : public Okular::Generator, public Okular::ConfigInterface, p
Okular::DocumentSynopsis docSyn; Okular::DocumentSynopsis docSyn;
mutable bool docEmbeddedFilesDirty; mutable bool docEmbeddedFilesDirty;
mutable QList<Okular::EmbeddedFile*> docEmbeddedFiles; mutable QList<Okular::EmbeddedFile*> docEmbeddedFiles;
int nextFontPage;
QVector<bool> rectsGenerated; 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