[gnome-builder] style-scheme: allow NULL style scheme
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] style-scheme: allow NULL style scheme
- Date: Wed, 19 Jul 2017 11:21:15 +0000 (UTC)
commit e9938dffd9200ee025ff5693c0956c099b611fa2
Author: Christian Hergert <chergert redhat com>
Date: Sun Jul 16 18:45:36 2017 -0700
style-scheme: allow NULL style scheme
This makes it easy to clear settings.
libide/sourceview/ide-source-style-scheme.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libide/sourceview/ide-source-style-scheme.c b/libide/sourceview/ide-source-style-scheme.c
index c188caf..dcfef6e 100644
--- a/libide/sourceview/ide-source-style-scheme.c
+++ b/libide/sourceview/ide-source-style-scheme.c
@@ -41,7 +41,7 @@ ide_source_style_scheme_apply_style (GtkSourceStyleScheme *style_scheme,
gboolean italic = FALSE;
gboolean italic_set = FALSE;
- g_return_val_if_fail (GTK_SOURCE_IS_STYLE_SCHEME (style_scheme), FALSE);
+ g_return_val_if_fail (!style_scheme || GTK_SOURCE_IS_STYLE_SCHEME (style_scheme), FALSE);
g_return_val_if_fail (style_name != NULL, FALSE);
g_object_set (tag,
@@ -53,6 +53,9 @@ ide_source_style_scheme_apply_style (GtkSourceStyleScheme *style_scheme,
"style-set", FALSE,
NULL);
+ if (style_scheme == NULL)
+ return FALSE;
+
style = gtk_source_style_scheme_get_style (style_scheme, style_name);
if (style == NULL && (colon = strchr (style_name, ':')))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]