Mod: use empty

This commit is contained in:
berniev
2022-08-06 02:29:31 +10:00
committed by wwmayer
parent 22dcf5866f
commit 53ba98d636
134 changed files with 419 additions and 419 deletions

View File

@@ -208,7 +208,7 @@ bool Sheet::importFromFile(const std::string &filename, char delimiter, char quo
tokenizer<escaped_list_separator<char> > tok(line, e);
for(tokenizer<escaped_list_separator<char> >::iterator i = tok.begin(); i != tok.end();++i) {
if ((*i).size() > 0)
if (!*i.empty())
setCell(CellAddress(row, col), (*i).c_str());
col++;
}
@@ -930,7 +930,7 @@ DocumentObjectExecReturn *Sheet::execute(void)
std::map<CellAddress, Vertex> VertexList;
std::map<Vertex, CellAddress> VertexIndexList;
std::deque<CellAddress> workQueue(dirtyCells.begin(),dirtyCells.end());
while(workQueue.size()) {
while(!workQueue.empty()) {
CellAddress currPos = workQueue.front();
workQueue.pop_front();
@@ -978,7 +978,7 @@ DocumentObjectExecReturn *Sheet::execute(void)
}
// Try to be more user friendly by finding individual loops
while(dirtyCells.size()) {
while(!dirtyCells.empty()) {
std::deque<CellAddress> workQueue;
DependencyList graph;
@@ -989,7 +989,7 @@ DocumentObjectExecReturn *Sheet::execute(void)
workQueue.push_back(currentAddr);
dirtyCells.erase(dirtyCells.begin());
while (workQueue.size() > 0) {
while (!workQueue.empty()) {
CellAddress currPos = workQueue.front();
workQueue.pop_front();
@@ -1057,7 +1057,7 @@ DocumentObjectExecReturn *Sheet::execute(void)
rowHeights.clearDirty();
columnWidths.clearDirty();
if (cellErrors.size() == 0)
if (cellErrors.empty())
return DocumentObject::StdReturn;
else
return new DocumentObjectExecReturn("One or more cells failed contains errors.", this);
@@ -1070,7 +1070,7 @@ DocumentObjectExecReturn *Sheet::execute(void)
short Sheet::mustExecute(void) const
{
if (cellErrors.size() > 0 || cells.isDirty())
if (!cellErrors.empty() || cells.isDirty())
return 1;
return DocumentObject::mustExecute();
}
@@ -1381,13 +1381,13 @@ void Sheet::setAlias(CellAddress address, const std::string &alias)
{
std::string existingAlias = getAddressFromAlias(alias);
if (existingAlias.size() > 0) {
if (!existingAlias.empty()) {
if (existingAlias == address.toString()) // Same as old?
return;
else
throw Base::ValueError("Alias already defined");
}
else if (alias.size() == 0) // Empty?
else if (alias.empty()) // Empty?
cells.setAlias(address, "");
else if (isValidAlias(alias)) // Valid?
cells.setAlias(address, alias);
@@ -1427,7 +1427,7 @@ bool Sheet::isValidAlias(const std::string & candidate)
return false;
// Existing alias? Then it's ok
if (getAddressFromAlias(candidate).size() > 0 )
if (!getAddressFromAlias(candidate).empty() )
return true;
// Check to see that is does not crash with any other property in the Sheet object.