From: pjrm Date: Thu, 11 Oct 2007 13:47:48 +0000 (+0000) Subject: Provide Node const* versions of existing sp_repr_children and sp_repr_next functions. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=23b15a071a10a7d279f01f17cce1d6b43120c831;p=inkscape.git Provide Node const* versions of existing sp_repr_children and sp_repr_next functions. --- 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 );