Core: Update expressions on property rename
This includes both expressions in generic containers and in spreadsheets.
This commit is contained in:
committed by
Yorik van Havre
parent
18d87df6f1
commit
5bdfba3a1a
@@ -1577,6 +1577,17 @@ void PropertySheet::onRelabeledDocument(const App::Document& doc)
|
||||
}
|
||||
}
|
||||
|
||||
void PropertySheet::onRenameDynamicProperty(const App::Property& prop, const char* oldName)
|
||||
{
|
||||
ObjectIdentifier oldNameId = ObjectIdentifier(prop.getContainer(), std::string(oldName));
|
||||
ObjectIdentifier newNameId = ObjectIdentifier(prop);
|
||||
const std::map<ObjectIdentifier, ObjectIdentifier> paths = {
|
||||
{oldNameId, newNameId},
|
||||
};
|
||||
|
||||
renameObjectIdentifiers(paths);
|
||||
}
|
||||
|
||||
void PropertySheet::renameObjectIdentifiers(
|
||||
const std::map<App::ObjectIdentifier, App::ObjectIdentifier>& paths)
|
||||
{
|
||||
|
||||
@@ -51,6 +51,7 @@ public:
|
||||
std::map<App::ObjectIdentifier, const App::Expression*> getExpressions() const override;
|
||||
void setExpressions(std::map<App::ObjectIdentifier, App::ExpressionPtr>&& exprs) override;
|
||||
void onRelabeledDocument(const App::Document& doc) override;
|
||||
void onRenameDynamicProperty(const App::Property& prop, const char* oldName) override;
|
||||
|
||||
void updateElementReference(App::DocumentObject* feature,
|
||||
bool reverse = false,
|
||||
|
||||
Reference in New Issue
Block a user