[gnumeric] Code cleanup.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Code cleanup.
- Date: Fri, 13 Apr 2018 23:37:20 +0000 (UTC)
commit 574643c208f17d149f13bfac3b5f8400a6beaf37
Author: Morten Welinder <terra gnome org>
Date: Fri Apr 13 19:36:58 2018 -0400
Code cleanup.
ChangeLog | 3 +++
src/expr.c | 2 +-
src/sheet.c | 6 +++---
src/style-color.c | 13 -------------
src/style-color.h | 4 +---
5 files changed, 8 insertions(+), 20 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 021452d..32b1c57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2018-04-13 Morten Welinder <terra gnome org>
+ * src/style-color.c (gnm_style_color_get_type): Duplicate of
+ gnm_color_get_type, more or less.
+
* src/validation.c (gnm_validation_ref): Must return a value to be
used as a boxed copy function.
diff --git a/src/expr.c b/src/expr.c
index 8017bd5..b40d794 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -2830,7 +2830,7 @@ gnm_expr_top_new_constant (GnmValue *v)
GnmExprTop const *
gnm_expr_top_ref (GnmExprTop const *texpr)
{
- g_return_if_fail (GNM_IS_EXPR_TOP (texpr));
+ g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
((GnmExprTop *)texpr)->refcount++;
return texpr;
}
diff --git a/src/sheet.c b/src/sheet.c
index 8bace9f..26d40b1 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -1049,14 +1049,14 @@ gnm_sheet_class_init (GObjectClass *gobject_class)
g_param_spec_boxed ("tab-foreground",
P_("Tab Foreground"),
P_("The foreground color of the tab."),
- GNM_STYLE_COLOR_TYPE,
+ GNM_COLOR_TYPE,
GSF_PARAM_STATIC |
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_TAB_BACKGROUND,
g_param_spec_boxed ("tab-background",
P_("Tab Background"),
P_("The background color of the tab."),
- GNM_STYLE_COLOR_TYPE,
+ GNM_COLOR_TYPE,
GSF_PARAM_STATIC |
G_PARAM_READWRITE));
@@ -1709,7 +1709,7 @@ sheet_cell_calc_span (GnmCell *cell, GnmSpanCalcFlags flags)
* sheet_apply_style: (skip)
* @sheet: the sheet in which can be found
* @range: the range to which should be applied
- * @mstyle: (transfer full): A #GnmStyle partial style
+ * @style: (transfer full): A #GnmStyle partial style
*
* A mid level routine that applies the supplied partial style @style to the
* target @range and performs the necessary respanning and redrawing.
diff --git a/src/style-color.c b/src/style-color.c
index 1f91088..4851ef7 100644
--- a/src/style-color.c
+++ b/src/style-color.c
@@ -270,16 +270,3 @@ gnm_color_shutdown (void)
g_hash_table_destroy (style_color_hash);
style_color_hash = NULL;
}
-
-GType
-gnm_style_color_get_type (void)
-{
- static GType our_type = 0;
-
- if (our_type == 0)
- our_type = g_boxed_type_register_static
- ("GnmStyleColor",
- (GBoxedCopyFunc)style_color_ref,
- (GBoxedFreeFunc)style_color_unref);
- return our_type;
-}
diff --git a/src/style-color.h b/src/style-color.h
index eca4bf1..0f30cbe 100644
--- a/src/style-color.h
+++ b/src/style-color.h
@@ -9,15 +9,13 @@
G_BEGIN_DECLS
-#define GNM_STYLE_COLOR_TYPE (gnm_style_color_get_type ())
-GType gnm_style_color_get_type (void);
-
struct _GnmColor {
GOColor go_color;
int ref_count;
gboolean is_auto;
};
+#define GNM_COLOR_TYPE (gnm_color_get_type ())
GType gnm_color_get_type (void);
GnmColor *gnm_color_new_go (GOColor c);
GnmColor *gnm_color_new_rgba16(guint16 red, guint16 green, guint16 blue, guint16 alpha);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]