Merge pull request #17315 from mwganson/ssclearall
[Spreadsheet] avoid removing user dynamic properties when clearing ce…
This commit is contained in:
@@ -108,7 +108,11 @@ Sheet::~Sheet()
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all cells in the sheet.
|
||||
* Clear all cells in the sheet. These are implemented as dynamic
|
||||
* properties, for example "A1" is added as a dynamic property. Since
|
||||
* now users may add dyanamic properties, we need to try to avoid
|
||||
* removing those, too, so we check whether the dynamic property name
|
||||
* is a valid cell address name before removing it.
|
||||
*/
|
||||
|
||||
void Sheet::clearAll()
|
||||
@@ -118,7 +122,9 @@ void Sheet::clearAll()
|
||||
std::vector<std::string> propNames = props.getDynamicPropertyNames();
|
||||
|
||||
for (const auto& propName : propNames) {
|
||||
this->removeDynamicProperty(propName.c_str());
|
||||
if (cells.isValidCellAddressName(propName.c_str())) {
|
||||
this->removeDynamicProperty(propName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
propAddress.clear();
|
||||
|
||||
Reference in New Issue
Block a user