[evince] pdf: Use poppler_annot_markup_set_popup_rectangle() if available
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] pdf: Use poppler_annot_markup_set_popup_rectangle() if available
- Date: Sat, 18 Apr 2015 10:38:11 +0000 (UTC)
commit 49912625255ed3022eef7068650924b6f8b9efc4
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sat Apr 18 12:35:31 2015 +0200
pdf: Use poppler_annot_markup_set_popup_rectangle() if available
This way we don't create a new popup annotation every time we save the
window position.
backend/pdf/ev-poppler.cc | 9 ++++++++-
configure.ac | 5 +++++
2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index 20bcd94..3bd2a4b 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -3358,7 +3358,14 @@ pdf_document_annotations_save_annotation (EvDocumentAnnotations *document_annota
poppler_rect.y1 = height - ev_rect.y2;
poppler_rect.y2 = height - ev_rect.y1;
- poppler_annot_markup_set_popup (markup, &poppler_rect);
+ if (poppler_annot_markup_has_popup (markup))
+#ifdef HAVE_POPPLER_ANNOT_MARKUP_SET_POPUP_RECTANGLE
+ poppler_annot_markup_set_popup_rectangle (markup, &poppler_rect);
+#else
+ poppler_annot_markup_set_popup (markup, &poppler_rect);
+#endif
+ else
+ poppler_annot_markup_set_popup (markup, &poppler_rect);
}
if (mask & EV_ANNOTATIONS_SAVE_POPUP_IS_OPEN)
poppler_annot_markup_set_popup_is_open (markup,
ev_annotation_markup_get_popup_is_open (ev_markup));
diff --git a/configure.ac b/configure.ac
index 2ead774..2e6c338 100644
--- a/configure.ac
+++ b/configure.ac
@@ -507,6 +507,11 @@ if test "x$enable_pdf" = "xyes"; then
if test x$enable_cairo_ps = xyes; then
AC_DEFINE([HAVE_CAIRO_PS], [1], [defined if cairo-ps is available])
fi
+
+ evince_save_LIBS=$LIBS
+ LIBS="$LIBS $POPPLER_LIBS"
+ AC_CHECK_FUNCS(poppler_annot_markup_set_popup_rectangle)
+ LIBS=$evince_save_LIBS
else
AC_MSG_ERROR("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or
newer not found")
fi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]