Spreadsheet: fix cell clearing

This commit is contained in:
Zheng, Lei
2022-05-07 17:13:56 +08:00
committed by wwmayer
parent 44540a4d82
commit ef2db349f8

View File

@@ -1080,21 +1080,19 @@ short Sheet::mustExecute(void) const
void Sheet::clear(CellAddress address, bool /*all*/)
{
Cell * cell = getCell(address);
if (!cell)
return;
if (auto cell = getCell(address)) {
// Remove alias, if defined
std::string aliasStr;
if (cell->getAlias(aliasStr))
this->removeDynamicProperty(aliasStr.c_str());
cells.clear(address);
}
std::string addr = address.toString();
Property * prop = props.getDynamicPropertyByName(addr.c_str());
// Remove alias, if defined
std::string aliasStr;
if (cell->getAlias(aliasStr))
this->removeDynamicProperty(aliasStr.c_str());
cells.clear(address);
propAddress.erase(prop);
this->removeDynamicProperty(addr.c_str());
if (auto prop = props.getDynamicPropertyByName(addr.c_str())) {
propAddress.erase(prop);
this->removeDynamicProperty(addr.c_str());
}
}
/**