Commit e75b7654 authored by Pino Toscano's avatar Pino Toscano

convert and set the links only *once* per page

svn path=/trunk/KDE/kdegraphics/okular/; revision=966553
parent 4b5f6aa2
......@@ -94,6 +94,7 @@ bool DviGenerator::doCloseDocument()
m_dviRenderer = 0;
ready = false;
m_linkGenerated.clear();
return true;
}
......@@ -213,7 +214,11 @@ void DviGenerator::generatePixmap( Okular::PixmapRequest *request )
request->page()->setPixmap( request->id(), new QPixmap( QPixmap::fromImage( pageInfo->img ) ) );
request->page()->setObjectRects( generateDviLinks( pageInfo ) );
if ( !m_linkGenerated[ request->pageNumber() ] )
{
request->page()->setObjectRects( generateDviLinks( pageInfo ) );
m_linkGenerated[ request->pageNumber() ] = true;
}
}
}
......@@ -353,6 +358,8 @@ void DviGenerator::loadPages( QVector< Okular::Page * > &pagesVector )
int numofpages = m_dviRenderer->dviFile->total_pages;
pagesVector.resize( numofpages );
m_linkGenerated.fill( false, numofpages );
//kDebug(DviDebug) << "resolution:" << m_resolution << ", dviFile->preferred?";
/* get the suggested size */
......
......@@ -12,6 +12,8 @@
#include <okular/core/generator.h>
#include <qbitarray.h>
class dviRenderer;
class dviPageInfo;
class Anchor;
......@@ -51,6 +53,7 @@ class DviGenerator : public Okular::Generator
bool ready;
dviRenderer *m_dviRenderer;
QBitArray m_linkGenerated;
void loadPages( QVector< Okular::Page * > & pagesVector );
Okular::TextPage *extractTextFromPage( dviPageInfo *pageInfo );
......
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