| 3006 | } |
| 3007 | |
| 3008 | bool VariableExpression::_renameObjectIdentifier( |
| 3009 | const std::map<ObjectIdentifier, ObjectIdentifier>& paths, |
| 3010 | const ObjectIdentifier& path, |
| 3011 | ExpressionVisitor& visitor) |
| 3012 | { |
| 3013 | const auto& oldPath = var.canonicalPath(); |
| 3014 | auto it = paths.find(oldPath); |
| 3015 | if (it != paths.end()) { |
| 3016 | visitor.aboutToChange(); |
| 3017 | const bool originalHasDocumentObjectName = var.hasDocumentObjectName(); |
| 3018 | ObjectIdentifier::String originalDocumentObjectName = var.getDocumentObjectName(); |
| 3019 | std::string originalSubObjectName = var.getSubObjectName(); |
| 3020 | if (path.getOwner()) { |
| 3021 | var = it->second.relativeTo(path); |
| 3022 | } |
| 3023 | else { |
| 3024 | var = it->second; |
| 3025 | } |
| 3026 | if (originalHasDocumentObjectName) { |
| 3027 | var.setDocumentObjectName(std::move(originalDocumentObjectName), |
| 3028 | true, |
| 3029 | originalSubObjectName); |
| 3030 | } |
| 3031 | return true; |
| 3032 | } |
| 3033 | return false; |
| 3034 | } |
| 3035 | |
| 3036 | void VariableExpression::_collectReplacement( |
| 3037 | std::map<ObjectIdentifier,ObjectIdentifier> &paths, |
no test coverage detected