From 585a146c902ece3bed826b1322c3911fb8fbde35 Mon Sep 17 00:00:00 2001 From: Peter Moulder Date: Thu, 11 Oct 2007 13:47:48 +0000 Subject: Provide Node const* versions of existing sp_repr_children and sp_repr_next functions. (bzr r3875) --- src/xml/repr.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xml/repr.h b/src/xml/repr.h index 23786d3b8..497cda119 100644 --- a/src/xml/repr.h +++ b/src/xml/repr.h @@ -147,11 +147,21 @@ inline Inkscape::XML::Node *sp_repr_parent(Inkscape::XML::Node const *repr) { return const_cast(repr->parent()); } +/// Returns first child of node, resets iterator. +inline Inkscape::XML::Node const *sp_repr_children(Inkscape::XML::Node const *repr) { + return ( repr ? repr->firstChild() : NULL ); +} + /// Returns first child of node, resets iterator. inline Inkscape::XML::Node *sp_repr_children(Inkscape::XML::Node *repr) { return ( repr ? repr->firstChild() : NULL ); } +/// Returns next child of node or NULL. +inline Inkscape::XML::Node const *sp_repr_next(Inkscape::XML::Node const *repr) { + return ( repr ? repr->next() : NULL ); +} + /// Returns next child of node or NULL. inline Inkscape::XML::Node *sp_repr_next(Inkscape::XML::Node *repr) { return ( repr ? repr->next() : NULL ); -- cgit v1.2.3