From ada8f538a22b31611adf00a896e3b42b978bedb2 Mon Sep 17 00:00:00 2001 From: Oliver Hummel Date: Tue, 19 Dec 2023 15:25:55 +0100 Subject: [PATCH] Bugfix - OutofBoundsException. --- .../de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java index de46be0..ceacf6f 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java @@ -96,7 +96,7 @@ public class Spreadsheet { else out.print(cell.getValue()); - if (cell != row[cells.length-1]) + if (cell != row[cells[0].length-1]) out.print(","); } out.println(); @@ -182,7 +182,7 @@ public class Spreadsheet { StringBuilder sb = new StringBuilder(); sb.append(" "); - for (int i = 0; i < cells.length; i++) { + for (int i = 0; i < cells[0].length; i++) { sb.append(" " + (char)('A'+ i) + " | "); }