Commit 931271f9 authored by Piotr Szymanski's avatar Piotr Szymanski

- generate kpdftextpage while loading document, makes search speedy again, and man do i mean speedy

svn path=/trunk/playground/graphics/oKular/kpdf/; revision=434974
parent 011516bd
......@@ -187,6 +187,7 @@ bool PDFGenerator::loadDocument( const QString & filePath, QValueVector<KPDFPage
// build Pages (currentPage was set -1 by deletePages)
uint pageCount = pdfdoc->getNumPages();
pagesVector.resize( pageCount );
KPDFTextDev td;
for ( uint i = 0; i < pageCount ; i++ )
{
// get xpdf page
......@@ -198,6 +199,13 @@ bool PDFGenerator::loadDocument( const QString & filePath, QValueVector<KPDFPage
if ( true ) //TODO real check
addAnnotations( p, page );
docLock.lock();
pdfdoc->displayPage( &td, page->number()+1, 72, 72, 0, true, false );
TextPage * textPage = td.takeTextPage();
docLock.unlock();
page->setSearchPage(abstractTextPage(textPage,page->height(),page->width()));
// set the kpdfpage at the right position in document's pages vector
pagesVector[i] = page;
}
......
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