poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1072093 - /poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java
Date Fri, 18 Feb 2011 18:02:47 GMT
Author: nick
Date: Fri Feb 18 18:02:47 2011
New Revision: 1072093

URL: http://svn.apache.org/viewvc?rev=1072093&view=rev
Log:
Add a unit test that shows bug #48079 no longer applies, and we can resize columns when there
are more than 32767 rows

Modified:
    poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java?rev=1072093&r1=1072092&r2=1072093&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java Fri
Feb 18 18:02:47 2011
@@ -252,4 +252,43 @@ public abstract class BaseTestSheetAutos
         assertTrue(sheet.getColumnWidth(0) > defaulWidth);
     }
 
+    
+    /**
+     * Auto-Sizing a column needs to work when we have rows
+     *  passed the 32767 boundary. See bug #48079
+     */
+    public void testLargeRowNumbers() throws Exception {
+       Workbook workbook = _testDataProvider.createWorkbook();
+       Sheet sheet = workbook.createSheet();
+       
+       Row r0 = sheet.createRow(0);
+       r0.createCell(0).setCellValue("I am ROW 0");
+       Row r200 = sheet.createRow(200);
+       r200.createCell(0).setCellValue("I am ROW 200");
+       
+       // This should work fine
+       sheet.autoSizeColumn(0);
+       
+       // Get close to 32767
+       Row r32765 = sheet.createRow(32765);
+       r32765.createCell(0).setCellValue("Nearly there...");
+       sheet.autoSizeColumn(0);
+       
+       // To it
+       Row r32767 = sheet.createRow(32767);
+       r32767.createCell(0).setCellValue("At the boundary");
+       sheet.autoSizeColumn(0);
+       
+       // And passed it
+       Row r32768 = sheet.createRow(32768);
+       r32768.createCell(0).setCellValue("Passed");
+       Row r32769 = sheet.createRow(32769);
+       r32769.createCell(0).setCellValue("More Passed");
+       sheet.autoSizeColumn(0);
+       
+       // Long way passed
+       Row r60708 = sheet.createRow(60708);
+       r60708.createCell(0).setCellValue("Near the end");
+       sheet.autoSizeColumn(0);
+    }
 }
\ No newline at end of file



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


Mime
View raw message