Fixed issue where adding builtin types pushed other formats later in the list.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353677 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shawn Laubach 2005-05-09 20:37:35 +00:00
parent 8f5847ee81
commit fd8f48f7d7

View File

@ -232,7 +232,12 @@ public class HSSFDataFormat
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 @@ public class HSSFDataFormat
ind = workbook.getFormat( format, true );
if ( formats.size() <= ind )
formats.setSize( ind + 1 );
formats.add( ind, format );
formats.set( ind, format );
return (short) ind;
}