summaryrefslogtreecommitdiffstats
path: root/src/widgets/text-toolbar.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2012-12-21 08:35:32 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx.marker.es>2012-12-21 08:35:32 +0000
commit39309b4a709fad3beed6f02f7ce0289020835efd (patch)
tree0ecc19c6309bfa70f30f075a46d87774040cfb8a /src/widgets/text-toolbar.cpp
parentnot working (diff)
parentfix crasher (diff)
downloadinkscape-39309b4a709fad3beed6f02f7ce0289020835efd.tar.gz
inkscape-39309b4a709fad3beed6f02f7ce0289020835efd.zip
not working, merge from branch
(bzr r11950.1.4)
Diffstat (limited to 'src/widgets/text-toolbar.cpp')
-rw-r--r--src/widgets/text-toolbar.cpp9
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" ) );