Keep the label of a variable in expression on spreadsheet alias rename (#10222)
Fixes #5800
This commit is contained in:
@@ -3034,10 +3034,18 @@ bool VariableExpression::_renameObjectIdentifier(
|
||||
auto it = paths.find(oldPath);
|
||||
if (it != paths.end()) {
|
||||
v.aboutToChange();
|
||||
const bool originalHasDocumentObjectName = var.hasDocumentObjectName();
|
||||
ObjectIdentifier::String originalDocumentObjectName = var.getDocumentObjectName();
|
||||
std::string originalSubObjectName = var.getSubObjectName();
|
||||
if(path.getOwner())
|
||||
var = it->second.relativeTo(path);
|
||||
else
|
||||
var = it->second;
|
||||
if (originalHasDocumentObjectName) {
|
||||
var.setDocumentObjectName(std::move(originalDocumentObjectName),
|
||||
true,
|
||||
std::move(originalSubObjectName));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user