Spreadsheet: improve efficiency when pasting many cells

This commit is contained in:
Zheng, Lei
2022-04-22 22:36:08 +08:00
committed by Chris Hennes
parent 98668ed947
commit 54ed4fe34f
2 changed files with 4 additions and 4 deletions

View File

@@ -433,7 +433,6 @@ void PropertySheet::pasteCells(XMLReader &reader, Range dstRange) {
if(!dst.isValid())
continue;
owner->clear(dst);
owner->cellUpdated(dst);
}
}
range.next();
@@ -480,7 +479,6 @@ void PropertySheet::pasteCells(XMLReader &reader, Range dstRange) {
recomputeDependencies(dst);
}
dirty.insert(dst);
owner->cellUpdated(dst);
}
}
}
@@ -493,11 +491,11 @@ void PropertySheet::pasteCells(XMLReader &reader, Range dstRange) {
if(!dst.isValid())
continue;
owner->clear(dst);
owner->cellUpdated(dst);
}
}
}while(range.next());
}
owner->rangeUpdated(Range(from, to));
}
signaller.tryInvoke();
}

View File

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