summaryrefslogtreecommitdiffstats
path: root/main/epdfview/354-poppler-0.15.patch
blob: 1c7880ac0e6456ea8e2833f6ab71c8c50cf8bb00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Support for poppler >= 0.15.0

Poppler 0.15 has an API change. See:
http://cgit.freedesktop.org/poppler/poppler/commit/?id=b257428150e2c13dcc24fd8f75e4ee2c679ab414
This adds support for the new poppler version to epdfview.
Tested in Fedora Rawhide.

[ Patch sent to Jordi Fita on 2010-10-01 -- michich ]

Index: src/PDFDocument.cxx
===================================================================
--- src/PDFDocument.cxx	(revision 353)
+++ src/PDFDocument.cxx	(working copy)
@@ -681,14 +681,24 @@
     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(),
                                   (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
Index: configure.ac
===================================================================
--- configure.ac	(revision 353)
+++ configure.ac	(working copy)
@@ -41,18 +41,22 @@
 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
 
 AC_MSG_CHECKING([for native Win32])
 case "$host" in