From: pjrm Date: Mon, 6 Apr 2009 23:50:14 +0000 (+0000) Subject: functional noop: xml/repr-io.cpp: (sp_repr_save_writer): Mark static. Slight shorten... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=edb211e8a9e1517d970164281a36727c356c4903;p=inkscape.git functional noop: xml/repr-io.cpp: (sp_repr_save_writer): Mark static. Slight shortening of implementation. --- diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index adeac9735..a659ab61f 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -528,7 +528,7 @@ sp_repr_svg_read_node (Document *xml_doc, xmlNodePtr node, const gchar *default_ } -void +static void sp_repr_save_writer(Document *doc, Inkscape::IO::Writer *out, gchar const *default_ns) { @@ -544,17 +544,17 @@ sp_repr_save_writer(Document *doc, Inkscape::IO::Writer *out, out->writeString( str ); } - Node *repr = sp_repr_document_first_child(doc); - for ( repr = sp_repr_document_first_child(doc) ; - repr ; repr = sp_repr_next(repr) ) + for (Node *repr = sp_repr_document_first_child(doc); + repr; repr = sp_repr_next(repr)) { - if ( repr->type() == Inkscape::XML::ELEMENT_NODE ) { + Inkscape::XML::NodeType const node_type = repr->type(); + if ( node_type == Inkscape::XML::ELEMENT_NODE ) { sp_repr_write_stream_root_element(repr, *out, TRUE, default_ns, inlineattrs, indent); - } else if ( repr->type() == Inkscape::XML::COMMENT_NODE ) { - sp_repr_write_stream(repr, *out, 0, TRUE, GQuark(0), inlineattrs, indent); - out->writeChar( '\n' ); } else { sp_repr_write_stream(repr, *out, 0, TRUE, GQuark(0), inlineattrs, indent); + if ( node_type == Inkscape::XML::COMMENT_NODE ) { + out->writeChar('\n'); + } } } }