diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2012-12-20 20:16:38 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2012-12-20 20:16:38 +0000 |
| commit | 73f62e9242a0f0fce2bb3c3ca2c70d4d01f56c35 (patch) | |
| tree | 4eee4d12bb93bc35f334e5bb27af37b742404628 /src | |
| parent | Fix regression with event attribute names (see bug #1050938) (diff) | |
| download | inkscape-73f62e9242a0f0fce2bb3c3ca2c70d4d01f56c35.tar.gz inkscape-73f62e9242a0f0fce2bb3c3ca2c70d4d01f56c35.zip | |
fix crasher
Fixed bugs:
- https://launchpad.net/bugs/1092663
(bzr r11964)
Diffstat (limited to 'src')
| -rw-r--r-- | src/widgets/text-toolbar.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 9e0977d51..6c22c81e3 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -174,6 +174,9 @@ static void sp_text_fontstyle_populate(GObject *tbl, font_instance *font=NULL) Ink_ComboBoxEntry_Action* act = INK_COMBOBOXENTRY_ACTION( g_object_get_data( tbl, "TextFontFamilyAction" ) ); GtkTreeModel *model = ink_comboboxentry_action_get_model( act ); gchar *current_font = ink_comboboxentry_action_get_active_text( act ); + if (!current_font) { + return; + } // Get an iter to the selected font from the model data // We cant get it from the combo, cause it might not have been created yet @@ -183,11 +186,11 @@ static void sp_text_fontstyle_populate(GObject *tbl, font_instance *font=NULL) while ( valid ) { // Get text from list entry - gchar* text = 0; + gchar* text = NULL; gtk_tree_model_get( model, &iter, 0, &text, -1 ); // Column 0 // Check for match - if( strcmp( current_font, text ) == 0 ){ + if ( text && (strcmp( current_font, text ) == 0) ) { found = true; break; } @@ -199,7 +202,7 @@ static void sp_text_fontstyle_populate(GObject *tbl, font_instance *font=NULL) } // Get the list of styles from the selected font - GList *list=0; + GList *list = NULL; gtk_tree_model_get (model, &iter, 1, &list, -1); Ink_ComboBoxEntry_Action* fontStyleAction = INK_COMBOBOXENTRY_ACTION( g_object_get_data( tbl, "TextFontStyleAction" ) ); |
