[evince/wip/gpoo/fix-warnings: 2/5] backend: Avoid using deprecated functions




commit 021e906471475d3d3ee136ff569fdbb877e74bb5
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Sun Oct 17 10:16:23 2021 -0300

    backend: Avoid using deprecated functions
    
    * poppler_page_get_selection_region has been long deprecated
      in Poppler, and for getting a cairo_region_t,
      poppler_page_get_selected_region is more straightforward to
      use.

 backend/pdf/ev-poppler.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/backend/pdf/ev-poppler.c b/backend/pdf/ev-poppler.c
index a53ff31d..428656d0 100644
--- a/backend/pdf/ev-poppler.c
+++ b/backend/pdf/ev-poppler.c
@@ -2473,7 +2473,6 @@ pdf_document_text_get_text_mapping (EvDocumentText *document_text,
 {
        PopplerPage *poppler_page;
        PopplerRectangle points;
-       GList *region;
        cairo_region_t *retval;
 
        g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL);
@@ -2484,11 +2483,9 @@ pdf_document_text_get_text_mapping (EvDocumentText *document_text,
        points.y1 = 0.0;
        poppler_page_get_size (poppler_page, &(points.x2), &(points.y2));
 
-       region = poppler_page_get_selection_region (poppler_page, 1.0,
-                                                   POPPLER_SELECTION_GLYPH,
-                                                   &points);
-       retval = create_region_from_poppler_region (region, 1.0, 1.0);
-       g_list_free (region);
+       retval = poppler_page_get_selected_region (poppler_page, 1.0,
+                                                  POPPLER_SELECTION_GLYPH,
+                                                  &points);
 
        return retval;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]