Commit 08aeb0b7 authored by Enrico Ros's avatar Enrico Ros

Fixing the bug Albert told me about (generalizes the 'exit fullscreen' bug

that Albert fixed a while ago). Always ensure that pixmaps are requested
if a relayout has been performed, even if the viewport is not moved but
contents changed.
Removed a warning.

svn path=/trunk/kdegraphics/kpdf/; revision=390694
parent fa67d667
......@@ -230,7 +230,7 @@ bool PageView::canFitPageWidth()
return d->zoomMode != ZoomFitWidth;
}
void PageView::fitPageWidth( int page )
void PageView::fitPageWidth( int /*page*/ )
{
d->aZoom->setCurrentItem(0);
slotZoom();
......@@ -1589,9 +1589,6 @@ void PageView::slotRelayoutPages()
fullWidth += colWidth[ i ];
delete [] colWidth;
// this can cause a little overhead
slotRequestVisiblePixmaps();
}
// 3) reset dirty state
......@@ -1611,11 +1608,17 @@ void PageView::slotRelayoutPages()
const DocumentViewport & vp = d->document->viewport();
if ( vp.pageNumber >= 0 )
{
int prevX = contentsX(),
prevY = contentsY();
const QRect & geometry = d->items[ vp.pageNumber ]->geometry();
double nX = vp.reCenter.enabled ? vp.reCenter.normalizedCenterX : 0.5,
nY = vp.reCenter.enabled ? vp.reCenter.normalizedCenterY : 0.0;
nY = vp.reCenter.enabled ? vp.reCenter.normalizedCenterY : 0.0;
center( geometry.left() + ROUND( nX * (double)geometry.width() ),
geometry.top() + ROUND( nY * (double)geometry.height() ) );
// center() usually moves the viewport, that requests pixmaps too.
// if that doesn't happen we have to request them by hand
if ( prevX == contentsX() && prevY == contentsY() )
slotRequestVisiblePixmaps();
}
// or else go to center page
else
......
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