From 9ea54d72980715fd36927b4d7e7f432091787088 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 31 May 2008 11:23:02 +0000 Subject: [PATCH] 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 --- core/generator.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/generator.cpp b/core/generator.cpp index 5e59e2dd4..2415c64bf 100644 --- a/core/generator.cpp +++ b/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