Spreadsheet: do not create string property for empty cell

Otherwise may cause massive slow down when, for example, the user
changes the entire row/column color, which results in large amount of
empty cells.
This commit is contained in:
Zheng, Lei
2021-04-04 15:27:26 +08:00
committed by Chris Hennes
parent 8df2f885e1
commit 68299281d3
2 changed files with 11 additions and 4 deletions

View File

@@ -683,10 +683,12 @@ void Sheet::updateProperty(CellAddress key)
else {
std::string s;
if (cell->getStringContent(s))
if (cell->getStringContent(s) && !s.empty())
output.reset(new StringExpression(this, s));
else
output.reset(new StringExpression(this, ""));
else {
this->removeDynamicProperty(key.toString().c_str());
return;
}
}
/* Eval returns either NumberExpression or StringExpression, or