Fix initial value for tied read-only properties
This commit is contained in:
@@ -1615,8 +1615,12 @@ bool SGPropertyNode::tie (const SGRawValue<const char *> &rawValue,
|
|||||||
_tied = true;
|
_tied = true;
|
||||||
_value.val = rawValue.clone();
|
_value.val = rawValue.clone();
|
||||||
|
|
||||||
if (useDefault)
|
if (useDefault) {
|
||||||
|
int save_attributes = getAttributes();
|
||||||
|
setAttribute( WRITE, true );
|
||||||
setStringValue(old_val.c_str());
|
setStringValue(old_val.c_str());
|
||||||
|
setAttributes( save_attributes );
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1786,8 +1786,12 @@ bool SGPropertyNode::tie(const SGRawValue<T> &rawValue, bool useDefault)
|
|||||||
_type = EXTENDED;
|
_type = EXTENDED;
|
||||||
_tied = true;
|
_tied = true;
|
||||||
_value.val = rawValue.clone();
|
_value.val = rawValue.clone();
|
||||||
if (useDefault)
|
if (useDefault) {
|
||||||
|
int save_attributes = getAttributes();
|
||||||
|
setAttribute( WRITE, true );
|
||||||
setValue(old_val);
|
setValue(old_val);
|
||||||
|
setAttributes( save_attributes );
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user