From 90b64ebe567875ca951d24745f8423a53042097e Mon Sep 17 00:00:00 2001 From: f-necas <39771412+f-necas@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:53:55 +0100 Subject: [PATCH] Fix excel export (#50) * fix: revert sonarlint suggestions (cherry picked from commit 77f0154cbf349f20f46f505ea35b9c365be18d2f) --- .../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; } } }