slaubach 2005/05/09 13:37:36
Modified: src/java/org/apache/poi/hssf/usermodel HSSFDataFormat.java
Log:
Fixed issue where adding builtin types pushed other formats later in the list.
Revision Changes Path
1.10 +7 -2 jakarta-poi/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
Index: HSSFDataFormat.java
===================================================================
RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- HSSFDataFormat.java 23 Aug 2004 08:52:42 -0000 1.9
+++ HSSFDataFormat.java 9 May 2005 20:37:35 -0000 1.10
@@ -232,7 +232,12 @@
while ( i.hasNext() )
{
ind = i.nextIndex();
- formats.add( ind, i.next() );
+ if ( formats.size() < ind + 1 )
+ {
+ formats.setSize( ind + 1 );
+ }
+
+ formats.set( ind, i.next() );
}
movedBuiltins = true;
}
@@ -247,7 +252,7 @@
ind = workbook.getFormat( format, true );
if ( formats.size() <= ind )
formats.setSize( ind + 1 );
- formats.add( ind, format );
+ formats.set( ind, format );
return (short) ind;
}
---------------------------------------------------------------------
To unsubscribe, e-mail:
[hidden email]
Mailing List:
http://jakarta.apache.org/site/mail2.html#poiThe Apache Jakarta POI Project:
http://jakarta.apache.org/poi/