summaryrefslogtreecommitdiffstats
path: root/src/xml/simple-node.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-12-16 14:05:47 +0000
committertavmjong-free <tavmjong@free.fr>2014-12-16 14:05:47 +0000
commit0533bf991e946b09053753566f209940f500d368 (patch)
tree2397d3e048ae8393126d928e0f163ee3638d722c /src/xml/simple-node.cpp
parentRead 'context-fill' and 'context-stroke' keywords. (diff)
downloadinkscape-0533bf991e946b09053753566f209940f500d368.tar.gz
inkscape-0533bf991e946b09053753566f209940f500d368.zip
Debugging routines to print out XML, SP Object, and Display Item trees.
(bzr r13802)
Diffstat (limited to 'src/xml/simple-node.cpp')
-rw-r--r--src/xml/simple-node.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/xml/simple-node.cpp b/src/xml/simple-node.cpp
index 4965f81c8..3cbedc80b 100644
--- a/src/xml/simple-node.cpp
+++ b/src/xml/simple-node.cpp
@@ -606,6 +606,26 @@ void SimpleNode::synthesizeEvents(NodeObserver &observer) {
synthesizeEvents(&OBSERVER_EVENT_VECTOR, &observer);
}
+void SimpleNode::recursivePrintTree(unsigned level) {
+
+ if (level == 0) {
+ std::cout << "XML Node Tree" << std::endl;
+ }
+ std::cout << "XML: ";
+ for (unsigned i = 0; i < level; ++i) {
+ std::cout << " ";
+ }
+ char const *id=attribute("id");
+ if (id) {
+ std::cout << id << std::endl;
+ } else {
+ std::cout << name() << std::endl;
+ }
+ for (SimpleNode *child = _first_child; child != NULL; child = child->_next) {
+ child->recursivePrintTree( level+1 );
+ }
+}
+
Node *SimpleNode::root() {
Node *parent=this;
while (parent->parent()) {