[gnumeric] GnmColor: retire gnm_color_new_name.



commit 0e25443091fb42a3eea80608666297cf6ebe6ba1
Author: Morten Welinder <terra gnome org>
Date:   Tue Apr 22 15:47:46 2014 -0400

    GnmColor: retire gnm_color_new_name.
    
    All uses were for "blue" which we might as well get from a GOColor.

 ChangeLog                            |    3 +++
 plugins/html/html_read.c             |    6 +++---
 plugins/openoffice/openoffice-read.c |    2 +-
 src/dialogs/dialog-hyperlink.c       |    2 +-
 src/style-color.c                    |    8 --------
 src/style-color.h                    |    1 -
 6 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cdd0407..a471e54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-04-22  Morten Welinder  <terra gnome org>
 
+       * src/style-color.c (gnm_color_new_name): Remove.  All calls
+       replaced with calls to gnm_color_new_go.
+
        * src/sheet-style.c (sheet_style_init_size): Plug leak.
 
        * src/style-color.c (gnm_color_shutdown): Free the auto colours.
diff --git a/plugins/html/html_read.c b/plugins/html/html_read.c
index 8e397a7..b428dca 100644
--- a/plugins/html/html_read.c
+++ b/plugins/html/html_read.c
@@ -245,10 +245,10 @@ html_read_row (htmlNodePtr cur, htmlDocPtr doc, GnmHtmlTableCtxt *tc)
                                                NULL);
                                gnm_hlink_set_target (link, url);
                                gnm_style_set_hlink (mstyle, link);
-                               gnm_style_set_font_uline (
-                                       mstyle, UNDERLINE_SINGLE);
+                               gnm_style_set_font_uline (mstyle,
+                                                         UNDERLINE_SINGLE);
                                gnm_style_set_font_color (mstyle,
-                                       gnm_color_new_name ("blue"));
+                                                         gnm_color_new_go (GO_COLOR_BLUE));
                                g_free (url);
                                xmlBufferFree (h_buf);
                        }
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 34c6143..7d314a6 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -4181,7 +4181,7 @@ oo_cell_content_link (GsfXMLIn *xin, xmlChar const **attrs)
                style = gnm_style_new ();
                gnm_style_set_hlink (style, hlink);
                gnm_style_set_font_uline (style, UNDERLINE_SINGLE);
-               gnm_style_set_font_color (style, gnm_color_new_name ("blue"));
+               gnm_style_set_font_color (style, gnm_color_new_go (GO_COLOR_BLUE));
                sheet_style_apply_pos (state->pos.sheet,
                                       state->pos.eval.col, state->pos.eval.row,
                                       style);
diff --git a/src/dialogs/dialog-hyperlink.c b/src/dialogs/dialog-hyperlink.c
index a88c37e..23d1fc8 100644
--- a/src/dialogs/dialog-hyperlink.c
+++ b/src/dialogs/dialog-hyperlink.c
@@ -393,7 +393,7 @@ dhl_cb_ok (G_GNUC_UNUSED GtkWidget *button, HyperlinkState *state)
                style = gnm_style_new ();
                gnm_style_set_hlink (style, g_object_ref (state->link));
                gnm_style_set_font_uline (style, UNDERLINE_SINGLE);
-               gnm_style_set_font_color (style, gnm_color_new_name ("blue"));
+               gnm_style_set_font_color (style, gnm_color_new_go (GO_COLOR_BLUE));
 
                if (state->is_new) {
                        cmdname = _("Add Hyperlink");
diff --git a/src/style-color.c b/src/style-color.c
index e9919f7..6a65a1e 100644
--- a/src/style-color.c
+++ b/src/style-color.c
@@ -20,14 +20,6 @@ static GnmColor *sc_auto_back;
 static GnmColor *sc_auto_font;
 static GnmColor *sc_auto_pattern;
 
-GnmColor *
-gnm_color_new_name (char const *name)
-{
-       GdkRGBA c;
-       gdk_rgba_parse (&c, name);
-       return gnm_color_new_gdk (&c);
-}
-
 static GnmColor *
 gnm_color_new_uninterned (GOColor c, gboolean is_auto)
 {
diff --git a/src/style-color.h b/src/style-color.h
index 561c714..4d6fbbd 100644
--- a/src/style-color.h
+++ b/src/style-color.h
@@ -20,7 +20,6 @@ struct _GnmColor {
 
 GType     gnm_color_get_type    (void);
 GnmColor *gnm_color_new_go    (GOColor c);
-GnmColor *gnm_color_new_name  (char const *name);
 GnmColor *gnm_color_new_rgba16(guint16 red, guint16 green, guint16 blue, guint16 alpha);
 GnmColor *gnm_color_new_rgb8  (guint8 red, guint8 green, guint8 blue);
 GnmColor *gnm_color_new_rgba8 (guint8 red, guint8 green, guint8 blue, guint8 alpha);


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