aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarish Krishnaswamy <kharish@novell.com>2006-07-22 21:04:55 +0800
committerHarish Krishnaswamy <kharish@src.gnome.org>2006-07-22 21:04:55 +0800
commit2df26bc7b73e93b6de4b6a6ab0c9a52cafb9bd83 (patch)
tree7dbb7958ab2ede0e4ca17c90abc537f645cdac01
parentad7a244247a9b4437fe72e33a588685206815339 (diff)
downloadgsoc2013-evolution-2df26bc7b73e93b6de4b6a6ab0c9a52cafb9bd83.tar.gz
gsoc2013-evolution-2df26bc7b73e93b6de4b6a6ab0c9a52cafb9bd83.tar.zst
gsoc2013-evolution-2df26bc7b73e93b6de4b6a6ab0c9a52cafb9bd83.zip
Handle cases when the props are undefined. This bug is currently causing
2006-07-22 Harish Krishnaswamy <kharish@novell.com> * e-util.c: (get_font_options): Handle cases when the props are undefined. This bug is currently causing Evo to crash as soon as it comes up. svn path=/trunk/; revision=32389
-rw-r--r--e-util/ChangeLog6
-rw-r--r--e-util/e-util.c65
2 files changed, 43 insertions, 28 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 863ca97098..ad8aaee230 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-22 Harish Krishnaswamy <kharish@novell.com>
+
+ * e-util.c: (get_font_options): Handle cases when the
+ props are undefined. This bug is currently causing Evo
+ to crash as soon as it comes up.
+
2006-07-20 Rajeev ramanathan <rajeevramanathan_2004@yahoo.co.in>
* e-util.[ch]: (get_font_options): Added code to get font options.
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 7216f0e8cc..b2c111589d 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -1136,41 +1136,50 @@ get_font_options ()
/* Antialiasing */
antialiasing = gconf_client_get_string (gconf,
"/desktop/gnome/font_rendering/antialiasing", NULL);
- if (strcmp (antialiasing, "grayscale") == 0)
- cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
- else if (strcmp (antialiasing, "rgba") == 0)
- cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_SUBPIXEL);
- else if (strcmp (antialiasing, "none") == 0)
- cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_NONE);
- else
+ if (antialiasing == NULL)
cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_DEFAULT);
-
+ else {
+ if (strcmp (antialiasing, "grayscale") == 0)
+ cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
+ else if (strcmp (antialiasing, "rgba") == 0)
+ cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_SUBPIXEL);
+ else if (strcmp (antialiasing, "none") == 0)
+ cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_NONE);
+ else
+ cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_DEFAULT);
+ }
hinting = gconf_client_get_string (gconf,
"/desktop/gnome/font_rendering/hinting", NULL);
- if (strcmp (hinting, "full") == 0)
- cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_FULL);
- else if (strcmp (hinting, "medium") == 0)
- cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_MEDIUM);
- else if (strcmp (hinting, "slight") == 0)
- cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_SLIGHT);
- else if (strcmp (hinting, "none") == 0)
- cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
- else
+ if (hinting == NULL)
cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_DEFAULT);
-
+ else {
+ if (strcmp (hinting, "full") == 0)
+ cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_FULL);
+ else if (strcmp (hinting, "medium") == 0)
+ cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_MEDIUM);
+ else if (strcmp (hinting, "slight") == 0)
+ cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_SLIGHT);
+ else if (strcmp (hinting, "none") == 0)
+ cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
+ else
+ cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_DEFAULT);
+ }
subpixel_order = gconf_client_get_string (gconf,
"/desktop/gnome/font_rendering/rgba_order", NULL);
- if (strcmp (subpixel_order, "rgb") == 0)
- cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_RGB);
- else if (strcmp (subpixel_order, "bgr") == 0)
- cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_BGR);
- else if (strcmp (subpixel_order, "vrgb") == 0)
- cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_VRGB);
- else if (strcmp (subpixel_order, "vbgr") == 0)
- cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_VBGR);
- else
+ if (subpixel_order == NULL)
cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT);
-
+ else {
+ if (strcmp (subpixel_order, "rgb") == 0)
+ cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_RGB);
+ else if (strcmp (subpixel_order, "bgr") == 0)
+ cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_BGR);
+ else if (strcmp (subpixel_order, "vrgb") == 0)
+ cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_VRGB);
+ else if (strcmp (subpixel_order, "vbgr") == 0)
+ cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_VBGR);
+ else
+ cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT);
+ }
g_object_unref (gconf);
return font_options;
}