summaryrefslogtreecommitdiffstats
path: root/src/sp-object.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/sp-object.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/sp-object.cpp')
-rw-r--r--src/sp-object.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 4e45eb824..3b09d80e8 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -1523,6 +1523,22 @@ char* SPObject::textualContent() const
return g_string_free(text, FALSE);
}
+// For debugging: Print SP tree structure.
+void SPObject::recursivePrintTree( unsigned level )
+{
+ if (level == 0) {
+ std::cout << "SP Object Tree" << std::endl;
+ }
+ std::cout << "SP: ";
+ for (unsigned i = 0; i < level; ++i) {
+ std::cout << " ";
+ }
+ std::cout << (getId()?getId():"No object id") << std::endl;
+ for (SPObject *child = children; child; child = child->next) {
+ child->recursivePrintTree( level+1 );
+ }
+}
+
/*
Local Variables:
mode:c++