App: clang-tidy cleanup of Expression::_renameObjectIdentifier

This commit is contained in:
Chris Hennes
2023-08-16 21:47:05 -05:00
committed by wwmayer
parent fcd622393a
commit 15c7aabe27

View File

@@ -3027,24 +3027,27 @@ bool VariableExpression::_updateElementReference(
}
bool VariableExpression::_renameObjectIdentifier(
const std::map<ObjectIdentifier,ObjectIdentifier> &paths,
const ObjectIdentifier &path, ExpressionVisitor &v)
const std::map<ObjectIdentifier, ObjectIdentifier>& paths,
const ObjectIdentifier& path,
ExpressionVisitor& visitor)
{
const auto &oldPath = var.canonicalPath();
const auto& oldPath = var.canonicalPath();
auto it = paths.find(oldPath);
if (it != paths.end()) {
v.aboutToChange();
visitor.aboutToChange();
const bool originalHasDocumentObjectName = var.hasDocumentObjectName();
ObjectIdentifier::String originalDocumentObjectName = var.getDocumentObjectName();
std::string originalSubObjectName = var.getSubObjectName();
if(path.getOwner())
if (path.getOwner()) {
var = it->second.relativeTo(path);
else
}
else {
var = it->second;
}
if (originalHasDocumentObjectName) {
var.setDocumentObjectName(std::move(originalDocumentObjectName),
true,
std::move(originalSubObjectName));
originalSubObjectName);
}
return true;
}