[gnumeric] Work around non-exisiting GTL_STATE_FLAG_LINK for old GTK.



commit 5dc9fce183d0e0cef21df251fd2eab4735ac2706
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Tue Oct 23 15:17:31 2018 -0600

    Work around non-exisiting GTL_STATE_FLAG_LINK for old GTK.

 ChangeLog      | 5 +++++
 src/gui-util.c | 9 +++++++++
 2 files changed, 14 insertions(+)
---
diff --git a/ChangeLog b/ChangeLog
index 5c3e473e5..103274276 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-10-23  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * src/gui-util.c (gnm_get_link_color): make conditional on definition
+       of GTK_STATE_FLAG_LINK
+
 2018-10-13  Morten Welinder  <terra gnome org>
 
        * src/dependent.c (workbook_recalc): Evaluate cells before other
diff --git a/src/gui-util.c b/src/gui-util.c
index 4e7c4a4c5..06f8372d8 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -1377,11 +1377,20 @@ gnm_style_context_get_color (GtkStyleContext *context,
        gtk_style_context_restore (context);
 }
 
+#ifdef GTK_STATE_FLAG_LINK
 void
 gnm_get_link_color (GtkWidget *widget, GdkRGBA *res)
 {
        GtkStyleContext *ctxt = gtk_widget_get_style_context (widget);
        gnm_style_context_get_color (ctxt, GTK_STATE_FLAG_LINK, res);
 }
+#else
+void
+gnm_get_link_color (G_GNUC_UNUSED GtkWidget *widget, GdkRGBA *res)
+{
+  gdk_rgba_parse (res, "blue");
+#warning GTK_STATE_FLAG_LINK is undefined, using color blue
+}
+#endif /* GTK_STATE_FLAG_LINK */
 
 // ----------------------------------------------------------------------------


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