From c087ebf90ee6c32656ae925d0c1682b427a21e7e Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Mon, 2 Jul 2007 08:31:23 +0000 Subject: [PATCH] Fix build with poppler 0.5.9. 2007-07-02 Carlos Garcia Campos * configure.ac: * backend/pdf/ev-poppler.cc: (pdf_selection_render_selection): Fix build with poppler 0.5.9. svn path=/branches/gnome-2-18/; revision=2536 --- ChangeLog | 7 +++++++ backend/pdf/ev-poppler.cc | 12 +++++++++++- configure.ac | 6 +++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c7215a6..f945ee48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-07-02 Carlos Garcia Campos + + * configure.ac: + * backend/pdf/ev-poppler.cc: (pdf_selection_render_selection): + + Fix build with poppler 0.5.9. + 2007-07-01 Carlos Garcia Campos * shell/ev-sidebar-links.c: (job_finished_callback): diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 375489f5..7e084dbe 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -1623,13 +1623,23 @@ pdf_selection_render_selection (EvSelection *selection, TRUE, 8, width, height); } - + +#if POPPLER_VERSION == 5 poppler_page_render_selection (POPPLER_PAGE (rc->data), rc->scale, rc->rotation, *pixbuf, (PopplerRectangle *)points, (PopplerRectangle *)old_points, text, base); +#else /* POPPLER_VERSION == 9 */ + poppler_page_render_selection_to_pixbuf (POPPLER_PAGE (rc->data), + rc->scale, rc->rotation, *pixbuf, + (PopplerRectangle *)points, + (PopplerRectangle *)old_points, + POPPLER_SELECTION_NORMAL, + text, + base); +#endif } diff --git a/configure.ac b/configure.ac index 5224e0da..e75a7968 100644 --- a/configure.ac +++ b/configure.ac @@ -200,7 +200,8 @@ AC_ARG_ENABLE(pdf, if test "x$enable_pdf" = "xyes"; then POPPLER_REQUIRED=0.5.4 - PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED,enable_pdf=yes,enable_pdf=no) + POPPLER_MAX_REQUIRED=0.5.9 + PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED poppler-glib <= $POPPLER_MAX_REQUIRED, enable_pdf=yes,enable_pdf=no) if test "x$enable_pdf" = "xyes"; then AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.]) @@ -219,6 +220,9 @@ if test "x$enable_pdf" = "xyes"; then if test x$enable_cairo_pdf == xyes; then AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available]) fi + + POPPLER_VERSION=`$PKG_CONFIG --modversion poppler-glib | sed 's/0\.5\.\([[49]]\)/\1/'` + AC_DEFINE_UNQUOTED(POPPLER_VERSION, $POPPLER_VERSION, [Poppler version.]) else AC_MSG_WARN("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found") fi -- 2.47.1