Code

functional noop: xml/repr-io.cpp: (sp_repr_save_writer): Mark static. Slight shorten...
authorpjrm <pjrm@users.sourceforge.net>
Mon, 6 Apr 2009 23:50:14 +0000 (23:50 +0000)
committerpjrm <pjrm@users.sourceforge.net>
Mon, 6 Apr 2009 23:50:14 +0000 (23:50 +0000)
src/xml/repr-io.cpp

index adeac9735dde19f67ec8009535f16f16e5642f97..a659ab61f5ac3f0cb1345ab6ea837e1c28afd86f 100644 (file)
@@ -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');
+            }
         }
     }
 }