summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2012-04-05 17:45:27 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2012-04-05 17:45:27 +0000
commit009aaef8060460f8ccdaf3d9dc7db0b227f684fa (patch)
tree4e633939b9b540631df28112e0518103a943c53b
parentDocumentation. Tutorials Japanese (by Masato HASHIMOTO) and Russian (by Artem... (diff)
downloadinkscape-009aaef8060460f8ccdaf3d9dc7db0b227f684fa.tar.gz
inkscape-009aaef8060460f8ccdaf3d9dc7db0b227f684fa.zip
add NULL checks to perhaps fix bug 970105
Fixed bugs: - https://launchpad.net/bugs/970105 (bzr r11156)
-rw-r--r--src/interface.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/interface.cpp b/src/interface.cpp
index 493ffa32f..1e1324e32 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -1585,19 +1585,21 @@ sp_ui_overwrite_file(gchar const *filename)
static void
sp_ui_menu_item_set_name(GtkWidget *data, Glib::ustring const &name)
{
- void *child = gtk_bin_get_child (GTK_BIN (data));
- //child is either
- //- a GtkHBox, whose first child is a label displaying name if the menu
- //item has an accel key
- //- a GtkLabel if the menu has no accel key
- if (GTK_IS_LABEL(child)) {
- gtk_label_set_markup_with_mnemonic(GTK_LABEL (child), name.c_str());
- } else if (GTK_IS_HBOX(child)) {
- gtk_label_set_markup_with_mnemonic(
- GTK_LABEL (gtk_container_get_children(GTK_CONTAINER (child))->data),
- name.c_str());
- }//else sp_ui_menu_append_item_from_verb has been modified and can set
- //a menu item in yet another way...
+ if (data || GTK_IS_BIN (data)) {
+ void *child = gtk_bin_get_child (GTK_BIN (data));
+ //child is either
+ //- a GtkHBox, whose first child is a label displaying name if the menu
+ //item has an accel key
+ //- a GtkLabel if the menu has no accel key
+ if (GTK_IS_LABEL(child)) {
+ gtk_label_set_markup_with_mnemonic(GTK_LABEL (child), name.c_str());
+ } else if (GTK_IS_HBOX(child)) {
+ gtk_label_set_markup_with_mnemonic(
+ GTK_LABEL (gtk_container_get_children(GTK_CONTAINER (child))->data),
+ name.c_str());
+ }//else sp_ui_menu_append_item_from_verb has been modified and can set
+ //a menu item in yet another way...
+ }
}
void injectRenamedIcons()