summaryrefslogtreecommitdiffstats
path: root/src/dialogs
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2008-05-08 13:05:51 +0000
committermental <mental@users.sourceforge.net>2008-05-08 13:05:51 +0000
commit8b71ee28d6d834eacf8853822b7c667f5c8eb21f (patch)
tree0a9db9f3c5fc645f4d9a2746f1d020882cd5db33 /src/dialogs
parentset eol-style:native for newly added files (diff)
downloadinkscape-8b71ee28d6d834eacf8853822b7c667f5c8eb21f.tar.gz
inkscape-8b71ee28d6d834eacf8853822b7c667f5c8eb21f.zip
merge inline patch from Jimmy
(bzr r5631)
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/sp-attribute-widget.cpp35
-rw-r--r--src/dialogs/xml-tree.cpp6
2 files changed, 6 insertions, 35 deletions
diff --git a/src/dialogs/sp-attribute-widget.cpp b/src/dialogs/sp-attribute-widget.cpp
index 92da747a4..4424aaa1b 100644
--- a/src/dialogs/sp-attribute-widget.cpp
+++ b/src/dialogs/sp-attribute-widget.cpp
@@ -158,25 +158,14 @@ sp_attribute_widget_changed (GtkEditable *editable)
text = NULL;
if (spaw->hasobj && spaw->src.object) {
-
- if (!sp_repr_set_attr ( SP_OBJECT_REPR (spaw->src.object),
- spaw->attribute, text) )
- {
- /* Cannot set attribute */
- text = SP_OBJECT_REPR (spaw->src.object)->attribute(spaw->attribute);
- gtk_entry_set_text (GTK_ENTRY (spaw), text ? text : "");
- }
+
+ SP_OBJECT_REPR (spaw->src.object)->setAttribute(spaw->attribute, text, false);
sp_document_done (SP_OBJECT_DOCUMENT (spaw->src.object), SP_VERB_NONE,
_("Set attribute"));
} else if (spaw->src.repr) {
- if (!sp_repr_set_attr (spaw->src.repr, spaw->attribute, text))
- {
- /* Cannot set attribute */
- text = spaw->src.repr->attribute(spaw->attribute);
- gtk_entry_set_text (GTK_ENTRY (spaw), text ? text : "");
- }
+ spaw->src.repr->setAttribute(spaw->attribute, text, false);
/* TODO: Warning! Undo will not be flushed in given case */
}
spaw->blocked = FALSE;
@@ -775,27 +764,13 @@ sp_attribute_table_entry_changed ( GtkEditable *editable,
text = NULL;
if (spat->hasobj && spat->src.object) {
- if (!sp_repr_set_attr ( SP_OBJECT_REPR (spat->src.object),
- spat->attributes[i], text))
- {
- /* Cannot set attribute */
- text = SP_OBJECT_REPR (spat->src.object)->attribute(spat->attributes[i]);
- gtk_entry_set_text ( GTK_ENTRY (spat->entries[i]),
- text ? text : (const gchar *) "");
- }
+ SP_OBJECT_REPR (spat->src.object)->setAttribute(spat->attributes[i], text, false);
sp_document_done (SP_OBJECT_DOCUMENT (spat->src.object), SP_VERB_NONE,
_("Set attribute"));
} else if (spat->src.repr) {
- if (!sp_repr_set_attr (spat->src.repr,
- spat->attributes[i], text))
- {
- /* Cannot set attribute */
- text = spat->src.repr->attribute(spat->attributes[i]);
- gtk_entry_set_text ( GTK_ENTRY (spat->entries[i]),
- text ? text : (const gchar *) "" );
- }
+ spat->src.repr->setAttribute(spat->attributes[i], text, false);
/* TODO: Warning! Undo will not be flushed in given case */
}
spat->blocked = FALSE;
diff --git a/src/dialogs/xml-tree.cpp b/src/dialogs/xml-tree.cpp
index 1bc28b328..2d1b4c4b1 100644
--- a/src/dialogs/xml-tree.cpp
+++ b/src/dialogs/xml-tree.cpp
@@ -1463,11 +1463,7 @@ void cmd_set_attr(GtkObject */*object*/, gpointer /*data*/)
gchar *value = gtk_text_buffer_get_text( gtk_text_view_get_buffer(attr_value),
&start, &end, TRUE );
- if (!sp_repr_set_attr(selected_repr, name, value)) {
- gchar *message = g_strdup_printf(_("Cannot set <b>%s</b>: Another element with value <b>%s</b> already exists!"), name, value);
- _message_stack->flash(Inkscape::WARNING_MESSAGE, message);
- g_free(message);
- }
+ selected_repr->setAttribute(name, value, false);
g_free(name);
g_free(value);