update the bounding box of page after the pixmap of the page has been delivered to the observer that requested it,

otherwise the observer gets the change in the bounding box, and request the pixmap if not available, but there's an available pending request (finished) already

svn path=/trunk/KDE/kdegraphics/okular/; revision=814826
remotes/origin/KDE/4.1
Pino Toscano 18 years ago
parent c84e2dc144
commit 9ea54d7298
  1. 11
      core/generator.cpp

@ -98,11 +98,12 @@ void GeneratorPrivate::pixmapGenerationFinished()
}
const QImage& img = mPixmapGenerationThread->image();
if ( mPixmapGenerationThread->calcBoundingBox() )
q->updatePageBoundingBox( request->page()->number(), mPixmapGenerationThread->boundingBox() );
request->page()->setPixmap( request->id(), new QPixmap( QPixmap::fromImage( img ) ) );
const int pageNumber = request->page()->number();
q->signalPixmapRequestDone( request );
if ( mPixmapGenerationThread->calcBoundingBox() )
q->updatePageBoundingBox( pageNumber, mPixmapGenerationThread->boundingBox() );
}
void GeneratorPrivate::textpageGenerationFinished()
@ -233,13 +234,15 @@ void Generator::generatePixmap( PixmapRequest *request )
}
const QImage& img = image( request );
if ( !request->page()->isBoundingBoxKnown() )
updatePageBoundingBox( request->page()->number(), Utils::imageBoundingBox( &img ) );
request->page()->setPixmap( request->id(), new QPixmap( QPixmap::fromImage( img ) ) );
const bool bboxKnown = request->page()->isBoundingBoxKnown();
const int pageNumber = request->page()->number();
d->mPixmapReady = true;
signalPixmapRequestDone( request );
if ( !bboxKnown )
updatePageBoundingBox( pageNumber, Utils::imageBoundingBox( &img ) );
}
bool Generator::canGenerateTextPage() const

Loading…
Cancel
Save