- Self-reference bug

- Refactoring/clean-up of code
- Dependency tracking of aliased cells
- Various resolution errors
- Rewriting of ranges when columns/rows are inserted/removed
- References to aliases keep their units.
This commit is contained in:
Eivind Kvedalen
2015-03-04 22:14:35 +01:00
committed by wmayer
parent da9f2f2ff8
commit b4dc4d97f4
20 changed files with 382 additions and 178 deletions

View File

@@ -161,33 +161,6 @@ Spreadsheet::CellAddress Spreadsheet::stringToAddress(const char * strAddress)
throw Base::Exception("Invalid cell specifier.");
}
/**
* Convert given \a row and \a col into a string address.
*
* @param row Row address.
* @param col Column address.
*
* @returns Address given as a string.
*/
std::string Spreadsheet::addressToString(const CellAddress &address)
{
std::stringstream s;
if (address.col() < 26)
s << (char)('A' + address.col());
else {
int col = address.col() - 26;
s << (char)('A' + (col / 26));
s << (char)('A' + (col % 26));
}
s << (address.row() + 1);
return s.str();
}
void Spreadsheet::createRectangles(std::set<std::pair<int, int> > & cells, std::map<std::pair<int, int>, std::pair<int, int> > & rectangles)
{
while (cells.size() != 0) {
@@ -342,3 +315,28 @@ std::string Spreadsheet::unquote(const std::string & input)
return output;
}
/**
* Convert given \a cell address into its string representation.
*
* @returns Address given as a string.
*/
std::string Spreadsheet::CellAddress::toString() const
{
std::stringstream s;
if (col() < 26)
s << (char)('A' + col());
else {
int colnum = col() - 26;
s << (char)('A' + (colnum / 26));
s << (char)('A' + (colnum % 26));
}
s << (row() + 1);
return s.str();
}