mirror of https://github.com/apache/poi.git
Fixed compiler warnings / simplified code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@709217 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dc924a57d8
commit
fa430e2851
|
@ -321,39 +321,38 @@ public final class RowRecordsAggregate extends RecordAggregate {
|
||||||
return currentRow-1;
|
return currentRow-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int writeHidden( RowRecord rowRecord, int row, boolean hidden )
|
/**
|
||||||
{
|
* Hide all rows at or below the current outline level
|
||||||
|
* @return index of the <em>next<em> row after the last row that gets hidden
|
||||||
|
*/
|
||||||
|
private int writeHidden(RowRecord pRowRecord, int row) {
|
||||||
|
int rowIx = row;
|
||||||
|
RowRecord rowRecord = pRowRecord;
|
||||||
int level = rowRecord.getOutlineLevel();
|
int level = rowRecord.getOutlineLevel();
|
||||||
while (rowRecord != null && this.getRow(row).getOutlineLevel() >= level)
|
while (rowRecord != null && getRow(rowIx).getOutlineLevel() >= level) {
|
||||||
{
|
rowRecord.setZeroHeight(true);
|
||||||
rowRecord.setZeroHeight( hidden );
|
rowIx++;
|
||||||
row++;
|
rowRecord = getRow(rowIx);
|
||||||
rowRecord = this.getRow( row );
|
|
||||||
}
|
}
|
||||||
return row - 1;
|
return rowIx;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void collapseRow( int rowNumber )
|
public void collapseRow(int rowNumber) {
|
||||||
{
|
|
||||||
|
|
||||||
// Find the start of the group.
|
// Find the start of the group.
|
||||||
int startRow = findStartOfRowOutlineGroup( rowNumber );
|
int startRow = findStartOfRowOutlineGroup(rowNumber);
|
||||||
RowRecord rowRecord = getRow( startRow );
|
RowRecord rowRecord = getRow(startRow);
|
||||||
|
|
||||||
// Hide all the columns until the end of the group
|
// Hide all the columns until the end of the group
|
||||||
int lastRow = writeHidden( rowRecord, startRow, true );
|
int nextRowIx = writeHidden(rowRecord, startRow);
|
||||||
|
|
||||||
|
RowRecord row = getRow(nextRowIx);
|
||||||
|
if (row == null) {
|
||||||
|
row = createRow(nextRowIx);
|
||||||
|
insertRow(row);
|
||||||
|
}
|
||||||
// Write collapse field
|
// Write collapse field
|
||||||
if (getRow(lastRow + 1) != null)
|
row.setColapsed(true);
|
||||||
{
|
|
||||||
getRow(lastRow + 1).setColapsed( true );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RowRecord row = createRow( lastRow + 1);
|
|
||||||
row.setColapsed( true );
|
|
||||||
insertRow( row );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue