avik 2003/02/21 07:59:58
Modified: src/java/org/apache/poi/hssf/model Sheet.java
Log:
Bug 17222: Workbook corruption when using sheet.addRow()
Revision Changes Path
1.25 +4 -0 jakarta-poi/src/java/org/apache/poi/hssf/model/Sheet.java
Index: Sheet.java
===================================================================
RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/model/Sheet.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- Sheet.java 6 Feb 2003 10:29:44 -0000 1.24
+++ Sheet.java 21 Feb 2003 15:59:58 -0000 1.25
@@ -995,6 +995,10 @@
d.setFirstRow(row.getRowNumber());
}
//IndexRecord index = null;
+ //If the row exists remove it, so that any cells attached to the row are
removed
+ RowRecord existingRow = rows.getRow(row.getRowNumber());
+ if (existingRow != null)
+ rows.removeRow(existingRow);
rows.insertRow(row);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]