poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1705844 - in /poi/trunk/src: java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java
Date Tue, 29 Sep 2015 12:26:08 GMT
Author: centic
Date: Tue Sep 29 12:26:08 2015
New Revision: 1705844

URL: http://svn.apache.org/viewvc?rev=1705844&view=rev
Log:
Bug 50319: Make row groups which include row 0 work

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java
    poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java?rev=1705844&r1=1705843&r2=1705844&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java Tue
Sep 29 12:26:08 2015
@@ -293,7 +293,7 @@ public final class RowRecordsAggregate e
 		RowRecord rowRecord = this.getRow( row );
 		int level = rowRecord.getOutlineLevel();
 		int currentRow = row;
-		while (this.getRow( currentRow ) != null) {
+		while (currentRow >= 0 && this.getRow( currentRow ) != null) {
 			rowRecord = this.getRow( currentRow );
 			if (rowRecord.getOutlineLevel() < level) {
 				return currentRow + 1;

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java?rev=1705844&r1=1705843&r2=1705844&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java Tue Sep
29 12:26:08 2015
@@ -1274,4 +1274,18 @@ public abstract class BaseTestBugzillaIs
 
         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();
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message