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