Spreadsheet maximum/minimum size rows: 1-99 columns: 1-26 limit implemented.
parent
d9b6ff9140
commit
202321681b
|
@ -26,7 +26,14 @@ public class Spreadsheet {
|
||||||
*/
|
*/
|
||||||
public Spreadsheet(int rows, int cols) {
|
public Spreadsheet(int rows, int cols) {
|
||||||
|
|
||||||
// TODO limit the maximum size on 99 (1..99) rows and 26 (A..Z) columns
|
if(rows>99)
|
||||||
|
rows = 99;
|
||||||
|
else if(rows<1)
|
||||||
|
rows = 1;
|
||||||
|
if(cols < 1)
|
||||||
|
cols = 1;
|
||||||
|
else if(cols > 26)
|
||||||
|
cols = 26;
|
||||||
|
|
||||||
cells = new Cell[rows][cols];
|
cells = new Cell[rows][cols];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue