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

2007-03-07 Carlos Garcia Campos <carlosgc@gnome.org>

        reviewed by: Albert Astals Cid <aacid@kde.org>

        * poppler/Page.cc: Consider 0x0 boxes as invalid. Fixes
        http://bugzilla.gnome.org/show_bug.cgi?id=408682

2007-03-06  Pino Toscano <pino@kde.org>
        reviewed by: Albert Astals Cid <aacid@kde.org>

       * configure.ac:
       * qt/Makefile.am:
       * qt/poppler-link.cc:
       * qt/poppler-page.cc:
       * qt/poppler-private.h:
       * qt4/poppler-link.cc:
       Make the Qt4 frontend compilable again with no Splash.
       Make the Qt3 frontend compilable with no Splash.
parent 08dcc712
2007-03-07 Carlos Garcia Campos <carlosgc@gnome.org>
reviewed by: Albert Astals Cid <aacid@kde.org>
* poppler/Page.cc: Consider 0x0 boxes as invalid. Fixes
http://bugzilla.gnome.org/show_bug.cgi?id=408682
2007-03-06 Pino Toscano <pino@kde.org>
reviewed by: Albert Astals Cid <aacid@kde.org>
* configure.ac:
* qt/Makefile.am:
* qt/poppler-link.cc:
* qt/poppler-page.cc:
* qt/poppler-private.h:
* qt4/poppler-link.cc:
Make the Qt4 frontend compilable again with no Splash.
Make the Qt3 frontend compilable with no Splash.
2007-03-06 Julien Rebetez <julien@fhtagn.net>
reviewed by: <aacid@kde.org>
......
......@@ -210,11 +210,7 @@ elif test x$enable_poppler_qt = xtry; then
fi
AC_SUBST(POPPLER_QT_CXXFLAGS)
AC_SUBST(POPPLER_QT_LIBS)
if test x$enable_splash_output != xyes; then
if test x$enable_poppler_qt = xyes; then
enable_poppler_qt="no because of disabled splash"
fi
fi
AM_CONDITIONAL(BUILD_POPPLER_QT, test "x$enable_poppler_qt" = "xyes")
dnl
......@@ -239,12 +235,6 @@ fi
AC_SUBST(POPPLER_QT4_CXXFLAGS)
AC_SUBST(POPPLER_QT4_LIBS)
if test x$enable_splash_output != xyes; then
if test x$enable_poppler_qt4 = xyes; then
enable_poppler_qt4="no because of disabled splash"
fi
fi
AM_CONDITIONAL(BUILD_POPPLER_QT4, test "x$enable_poppler_qt4" = "xyes")
AC_ARG_ENABLE(gtk-test,
......
......@@ -39,6 +39,7 @@
PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
Object obj1;
PDFRectangle mBox;
// get old/default values
if (attrs) {
......@@ -61,7 +62,9 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
}
// media box
readBox(dict, "MediaBox", &mediaBox);
if (readBox(dict, "MediaBox", &mBox)) {
mediaBox = mBox;
}
// crop box
if (readBox(dict, "CropBox", &cropBox)) {
......@@ -170,6 +173,8 @@ GBool PageAttrs::readBox(Dict *dict, char *key, PDFRectangle *box) {
ok = gFalse;
}
obj2.free();
if (tmp.x1 == 0 && tmp.x2 == 0 && tmp.y1 == 0 && tmp.y2 == 0)
ok = gFalse;
if (ok) {
if (tmp.x1 > tmp.x2) {
t = tmp.x1; tmp.x1 = tmp.x2; tmp.x2 = t;
......
......@@ -3,7 +3,6 @@ INCLUDES = \
-I$(top_srcdir)/poppler \
$(cairo_includes) \
$(POPPLER_QT_CXXFLAGS) \
$(SPLASH_CFLAGS) \
$(FREETYPE_CFLAGS) \
$(FONTCONFIG_CFLAGS)
......
......@@ -60,11 +60,13 @@ namespace Poppler {
m_changeTop = ld->getChangeTop();
m_changeZoom = ld->getChangeZoom();
int leftAux, topAux, rightAux, bottomAux;
int leftAux = 0, topAux = 0, rightAux = 0, bottomAux = 0;
#if defined(HAVE_SPLASH)
SplashOutputDev *sod = data.doc->getOutputDev();
sod->cvtUserToDev( left, top, &leftAux, &topAux );
sod->cvtUserToDev( right, bottom, &rightAux, &bottomAux );
#endif
m_left = leftAux;
m_top = topAux;
......
......@@ -20,13 +20,17 @@
#include <poppler-qt.h>
#include <qfile.h>
#include <qimage.h>
#include <config.h>
#include <GlobalParams.h>
#include <PDFDoc.h>
#include <Catalog.h>
#include <ErrorCodes.h>
#include <SplashOutputDev.h>
#include <TextOutputDev.h>
#if defined(HAVE_SPLASH)
#include <SplashOutputDev.h>
#include <splash/SplashBitmap.h>
#endif
#include "poppler-private.h"
#include "poppler-page-transition-private.h"
......@@ -65,6 +69,7 @@ void Page::renderToPixmap(QPixmap **q, int x, int y, int w, int h, double xres,
QImage Page::renderToImage(double xres, double yres, bool doLinks) const
{
#if defined(HAVE_SPLASH)
SplashOutputDev *output_dev;
SplashBitmap *bitmap;
SplashColorPtr color_ptr;
......@@ -101,6 +106,13 @@ QImage Page::renderToImage(double xres, double yres, bool doLinks) const
output_dev->startPage( 0, NULL );
return img;
#else
(void)xres;
(void)xres;
(void)doLinks;
return QImage();
#endif
}
QString Page::getText(const Rectangle &r) const
......@@ -222,6 +234,7 @@ QValueList<Link*> Page::links() const
{
QValueList<Link*> popplerLinks;
#if defined(HAVE_SPLASH)
Links *xpdfLinks = data->doc->data->doc.takeLinks();
for (int i = 0; i < xpdfLinks->getNumLinks(); ++i)
{
......@@ -339,6 +352,7 @@ QValueList<Link*> Page::links() const
}
delete xpdfLinks;
#endif
return popplerLinks;
}
......
......@@ -18,13 +18,18 @@
#include <qdom.h>
#include <config.h>
#include <Object.h>
#include <Outline.h>
#include <SplashOutputDev.h>
#include <Link.h>
#include <PDFDoc.h>
#include <FontInfo.h>
#include <UGooString.h>
#if defined(HAVE_SPLASH)
#include <SplashOutputDev.h>
#else
class SplashOutputDev;
#endif
namespace Poppler {
......@@ -63,12 +68,15 @@ class DocumentData {
~DocumentData()
{
#if defined(HAVE_SPLASH)
delete m_outputDev;
#endif
delete m_fontInfoScanner;
}
SplashOutputDev *getOutputDev()
{
#if defined(HAVE_SPLASH)
if (!m_outputDev)
{
SplashColor white;
......@@ -78,6 +86,7 @@ class DocumentData {
m_outputDev = new SplashOutputDev(splashModeRGB8Qt, 4, gFalse, white);
m_outputDev->startDoc(doc.getXRef());
}
#endif
return m_outputDev;
}
......
......@@ -66,12 +66,14 @@ namespace Poppler {
m_changeTop = ld->getChangeTop();
m_changeZoom = ld->getChangeZoom();
int leftAux, topAux, rightAux, bottomAux;
int leftAux = 0, topAux = 0, rightAux = 0, bottomAux = 0;
OutputDev *sod = data.doc->getOutputDev();
if (sod == NULL) return;
sod->cvtUserToDev( left, top, &leftAux, &topAux );
sod->cvtUserToDev( right, bottom, &rightAux, &bottomAux );
if (sod)
{
sod->cvtUserToDev( left, top, &leftAux, &topAux );
sod->cvtUserToDev( right, bottom, &rightAux, &bottomAux );
}
m_left = leftAux;
m_top = topAux;
......
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