From 202321681be73855379184000e493a27ef663a54 Mon Sep 17 00:00:00 2001 From: selim Date: Tue, 26 Dec 2023 03:16:38 +0100 Subject: [PATCH] Spreadsheet maximum/minimum size rows: 1-99 columns: 1-26 limit implemented. --- .../hs_mannheim/informatik/spreadsheet/Spreadsheet.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java index b1b25d9..8c8905b 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java @@ -26,7 +26,14 @@ public class Spreadsheet { */ 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];