12 if (str[pos] != ')')
13 result = Invalid;
14 ++pos;
15 } else {
16 QRegExp regExp("[A-Za-z][1-9][0-9]{0,2}");
17 QString token;
18 while (str[pos].isLetterOrNumber() || str[pos] == '.') {
19 token += str[pos];
20 ++pos;
21 }
22 if (regExp.exactMatch(token)) {
23 int column = token[0].toUpper().unicode() - 'A';
24 int row = token.mid(1).toInt() - 1;
25 Cell *c = static_cast<Cell *>(tableWidget()->item(row, column));
26 if (c) {
27 result = c->value();
28 } else {
29 result = 0.0;
30 }
31 } else {
32 bool ok;
33 result = token.toDouble(&ok);
34 if (!ok)
35 result = Invalid;
36 }
37 }
38 if (negative) {
39 if (result.type() == QVariant::Double) {
40 result = -result.toDouble();
41 } else {