Coord: do not accept invalid strings starting with valid coordinates

This commit is contained in:
Olivier Teulière 2012-12-18 02:04:33 +01:00
parent 536da10a97
commit bedcc561f3

View file

@ -100,6 +100,9 @@ void Coord::setFromString(const wstring &iWStr)
int row = toupper(*l) - 'A' + 1;
setCol(col);
setRow(row);
// Input such as "A12foo#bar&stuff" should be invalid
if (isValid() && toString() != iWStr)
setCol(-1);
}
wstring Coord::toString(coord_mode_t mode) const