Commit 3b9f4f3c authored by Wilfried Huss's avatar Wilfried Huss

port of commit 553998:

I should remember to always also test DVI-files that contain no

This is only a temporary fix, because the code that handles paper sizes
needs a rewrite anyway.

svn path=/trunk/KDE/kdegraphics/kviewshell/plugins/dvi/; revision=554000
parent 2677200e
......@@ -160,6 +160,12 @@ RenderedDocumentPagePixmap* dviRenderer::drawPage(const JobId& id)
globalColor = Qt::black;
SimplePageSize ps = sizeOfPage(page->getPageNumber());
if (!ps.isValid())
RenderedDviPagePixmap* DVIpage = static_cast<RenderedDviPagePixmap*>(page);
ps = DVIpage->customPageSize;
int pageHeight = ps.sizeInPixel(resolution).height();
int pageWidth = ps.sizeInPixel(resolution).width();
page->resize(pageWidth, pageHeight);
......@@ -412,8 +412,12 @@ DocumentWidget* KDVIMultiPage::createDocumentWidget(PageView *parent, DocumentPa
RenderedDocumentPagePixmap* KDVIMultiPage::createDocumentPagePixmap(JobId id) const
RenderedDocumentPagePixmap* page = new RenderedDviPagePixmap(id);
RenderedDviPagePixmap* page = new RenderedDviPagePixmap(id);
// Needed for DVI files without a papersize-special
page->customPageSize = dataModel->userPreferredPageSize();
return page;
......@@ -44,6 +44,8 @@ class RenderedDviPagePixmap : public RenderedDocumentPagePixmap
generated when the current page is drawn.
Q3ValueVector<Hyperlink> sourceHyperLinkList;
SimplePageSize customPageSize;
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