/** Sets all non null fields into the <code>ci</code> parameter. */
 private void setColumnInfoFields(
     ColumnInfoRecord ci,
     Short xfStyle,
     Short width,
     Integer level,
     Boolean hidden,
     Boolean collapsed) {
   if (xfStyle != null) ci.setXFIndex(xfStyle.shortValue());
   if (width != null) ci.setColumnWidth(width.shortValue());
   if (level != null) ci.setOutlineLevel(level.shortValue());
   if (hidden != null) ci.setHidden(hidden.booleanValue());
   if (collapsed != null) ci.setCollapsed(collapsed.booleanValue());
 }
 public ColumnInfoRecord writeHidden(ColumnInfoRecord columnInfo, int idx, boolean hidden) {
   int level = columnInfo.getOutlineLevel();
   while (idx < records.size()) {
     columnInfo.setHidden(hidden);
     if (idx + 1 < records.size()) {
       ColumnInfoRecord nextColumnInfo = (ColumnInfoRecord) records.get(idx + 1);
       if (columnInfo.getLastColumn() + 1 == nextColumnInfo.getFirstColumn()) {
         if (nextColumnInfo.getOutlineLevel() < level) break;
         columnInfo = nextColumnInfo;
       } else {
         break;
       }
     }
     idx++;
   }
   return columnInfo;
 }