summaryrefslogtreecommitdiffstats
path: root/src/attribute-sort-util.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2016-07-04 12:30:44 +0000
committertavmjong-free <tavmjong@free.fr>2016-07-04 12:30:44 +0000
commitf5c74e3a9d4e23e6cc86851b426dd05958e907ee (patch)
tree8b9cc464d66b267ae49d2771a549e0df78d16fb0 /src/attribute-sort-util.cpp
parentRename function, fix some indenting issues. (diff)
downloadinkscape-f5c74e3a9d4e23e6cc86851b426dd05958e907ee.tar.gz
inkscape-f5c74e3a9d4e23e6cc86851b426dd05958e907ee.zip
Prevent data-losing crash when sorting attributes and Layer dialog open.
(bzr r15007)
Diffstat (limited to 'src/attribute-sort-util.cpp')
-rw-r--r--src/attribute-sort-util.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/attribute-sort-util.cpp b/src/attribute-sort-util.cpp
index d0f45c418..5c01f7914 100644
--- a/src/attribute-sort-util.cpp
+++ b/src/attribute-sort-util.cpp
@@ -105,12 +105,17 @@ void sp_attribute_sort_element(Node *repr) {
//for (auto it: my_list) {
for (std::vector<std::pair< Glib::ustring, Glib::ustring > >::iterator it = my_list.begin();
it != my_list.end(); ++it) {
- repr->setAttribute( it->first.c_str(), NULL, false );
+ // Removing "inkscape:label" results in crash when Layers dialog is open.
+ if (it->first != "inkscape:label") {
+ repr->setAttribute( it->first.c_str(), NULL, false );
+ }
}
// Insert all attributes in proper order
for (std::vector<std::pair< Glib::ustring, Glib::ustring > >::iterator it = my_list.begin();
it != my_list.end(); ++it) {
- repr->setAttribute( it->first.c_str(), it->second.c_str(), false );
+ if (it->first != "inkscape:label") {
+ repr->setAttribute( it->first.c_str(), it->second.c_str(), false );
+ }
}
}