fixes 0003518: Expressions (fx) not updated

This commit is contained in:
wmayer
2018-11-11 10:58:48 +01:00
parent 05550fcdf0
commit 8eb3600a2d
2 changed files with 36 additions and 0 deletions

View File

@@ -80,6 +80,24 @@ protected:
it->second = jt->second;
}
}
// update the expression if name of the object is used
else if (LocalName == "Expression") {
std::map<std::string, std::string>::iterator it = AttrMap.find("expression");
if (it != AttrMap.end()) {
// search for the part before the first dot that should be the object name.
std::string expression = it->second;
std::string::size_type dotpos = expression.find_first_of(".");
if (dotpos != std::string::npos) {
std::string name = expression.substr(0, dotpos);
std::map<std::string, std::string>::const_iterator jt = nameMap.find(name);
if (jt != nameMap.end()) {
std::string newexpression = jt->second;
newexpression += expression.substr(dotpos);
it->second = newexpression;
}
}
}
}
}
}

View File

@@ -80,6 +80,24 @@ protected:
it->second = jt->second;
}
}
// update the expression if name of the object is used
else if (LocalName == "Expression") {
std::map<std::string, std::string>::iterator it = AttrMap.find("expression");
if (it != AttrMap.end()) {
// search for the part before the first dot that should be the object name.
std::string expression = it->second;
std::string::size_type dotpos = expression.find_first_of(".");
if (dotpos != std::string::npos) {
std::string name = expression.substr(0, dotpos);
std::map<std::string, std::string>::const_iterator jt = nameMap.find(name);
if (jt != nameMap.end()) {
std::string newexpression = jt->second;
newexpression += expression.substr(dotpos);
it->second = newexpression;
}
}
}
}
}
}