Code

codedread's patch for bug 254850 (fixes handling of description field in Object Prope...
authorsasilver <sasilver@users.sourceforge.net>
Tue, 5 Aug 2008 19:23:02 +0000 (19:23 +0000)
committersasilver <sasilver@users.sourceforge.net>
Tue, 5 Aug 2008 19:23:02 +0000 (19:23 +0000)
src/dialogs/item-properties.cpp

index 5ffac12e47cdc5d2d1069c19bf2827dbdc78c8c8..9b816436b331c3ddf54951dce79e4cc875f52e53 100644 (file)
@@ -341,12 +341,14 @@ sp_item_widget_setup ( SPWidget *spw, Inkscape::Selection *selection )
         gtk_widget_set_sensitive(w, TRUE);
 
         /* Description */
+        w = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(spw), "desc"));
+        GtkTextBuffer *buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(w));
         gchar *desc = obj->desc();
         if (desc) {
-            w = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(spw), "desc"));
-            GtkTextBuffer *buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(w));
             gtk_text_buffer_set_text(buf, desc, -1);
             g_free(desc);
+        } else {
+            gtk_text_buffer_set_text(buf, "", 0);
         }
         w = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(spw), "desc_frame"));
         gtk_widget_set_sensitive(w, TRUE);