bug[ats_ATS416136]: EV Calculator txt file adds extra tab
Change-Id: Ia96fa89c8c0d9e88f5393e4a241be5fc157b9509
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/AbstractSheetWriter.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/AbstractSheetWriter.java
index 3c64e0c..5753d1d 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/AbstractSheetWriter.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/AbstractSheetWriter.java
@@ -44,7 +44,7 @@
@Override
public void writeRow(Object... row) throws IOException {
for (int i = 0; i < row.length; i++) {
- writeCell(row[i], implicitCellIndex, row.length);
+ writeCell(row[i], implicitCellIndex);
}
endRow();
@@ -60,12 +60,6 @@
writeCellText(data, cellIndex);
}
- public void writeCell(Object data, int cellIndex, int rowLength) throws IOException {
- startRowIfNecessary();
- implicitCellIndex = cellIndex + 1;
- writeCellText(data, cellIndex, rowLength);
- }
-
@Override
public void endRow() throws IOException {
startRowIfNecessary();
@@ -88,5 +82,4 @@
protected abstract void writeCellText(Object data, int cellIndex) throws IOException;
- protected abstract void writeCellText(Object data, int cellIndex, int rowLength) throws IOException;
}
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/ExcelXmlWriter.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/ExcelXmlWriter.java
index ce753a3..c7f07e2 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/ExcelXmlWriter.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/ExcelXmlWriter.java
@@ -374,8 +374,4 @@
}
}
- @Override
- protected void writeCellText(Object data, int cellIndex, int rowLength) throws IOException {
- writeCellText(data, cellIndex);
- }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/TextSheetWriter.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/TextSheetWriter.java
index 5aae73c..a1595af 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/TextSheetWriter.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/TextSheetWriter.java
@@ -23,6 +23,7 @@
private CharBackedInputStream currentStream;
private boolean wasDataAdded;
private final String lineSeparator;
+ private int columnCount;
public TextSheetWriter() {
sheetMap = new LinkedHashMap<>();
@@ -54,17 +55,12 @@
@Override
protected void writeCellText(Object data, int cellIndex) throws IOException {
- writeCellText(data, cellIndex, cellIndex + 1);
- }
-
- @Override
- protected void writeCellText(Object data, int cellIndex, int rowLength) throws IOException {
if (data instanceof String) {
String dataStr = (String) data;
if (Strings.isValid(dataStr)) {
currentStream.append(dataStr);
}
- if (cellIndex < rowLength) {
+ if (cellIndex < columnCount - 1) {
currentStream.append("\t");
}
wasDataAdded = true;
@@ -89,6 +85,7 @@
@Override
public void startSheet(String worksheetName, int columnCount) throws IOException {
+ this.columnCount = columnCount;
currentStream = new CharBackedInputStream();
sheetMap.put(worksheetName, currentStream);
}
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/WordMlTableWriter.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/WordMlTableWriter.java
index 561ad59..5022927 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/WordMlTableWriter.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/xml/WordMlTableWriter.java
@@ -90,8 +90,4 @@
//
}
- @Override
- protected void writeCellText(Object data, int cellIndex, int rowLength) throws IOException {
- writeCellText(data, cellIndex);
- }
}