From 39bb97bcb72ab7f1aab976e4eb9ef1f74685fee6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:54:27 +0100 Subject: [PATCH] [1.2.x] Fix excel export (#50) (#51) * fix: revert sonarlint suggestions (cherry picked from commit 77f0154cbf349f20f46f505ea35b9c365be18d2f) Co-authored-by: f-necas <39771412+f-necas@users.noreply.github.com> --- .../features/http/codec/xls/StreamingWorkbookWriter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/ogc-features/src/main/java/com/camptocamp/opendata/ogc/features/http/codec/xls/StreamingWorkbookWriter.java b/src/services/ogc-features/src/main/java/com/camptocamp/opendata/ogc/features/http/codec/xls/StreamingWorkbookWriter.java index 3d25337..efac9b1 100644 --- a/src/services/ogc-features/src/main/java/com/camptocamp/opendata/ogc/features/http/codec/xls/StreamingWorkbookWriter.java +++ b/src/services/ogc-features/src/main/java/com/camptocamp/opendata/ogc/features/http/codec/xls/StreamingWorkbookWriter.java @@ -112,7 +112,7 @@ public StreamingRow newRow() { if (null == lastRow) { lastRow = new StreamingRow(1, sheetWriter, this); } else { - lastRow.nextRow(); + lastRow = lastRow.nextRow(); } return lastRow; } @@ -192,15 +192,15 @@ private static class ColumnNames { private int index = 0; public String nextColumn() { - StringBuilder colName = new StringBuilder(); + String colName = ""; int n = ++index; while (n > 0) { int i = (n - 1) % letters.size(); - colName.append(letters.get(i)).append(colName); + colName = letters.get(i) + colName; n = (n - 1) / letters.size(); } - return colName.append(rowNum).toString(); + return colName + rowNum; } } }