X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fprops%2Fprops_io.cxx;h=a4fe5a16e4b62c54f17440dec2b8877a1ddf66ac;hb=68eb7031e2dce999d112d0164fa28d4b8d66922e;hp=ec549011865a9ffa7840c74c85e30fa5276958a8;hpb=37ac409586f564db0e487f3d5b44b3a612d62438;p=simgear.git diff --git a/simgear/props/props_io.cxx b/simgear/props/props_io.cxx index ec549011..a4fe5a16 100644 --- a/simgear/props/props_io.cxx +++ b/simgear/props/props_io.cxx @@ -214,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); } } @@ -368,7 +371,6 @@ getTypeName (SGPropertyNode::Type type) case SGPropertyNode::STRING: return "string"; case SGPropertyNode::ALIAS: - return "alias"; case SGPropertyNode::NONE: return "unspecified"; } @@ -551,7 +553,7 @@ copyProperties (const SGPropertyNode *in, SGPropertyNode *out) // First, copy the actual value, // if any. if (in->hasValue()) { - switch (in->getType(false)) { + switch (in->getType()) { case SGPropertyNode::BOOL: if (!out->setBoolValue(in->getBoolValue())) retval = false; @@ -580,19 +582,18 @@ copyProperties (const SGPropertyNode *in, SGPropertyNode *out) if (!out->setUnspecifiedValue(in->getStringValue())) retval = false; break; - case SGPropertyNode::ALIAS: { - const char *path = in->getAliasTarget()->getPath(); - SGPropertyNode *node = out->getRootNode()->getNode(path, true); - out->alias(node); - break; - } default: + if (in->isAlias()) + break; string message = "Unknown internal SGPropertyNode type"; message += in->getType(); throw sg_error(message, "SimGear Property Reader"); } } + // copy the attributes. + out->setAttributes( in->getAttributes() ); + // Next, copy the children. int nChildren = in->nChildren(); for (int i = 0; i < nChildren; i++) {