From 23b15a071a10a7d279f01f17cce1d6b43120c831 Mon Sep 17 00:00:00 2001 From: pjrm Date: Thu, 11 Oct 2007 13:47:48 +0000 Subject: [PATCH] Provide Node const* versions of existing sp_repr_children and sp_repr_next functions. --- 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 ); -- 2.30.2