From ef2594b0ca8105113100a3167a1e218f50137b20 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Thu, 22 Aug 2019 10:44:52 +0200 Subject: Allow to store empty value XML node attributtes --- src/ui/dialog/attrdialog.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/attrdialog.cpp b/src/ui/dialog/attrdialog.cpp index 994f2695c..7a699abab 100644 --- a/src/ui/dialog/attrdialog.cpp +++ b/src/ui/dialog/attrdialog.cpp @@ -336,10 +336,7 @@ void AttrDialog::onAttrChanged(Inkscape::XML::Node *repr, const gchar * name, co break; } } - if (new_value && - (strcmp(new_value, "") != 0 || - (repr->type() == Inkscape::XML::TEXT_NODE || - repr->type() == Inkscape::XML::COMMENT_NODE))) { + if (new_value) { Gtk::TreeModel::Row row = *(_store->prepend()); row[_attrColumns._attributeName] = name; row[_attrColumns._attributeValue] = new_value; @@ -500,7 +497,8 @@ void AttrDialog::nameEdited (const Glib::ustring& path, const Glib::ustring& nam row[_attrColumns._attributeName] = name; grab_focus(); _updating = true; - _repr->setAttribute(name.c_str(), value, false); + char const *valueto = value.c_str(); // this allow store empty values + _repr->setAttribute(name.c_str(), "", false); _updating = false; g_timeout_add(50, &sp_attrdialog_store_move_to_next, this); } -- cgit v1.2.3