summaryrefslogtreecommitdiffstats
path: root/src/id-clash.cpp
diff options
context:
space:
mode:
authorMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
committerMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
commite7248b2fa042f42a5c4dd14cd86ab6a5b4524059 (patch)
tree9097520c54e355ded9bd0b4d6618af4e8dacdd91 /src/id-clash.cpp
parentupdated to latest trunk (diff)
parent[Bug #1695016] Xaml export misses some radialGradients. (diff)
downloadinkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.tar.gz
inkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.zip
updated to latest trunk
(bzr r14876.2.4)
Diffstat (limited to 'src/id-clash.cpp')
-rw-r--r--src/id-clash.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/id-clash.cpp b/src/id-clash.cpp
index 4bd66e858..162cb9e89 100644
--- a/src/id-clash.cpp
+++ b/src/id-clash.cpp
@@ -23,8 +23,6 @@
#include "sp-object.h"
#include "style.h"
#include "sp-paint-server.h"
-#include "xml/node.h"
-#include "xml/repr.h"
#include "sp-root.h"
#include "sp-gradient.h"
@@ -187,9 +185,9 @@ find_references(SPObject *elem, refmap_type &refmap)
}
// recurse
- for (SPObject *child = elem->firstChild(); child; child = child->getNext() )
+ for (auto& child: elem->children)
{
- find_references(child, refmap);
+ find_references(&child, refmap);
}
}
@@ -242,9 +240,9 @@ change_clashing_ids(SPDocument *imported_doc, SPDocument *current_doc,
// recurse
- for (SPObject *child = elem->firstChild(); child; child = child->getNext() )
+ for (auto& child: elem->children)
{
- change_clashing_ids(imported_doc, current_doc, child, refmap, id_changes);
+ change_clashing_ids(imported_doc, current_doc, &child, refmap, id_changes);
}
}
@@ -375,9 +373,9 @@ void rename_id(SPObject *elem, Glib::ustring const &new_name)
gchar *id = g_strdup(new_name.c_str()); //id is not empty here as new_name is check to be not empty
g_strcanon (id, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.:", '_');
Glib::ustring new_name2 = id; //will not fail as id can not be NULL, see length check on new_name
- g_free (id);
if (!isalnum (new_name2[0])) {
g_message("Invalid Id, will not change.");
+ g_free (id);
return;
}
@@ -398,7 +396,7 @@ void rename_id(SPObject *elem, Glib::ustring const &new_name)
break;
}
}
-
+ g_free (id);
// Change to the new ID
elem->getRepr()->setAttribute("id", new_name2);
// Make a note of this change, if we need to fix up refs to it