[gnumeric] GnmStyle: fix boxed type.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GnmStyle: fix boxed type.
- Date: Fri, 13 Apr 2018 16:00:41 +0000 (UTC)
commit 4ed548f7330df384dc4b7d7c8a00a2ea1455b8bb
Author: Morten Welinder <terra gnome org>
Date: Fri Apr 13 12:00:11 2018 -0400
GnmStyle: fix boxed type.
src/mstyle.c | 10 ++++++----
src/mstyle.h | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/mstyle.c b/src/mstyle.c
index 2eb4bbe..3af5df8 100644
--- a/src/mstyle.c
+++ b/src/mstyle.c
@@ -822,16 +822,18 @@ gnm_style_new_merged (GnmStyle const *base, GnmStyle const *overlay)
* gnm_style_ref: (skip)
* @style: #GnmStyle
*
- * Adds a reference to @style.
+ * Returns: (transfer full): A new reference to @style.
*/
-void
+GnmStyle *
gnm_style_ref (GnmStyle const *style)
{
- g_return_if_fail (style != NULL);
- g_return_if_fail (style->ref_count > 0);
+ g_return_val_if_fail (style != NULL, NULL);
+ g_return_val_if_fail (style->ref_count > 0, NULL);
((GnmStyle *)style)->ref_count++;
d(("ref %p = %d\n", style, style->ref_count));
+
+ return ((GnmStyle *)style);
}
/**
diff --git a/src/mstyle.h b/src/mstyle.h
index 874ac1d..9001c3a 100644
--- a/src/mstyle.h
+++ b/src/mstyle.h
@@ -68,7 +68,7 @@ GnmStyle *gnm_style_dup (GnmStyle const *src);
void gnm_style_merge (GnmStyle *base, GnmStyle const *overlay);
void gnm_style_merge_element (GnmStyle *dst, GnmStyle const *src,
GnmStyleElement elem);
-void gnm_style_ref (GnmStyle const *style);
+GnmStyle *gnm_style_ref (GnmStyle const *style);
void gnm_style_unref (GnmStyle const *style);
GnmStyle *gnm_style_link_sheet (GnmStyle *style, Sheet *sheet);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]