Spreadsheet: fix owner property reference in PropertySheet

PropertySheet used to only work when refereceing its own cell either
through cell address or alias. It does not work for reference to other
property of the owner Spreadsheet object.
This commit is contained in:
Zheng, Lei
2022-03-16 10:08:17 +08:00
committed by Chris Hennes
parent fbbc89c52c
commit fcd176aef0
2 changed files with 10 additions and 2 deletions

View File

@@ -1291,7 +1291,14 @@ void PropertySheet::invalidateDependants(const App::DocumentObject *docObj)
}
}
void PropertySheet::slotChangedObject(const App::DocumentObject &obj, const App::Property &prop) {
void PropertySheet::slotChangedObject(const App::DocumentObject &obj, const App::Property &prop)
{
if (&obj == getContainer()) {
if (&prop == this || !prop.getName() || revAliasProp.count(prop.getName()))
return;
if (stringToAddress(prop.getName(), true).isValid())
return;
}
recomputeDependants(&obj, prop.getName());
}

View File

@@ -1568,7 +1568,8 @@ void Sheet::onChanged(const App::Property *prop) {
for(auto &range : tmp)
rangeUpdated(range);
}
else
cells.slotChangedObject(*this, *prop);
App::DocumentObject::onChanged(prop);
}