diff options
author | Niels Horn <niels.horn@slackbuilds.org> | 2011-03-31 11:32:20 -0300 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2011-03-31 23:51:26 -0500 |
commit | 81ae0d778befd6b6412c5096ac46952dce7865f4 (patch) | |
tree | 7062f3c7f546acdce95206b0bba5bc61098d1d17 /office/epdfview/poppler-0150.patch | |
parent | 349c7f5f387fe31da04188f02fa9b54ac45e9f4f (diff) | |
download | slackbuilds-81ae0d778befd6b6412c5096ac46952dce7865f4.tar.gz |
office/epdfview: Patched for new poppler.
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'office/epdfview/poppler-0150.patch')
-rw-r--r-- | office/epdfview/poppler-0150.patch | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/office/epdfview/poppler-0150.patch b/office/epdfview/poppler-0150.patch new file mode 100644 index 0000000000..771b93a011 --- /dev/null +++ b/office/epdfview/poppler-0150.patch @@ -0,0 +1,77 @@ +From d8d3dac5fc3fe519b443d22f74258af4aaf48d0c Mon Sep 17 00:00:00 2001 +From: jordi <jordi@cb4bfb15-1111-0410-82e2-95233c8f1c7e> +Date: Mon, 11 Oct 2010 15:53:47 +0000 +Subject: [PATCH 2/3] Added support for poppler's API changes in 0.15.0 by Michal Schmidt. + +git-svn-id: svn://svn.emma-soft.com/epdfview@354 cb4bfb15-1111-0410-82e2-95233c8f1c7e +--- + trunk/configure.ac | 16 ++++++++++------ + trunk/src/PDFDocument.cxx | 12 +++++++++++- + 2 files changed, 21 insertions(+), 7 deletions(-) + +diff --git a/trunk/configure.ac b/trunk/configure.ac +index 7ce0ddc..6cbd0e2 100644 +--- a/trunk/configure.ac ++++ b/trunk/configure.ac +@@ -40,18 +40,22 @@ PKG_CHECK_MODULES([POPPLER], [poppler-glib >= $POPPLER_REQUIRED gdk-2.0 >= $GTK2 + AC_SUBST([POPPLER_CFLAGS]) + AC_SUBST([POPPLER_LIBS]) + dnl Check if we have poppler version 0.5.2 or higher. +-PKG_CHECK_EXISTS([poppler-glib >= 0.5.2], [have_poppler_052=yes]) +-if test "x$have_poppler_052" = "xyes"; then ++PKG_CHECK_EXISTS([poppler-glib >= 0.5.2], [have_poppler_0_5_2=yes]) ++if test "x$have_poppler_0_5_2" = "xyes"; then + AC_DEFINE([HAVE_POPPLER_0_5_2], [1], [Define to 1 if you have Poppler version 0.5.2 or higher.]) + fi +-PKG_CHECK_EXISTS([poppler-glib >= 0.6], [have_poppler_060=yes]) +-if test "x$have_poppler_060" = "xyes"; then ++PKG_CHECK_EXISTS([poppler-glib >= 0.6], [have_poppler_0_6_0=yes]) ++if test "x$have_poppler_0_6_0" = "xyes"; then + AC_DEFINE([HAVE_POPPLER_0_6_0], [1], [Define to 1 if you have Poppler version 0.6.0 or higher.]) + fi +-PKG_CHECK_EXISTS([poppler-glib >= 0.8], [have_poppler_080=yes]) +-if test "x$have_poppler_080" = "xyes"; then ++PKG_CHECK_EXISTS([poppler-glib >= 0.8], [have_poppler_0_8_0=yes]) ++if test "x$have_poppler_0_8_0" = "xyes"; then + AC_DEFINE([HAVE_POPPLER_0_8_0], [1], [Define to 1 if you have Poppler version 0.8.0 or higher.]) + fi ++PKG_CHECK_EXISTS([poppler-glib >= 0.15], [have_poppler_0_15_0=yes]) ++if test "x$have_poppler_0_15_0" = "xyes"; then ++ AC_DEFINE([HAVE_POPPLER_0_15_0], [1], [Define to 1 if you have Poppler version 0.15.0 or higher.]) ++fi + + EPDFVIEW_PATH_CUPS([CUPS], [have_cups=yes]) + AM_CONDITIONAL(cups_printing, test "x$have_cups" = "xyes") +diff --git a/trunk/src/PDFDocument.cxx b/trunk/src/PDFDocument.cxx +index 6567e9b..a590a20 100644 +--- a/trunk/src/PDFDocument.cxx ++++ b/trunk/src/PDFDocument.cxx +@@ -678,14 +678,24 @@ PDFDocument::setTextSelection (DocumentRectangle *rect) + gdouble pageWidth, pageHeight; + poppler_page_get_size(page, &pageWidth, &pageHeight); + ++#if defined (HAVE_POPPLER_0_15_0) ++ PopplerRectangle textRect = { rect->getX1() / getZoom(), ++ rect->getY1() / getZoom(), ++ rect->getX2() / getZoom(), ++ rect->getY2() / getZoom()}; ++#else // !HAVE_POPPLER_0_15_0 + //for get text we must exchange y coordinate, don't ask me where logic here. + PopplerRectangle textRect = { rect->getX1() / getZoom(), + (pageHeight - rect->getY2() / getZoom()), + rect->getX2() * getZoom() / getZoom(), + (pageHeight - rect->getY1() / getZoom())}; ++#endif // HAVE_POPPLER_0_15_0 + repairEmpty(textRect); + +-#if defined (HAVE_POPPLER_0_6_0) ++#if defined (HAVE_POPPLER_0_15_0) ++ gchar *text = poppler_page_get_selected_text(page, POPPLER_SELECTION_GLYPH, ++ &textRect); ++#elif defined (HAVE_POPPLER_0_6_0) + gchar *text = poppler_page_get_text(page, POPPLER_SELECTION_GLYPH, + &textRect); + #else // !HAVE_POPPLER_0_6_0 +-- +1.7.4 + |