App: fix restoring the attributes of a dynamic property

For more details see: https://forum.freecadweb.org/viewtopic.php?p=591465#p591465
This commit is contained in:
wmayer
2022-05-03 16:52:54 +02:00
parent eebdaadb94
commit dc53e6dce1
2 changed files with 29 additions and 1 deletions

View File

@@ -307,7 +307,10 @@ Property *DynamicProperty::restore(PropertyContainer &pc,
doc = reader.getAttribute("doc");
if (reader.hasAttribute("attr")) {
attr = reader.getAttribute("attr");
if (attr) attribute = attr[0]-48;
if (attr) {
std::istringstream str(attr);
str >> attribute;
}
}
if (reader.hasAttribute("ro")) {
ro = reader.getAttribute("ro");
@@ -317,6 +320,7 @@ Property *DynamicProperty::restore(PropertyContainer &pc,
hide = reader.getAttribute("hide");
if (hide) hidden = (hide[0]-48) != 0;
}
return addDynamicProperty(pc,TypeName, PropName, group, doc, attribute, readonly, hidden);
}