[evince] document: Replace deprecated function instead of ignoring it



commit 1944b86ec7b4a63dadd0ffd89cd9297871bae264
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Sun Nov 11 10:54:30 2018 -0300

    document: Replace deprecated function instead of ignoring it
    
    gdk_color_equal is simple enough to replace it with code inline
    and make the function work even if it were removed later.

 libdocument/ev-annotation.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libdocument/ev-annotation.c b/libdocument/ev-annotation.c
index 4dc70f91..0feb845c 100644
--- a/libdocument/ev-annotation.c
+++ b/libdocument/ev-annotation.c
@@ -611,7 +611,6 @@ ev_annotation_get_color (EvAnnotation *annot,
  *
  * Deprecated: 3.6: Use ev_annotation_set_rgba() instead.
  */
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 gboolean
 ev_annotation_set_color (EvAnnotation   *annot,
                         const GdkColor *color)
@@ -622,8 +621,11 @@ ev_annotation_set_color (EvAnnotation   *annot,
        g_return_val_if_fail (EV_IS_ANNOTATION (annot), FALSE);
 
         ev_annotation_get_color (annot, &annot_color);
-        if (color == NULL || gdk_color_equal (color, &annot_color))
-                return FALSE;
+       if (color == NULL ||
+           ((color->red == annot_color.red) &&
+           (color->green == annot_color.green) &&
+           (color->blue == annot_color.blue)))
+               return FALSE;
 
         rgba.red = color->red / 65535.;
         rgba.green = color->green / 65535.;
@@ -634,7 +636,6 @@ ev_annotation_set_color (EvAnnotation   *annot,
 
        return TRUE;
 }
-G_GNUC_END_IGNORE_DEPRECATIONS
 
 /**
  * ev_annotation_get_rgba:


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