[evince/wip/gpoo/fix-1414] Revert "pdf: support 'de facto' tooltip feature"



commit 4ab6c291c612b3a06aad025f7445491280e8eb75
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Tue Jun 9 10:46:29 2020 -0400

    Revert "pdf: support 'de facto' tooltip feature"
    
    It introduced a regression by breaking the ABI.
    
    Fixes #1414
    
    This reverts commit e2ad8611a4c58f09d78def78500a2c10a21ac48b.

 backend/pdf/ev-poppler.cc   |  5 -----
 libdocument/ev-form-field.c |  2 --
 libdocument/ev-form-field.h |  1 -
 libview/ev-view.c           | 34 +---------------------------------
 4 files changed, 1 insertion(+), 41 deletions(-)
---
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index f5ab3e5e..a6383a15 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -2665,15 +2665,11 @@ ev_form_field_from_poppler_field (PdfDocument      *pdf_document,
        gdouble      font_size;
        gboolean     is_read_only;
        PopplerAction *action;
-       gchar       *alt_ui_name = NULL;
 
        id = poppler_form_field_get_id (poppler_field);
        font_size = poppler_form_field_get_font_size (poppler_field);
        is_read_only = poppler_form_field_is_read_only (poppler_field);
        action = poppler_form_field_get_action (poppler_field);
-#if POPPLER_CHECK_VERSION(0, 88, 0)
-       alt_ui_name = poppler_form_field_get_alternate_ui_name (poppler_field);
-#endif
 
        switch (poppler_form_field_get_field_type (poppler_field)) {
                case POPPLER_FORM_FIELD_TEXT: {
@@ -2763,7 +2759,6 @@ ev_form_field_from_poppler_field (PdfDocument      *pdf_document,
 
        ev_field->font_size = font_size;
        ev_field->is_read_only = is_read_only;
-       ev_field->alt_ui_name = alt_ui_name;
 
        if (action)
                ev_field->activation_link = ev_link_from_action (pdf_document, action);
diff --git a/libdocument/ev-form-field.c b/libdocument/ev-form-field.c
index 7e0169ad..c234e967 100644
--- a/libdocument/ev-form-field.c
+++ b/libdocument/ev-form-field.c
@@ -45,7 +45,6 @@ ev_form_field_init (EvFormField *field)
        field->page = NULL;
        field->changed = FALSE;
        field->is_read_only = FALSE;
-       field->alt_ui_name = NULL;
 }
 
 static void
@@ -57,7 +56,6 @@ ev_form_field_finalize (GObject *object)
        field->page = NULL;
 
        g_clear_object (&field->activation_link);
-       g_clear_pointer (&field->alt_ui_name, g_free);
 
        (* G_OBJECT_CLASS (ev_form_field_parent_class)->finalize) (object);
 }
diff --git a/libdocument/ev-form-field.h b/libdocument/ev-form-field.h
index 84344504..d0571a2a 100644
--- a/libdocument/ev-form-field.h
+++ b/libdocument/ev-form-field.h
@@ -113,7 +113,6 @@ struct _EvFormField
 
        EvPage  *page;
        gboolean changed;
-       gchar   *alt_ui_name;
 };
 
 struct _EvFormFieldClass
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 33a7af2a..032414e3 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -2205,7 +2205,7 @@ ev_view_handle_cursor_over_xy (EvView *view, gint x, gint y)
                        ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
        }
 
-       if (link || annot || (field && field->alt_ui_name))
+       if (link || annot)
                g_object_set (view, "has-tooltip", TRUE, NULL);
 }
 
@@ -4961,26 +4961,6 @@ get_annot_area (EvView       *view,
                                       annot, area);
 }
 
-static void
-get_field_area (EvView       *view,
-               gint          x,
-               gint          y,
-               EvFormField  *field,
-               GdkRectangle *area)
-{
-       EvMappingList *field_mapping;
-       gint           page;
-       gint           x_offset = 0, y_offset = 0;
-
-       x += view->scroll_x;
-       y += view->scroll_y;
-
-       find_page_at_location (view, x, y, &page, &x_offset, &y_offset);
-
-       field_mapping = ev_page_cache_get_form_field_mapping (view->page_cache, page);
-       ev_view_get_area_from_mapping (view, page, field_mapping, field, area);
-}
-
 static gboolean
 ev_view_query_tooltip (GtkWidget  *widget,
                       gint        x,
@@ -4989,7 +4969,6 @@ ev_view_query_tooltip (GtkWidget  *widget,
                       GtkTooltip *tooltip)
 {
        EvView       *view = EV_VIEW (widget);
-       EvFormField  *field;
        EvLink       *link;
        EvAnnotation *annot;
        gchar        *text;
@@ -5010,17 +4989,6 @@ ev_view_query_tooltip (GtkWidget  *widget,
                }
        }
 
-       field = ev_view_get_form_field_at_location (view, x, y);
-       if (field && field->alt_ui_name && *(field->alt_ui_name) != '\0') {
-               GdkRectangle field_area;
-
-               get_field_area (view, x, y, field, &field_area);
-               gtk_tooltip_set_text (tooltip, field->alt_ui_name);
-               gtk_tooltip_set_tip_area (tooltip, &field_area);
-
-               return TRUE;
-       }
-
        link = ev_view_get_link_at_location (view, x, y);
        if (!link)
                return FALSE;


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