From 34109961a6de6f936a370e48822f1bad70bc84b2 Mon Sep 17 00:00:00 2001 From: sasilver Date: Tue, 5 Aug 2008 19:23:02 +0000 Subject: [PATCH] codedread's patch for bug 254850 (fixes handling of description field in Object Properties dialog when switching between an object with a description and one without a description with the dialog open). --- src/dialogs/item-properties.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp index 5ffac12e4..9b816436b 100644 --- a/src/dialogs/item-properties.cpp +++ b/src/dialogs/item-properties.cpp @@ -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); -- 2.30.2