diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2013-02-04 09:47:19 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2013-02-04 09:47:19 +0000 |
| commit | 2c7d2b2cd8f2571cc65d2ba7ac628bb8b43e5c7a (patch) | |
| tree | 58877ef51b0b7f313790b2f27d399d8db630c011 /src/widgets | |
| parent | Fix for 1002757 : Regressions with new default font 'sans-serif' - fix map (diff) | |
| download | inkscape-2c7d2b2cd8f2571cc65d2ba7ac628bb8b43e5c7a.tar.gz inkscape-2c7d2b2cd8f2571cc65d2ba7ac628bb8b43e5c7a.zip | |
Better fix for 1114243, crash on launch with default prefs from stable
(bzr r12097)
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/text-toolbar.cpp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 060bb4a80..dc4a6be27 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -211,32 +211,31 @@ static void sp_text_fontstyle_populate(GObject *tbl, font_instance *font=NULL) GtkListStore *store = GTK_LIST_STORE( ink_comboboxentry_action_get_model( fontStyleAction ) ); gtk_list_store_clear ( store ); - // Get the list of styles from the selected font + // Get the list of styles from the selected font. GList *list = NULL; if (found) { - // Add list of styles to the style combo + // Use precompiled list if font-family on system. gtk_tree_model_get (model, &iter, 1, &list, -1); - for (GList *l=list; l; l = l->next) - { - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, (char*)l->data, -1); - } } else { - // Create generic list if selected font-family not available on system - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, "Normal", -1); - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, "Italic", -1); - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, "Bold", -1); - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, "Bold Italic", -1); + // Use generic list if font-family not on system. + static GList *glist = NULL; + if( glist == NULL ) { + glist = g_list_append (glist, (void*)"Normal"); + glist = g_list_append (glist, (void*)"Italic"); + glist = g_list_append (glist, (void*)"Bold"); + glist = g_list_append (glist, (void*)"Bold Italic"); + } + list = glist; + } - /// \todo \c list should be initialized here with "Normal", "Italic", etc too + for (GList *l=list; l; l = l->next) + { + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, 0, (char*)l->data, -1); } // Select the style in the combo that best matches font |
