}
return idx;
}
private void expandColumn(int columnIndex) {
CTCols cols = worksheet.getColsArray(0);
CTCol col = columnHelper.getColumn(columnIndex, false);
int colInfoIx = columnHelper.getIndexOfColumn(cols, col);
int idx = findColInfoIdx((int) col.getMax(), colInfoIx);
if (idx == -1) {
return;
}
// If it is already expanded do nothing.
if (!isColumnGroupCollapsed(idx)) {
return;
}
// Find the start/end of the group.
int startIdx = findStartOfColumnOutlineGroup(idx);
int endIdx = findEndOfColumnOutlineGroup(idx);
// expand:
// colapsed bit must be unset
// hidden bit gets unset _if_ surrounding groups are expanded you can
// determine
// this by looking at the hidden bit of the enclosing group. You will
// have
// to look at the start and the end of the current group to determine
// which
// is the enclosing group
// hidden bit only is altered for this outline level. ie. don't
// uncollapse contained groups
CTCol columnInfo = cols.getColArray(endIdx);
if (!isColumnGroupHiddenByParent(idx)) {
int outlineLevel = columnInfo.getOutlineLevel();
boolean nestedGroup = false;
for (int i = startIdx; i <= endIdx; i++) {
CTCol ci = cols.getColArray(i);
if (outlineLevel == ci.getOutlineLevel()) {
ci.unsetHidden();
if (nestedGroup) {
nestedGroup = false;
ci.setCollapsed(true);