Bug 50319: Make row groups which include row 0 work

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1705844 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2015-09-29 12:26:08 +00:00
parent b261c978a8
commit 99d33a0330
2 changed files with 15 additions and 1 deletions

View File

@ -293,7 +293,7 @@ public final class RowRecordsAggregate extends RecordAggregate {
RowRecord rowRecord = this.getRow( row ); RowRecord rowRecord = this.getRow( row );
int level = rowRecord.getOutlineLevel(); int level = rowRecord.getOutlineLevel();
int currentRow = row; int currentRow = row;
while (this.getRow( currentRow ) != null) { while (currentRow >= 0 && this.getRow( currentRow ) != null) {
rowRecord = this.getRow( currentRow ); rowRecord = this.getRow( currentRow );
if (rowRecord.getOutlineLevel() < level) { if (rowRecord.getOutlineLevel() < level) {
return currentRow + 1; return currentRow + 1;

View File

@ -1274,4 +1274,18 @@ public abstract class BaseTestBugzillaIssues {
wb.close(); wb.close();
} }
@Test
public void test50319() throws IOException {
Workbook wb = new HSSFWorkbook();
Sheet sheet = wb.createSheet("Test");
sheet.createRow(0);
sheet.groupRow(0, 0);
sheet.setRowGroupCollapsed(0, true);
sheet.groupColumn(0, 0);
sheet.setColumnGroupCollapsed(0, true);
wb.close();
}
} }