1 | --- backend/pdf/ev-poppler.cc 2010-06-24 10:19:28.000000000 +0200 |
---|
2 | +++ backend/pdf/ev-poppler.cc 2011-02-02 10:46:54.000000000 +0100 |
---|
3 | @@ -1974,12 +1974,18 @@ |
---|
4 | EvRectangle *points) |
---|
5 | { |
---|
6 | PopplerPage *poppler_page; |
---|
7 | - PopplerRectangle r; |
---|
8 | - double height; |
---|
9 | char *retval; |
---|
10 | - |
---|
11 | + |
---|
12 | poppler_page = POPPLER_PAGE (rc->page->backend_page); |
---|
13 | |
---|
14 | +#ifdef HAVE_POPPLER_PAGE_GET_SELECTED_TEXT |
---|
15 | + retval = poppler_page_get_selected_text (poppler_page, |
---|
16 | + (PopplerSelectionStyle)style, |
---|
17 | + (PopplerRectangle *)points); |
---|
18 | +#else |
---|
19 | + PopplerRectangle r; |
---|
20 | + double height; |
---|
21 | + |
---|
22 | poppler_page_get_size (poppler_page, NULL, &height); |
---|
23 | r.x1 = points->x1; |
---|
24 | r.y1 = height - points->y2; |
---|
25 | @@ -1989,6 +1995,7 @@ |
---|
26 | retval = poppler_page_get_text (poppler_page, |
---|
27 | (PopplerSelectionStyle)style, |
---|
28 | &r); |
---|
29 | +#endif /* HAVE_POPPLER_PAGE_GET_SELECTED_TEXT */ |
---|
30 | |
---|
31 | return retval; |
---|
32 | } |
---|
33 | --- configure.ac |
---|
34 | +++ configure.ac |
---|
35 | @@ -493,9 +493,10 @@ if test "x$enable_pdf" = "xyes"; then |
---|
36 | evince_save_LIBS=$LIBS |
---|
37 | LIBS="$LIBS $POPPLER_LIBS" |
---|
38 | AC_CHECK_FUNCS(poppler_page_render) |
---|
39 | AC_CHECK_FUNCS(poppler_page_get_image) |
---|
40 | AC_CHECK_FUNCS(poppler_annot_file_attachment_get_attachment) |
---|
41 | + AC_CHECK_FUNCS(poppler_page_get_selected_text) |
---|
42 | LIBS=$evince_save_LIBS |
---|
43 | |
---|
44 | PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no) |
---|
45 | if test x$enable_cairo_pdf = xyes; then |
---|
46 | |
---|