Spreadsheet: Issue #2402: Added functionality to get cell address given an alias.

This commit is contained in:
Eivind Kvedalen
2016-01-15 23:36:27 +01:00
committed by wmayer
parent 5b1836026a
commit dafdc6b591
6 changed files with 70 additions and 0 deletions

View File

@@ -157,6 +157,27 @@ Cell *PropertySheet::getValue(CellAddress key)
return i->second;
}
const Cell *PropertySheet::getValue(CellAddress key) const
{
std::map<CellAddress, Cell*>::const_iterator i = data.find(key);
if (i == data.end())
return 0;
else
return i->second;
}
const Cell * PropertySheet::getValueFromAlias(const std::string &alias) const
{
std::map<std::string, CellAddress>::const_iterator it = revAliasProp.find(alias);
if (it != revAliasProp.end())
return getValue(it->second);
else
return 0;
}
std::set<CellAddress> PropertySheet::getUsedCells() const
{
std::set<CellAddress> usedSet;