Add assert for row==0 and col==0

As some users consider that (0, 0) is the first valid cell, so we give
a assert failure in debug mode for such cases.
This commit is contained in:
Debao Zhang
2014-03-10 15:46:04 +08:00
parent bd921dddf9
commit 3c3269b30e
+3
View File
@@ -147,6 +147,9 @@ QString WorksheetPrivate::generateDimensionString() const
*/
int WorksheetPrivate::checkDimensions(int row, int col, bool ignore_row, bool ignore_col)
{
Q_ASSERT_X(row!=0, "checkDimensions", "row should start from 1 instead of 0");
Q_ASSERT_X(col!=0, "checkDimensions", "column should start from 1 instead of 0");
if (row > XLSX_ROW_MAX || row < 1 || col > XLSX_COLUMN_MAX || col < 1)
return -1;