]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/props_io.cxx
Harald JOHNSEN:
[simgear.git] / simgear / props / props_io.cxx
index 00cafd2a0b88a15fe7d1d9cd0540177583209d4b..a4fe5a16e4b62c54f17440dec2b8877a1ddf66ac 100644 (file)
@@ -173,7 +173,6 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts)
 
                                // Got the index, so grab the node.
     SGPropertyNode * node = st.node->getChild(name, index, true);
-    node->clearValue();
 
                                // Get the access-mode attributes,
                                // but don't set yet (in case they
@@ -215,7 +214,10 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts)
       }
     }
 
-    push_state(node, atts.getValue("type"), mode);
+    const char *type = atts.getValue("type");
+    if (type)
+      node->clearValue();
+    push_state(node, type, mode);
   }
 }
 
@@ -589,6 +591,9 @@ copyProperties (const SGPropertyNode *in, SGPropertyNode *out)
     }
   }
 
+                               // copy the attributes.
+  out->setAttributes( in->getAttributes() );
+
                                // Next, copy the children.
   int nChildren = in->nChildren();
   for (int i = 0; i < nChildren; i++) {