From: david Date: Tue, 19 Feb 2002 15:20:02 +0000 (+0000) Subject: IMPORTANT: backwards-incompatible change to properties. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aef809348f94c3ad8a7d76cc355239683436c142;p=simgear.git IMPORTANT: backwards-incompatible change to properties. The useDefault argument for the SGPropertyNode::tie(...) methods will invoke the setter only when there is already a property value defined; previously, the setter was always invoked, with a default value if necessary. --- diff --git a/simgear/misc/props.cxx b/simgear/misc/props.cxx index 359519ef..ebad665c 100644 --- a/simgear/misc/props.cxx +++ b/simgear/misc/props.cxx @@ -1117,6 +1117,7 @@ SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) if (_type == ALIAS || _tied) return false; + useDefault = useDefault && hasValue(); bool old_val = false; if (useDefault) old_val = getBoolValue(); @@ -1138,6 +1139,7 @@ SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) if (_type == ALIAS || _tied) return false; + useDefault = useDefault && hasValue(); int old_val = 0; if (useDefault) old_val = getIntValue(); @@ -1159,6 +1161,7 @@ SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) if (_type == ALIAS || _tied) return false; + useDefault = useDefault && hasValue(); long old_val = 0; if (useDefault) old_val = getLongValue(); @@ -1180,6 +1183,7 @@ SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) if (_type == ALIAS || _tied) return false; + useDefault = useDefault && hasValue(); float old_val = 0.0; if (useDefault) old_val = getFloatValue(); @@ -1201,6 +1205,7 @@ SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) if (_type == ALIAS || _tied) return false; + useDefault = useDefault && hasValue(); double old_val = 0.0; if (useDefault) old_val = getDoubleValue(); @@ -1223,6 +1228,7 @@ SGPropertyNode::tie (const SGRawValue &rawValue, bool useDefault) if (_type == ALIAS || _tied) return false; + useDefault = useDefault && hasValue(); string old_val; if (useDefault) old_val = getStringValue();