if (data != null)
{
int columnCount = MPPUtility.getShort(data, 4) + 1;
int index = 12;
Column column;
int alignment;
for (int loop = 0; loop < columnCount; loop++)
{
column = new Column(file);
int fieldType = MPPUtility.getShort(data, index);
if (table.getResourceFlag() == false)
{
column.setFieldType(MPPTaskField14.getInstance(fieldType));
}
else
{
column.setFieldType(MPPResourceField14.getInstance(fieldType));
}
//System.out.println(fieldType);
// if (column.getFieldType() == null)
// {
// System.out.println(loop + ": Unknown column type " + fieldType);
// }
// else
// {
// System.out.println(loop + ": " + column.getFieldType());
// }
column.setWidth(MPPUtility.getByte(data, index + 4));
String columnTitle = MPPUtility.getUnicodeString(data, index + 13);
if (columnTitle.length() != 0)
{
column.setTitle(columnTitle);
}
alignment = MPPUtility.getByte(data, index + 5);
if ((alignment & 0x0F) == 0x00)
{
column.setAlignTitle(Column.ALIGN_LEFT);
}
else
{
if ((alignment & 0x0F) == 0x01)
{
column.setAlignTitle(Column.ALIGN_CENTER);
}
else
{
column.setAlignTitle(Column.ALIGN_RIGHT);
}
}
alignment = MPPUtility.getByte(data, index + 7);
if ((alignment & 0x0F) == 0x00)
{
column.setAlignData(Column.ALIGN_LEFT);
}
else
{
if ((alignment & 0x0F) == 0x01)
{
column.setAlignData(Column.ALIGN_CENTER);
}
else
{
column.setAlignData(Column.ALIGN_RIGHT);
}
}
table.addColumn(column);
index += 115;