Commit 67240883 authored by Albert Astals Cid's avatar Albert Astals Cid

* qt4/src/poppler-page.cc:

  Patch by Pino Toscano <pino@kde.org> to remove a nonsense done by him.

* qt4/tests/test-poppler-qt4.cpp:
  Simply a bit. Patch by Pino Toscano <pino@kde.org>.
parent 9c64b8c7
2007-01-31 Albert Astals Cid <aacid@kde.org>
* qt4/src/poppler-page.cc:
Patch by Pino Toscano <pino@kde.org> to remove a nonsense done by him.
* qt4/tests/test-poppler-qt4.cpp:
Simply a bit. Patch by Pino Toscano <pino@kde.org>.
2007-01-31 Albert Astals Cid <aacid@kde.org>
* m4/qt.m4: Fix Qt4 detection on Mac. Patch by Benjamin Reed
......
......@@ -221,8 +221,6 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
painter.setRenderHint(QPainter::TextAntialiasing);
painter.save();
painter.translate(x == -1 ? 0 : -x, y == -1 ? 0 : -y);
if (w == -1 && h == -1)
painter.scale((double)w/(double)size.width(), (double)h/(double)size.height());
ArthurOutputDev arthur_output(&painter);
arthur_output.startDoc(m_page->parentDoc->m_doc->doc->getXRef());
m_page->parentDoc->m_doc->doc->displayPageSlice(&arthur_output,
......
......@@ -19,14 +19,23 @@ private:
int m_currentPage;
QImage image;
Poppler::Document *doc;
bool useArthur;
QString backendString;
};
PDFDisplay::PDFDisplay( Poppler::Document *d, bool arthur )
{
doc = d;
m_currentPage = 0;
useArthur = arthur;
if (arthur)
{
backendString = "Arthur";
doc->setRenderBackend(Poppler::Document::ArthurBackend);
}
else
{
backendString = "Splash";
doc->setRenderBackend(Poppler::Document::SplashBackend);
}
display();
}
......@@ -35,16 +44,7 @@ void PDFDisplay::display()
if (doc) {
Poppler::Page *page = doc->page(m_currentPage);
if (page) {
if (useArthur)
{
qDebug() << "Displaying page using Arthur backend: " << m_currentPage;
doc->setRenderBackend(Poppler::Document::ArthurBackend);
}
else
{
qDebug() << "Displaying page using Splash backend: " << m_currentPage;
doc->setRenderBackend(Poppler::Document::SplashBackend);
}
qDebug() << "Displaying page using" << backendString << "backend: " << m_currentPage;
image = page->renderToImage();
update();
delete page;
......
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