import org.apache.poi.ss.usermodel.FormulaError;
import org.apache.poi.ss.usermodel.Hyperlink;
import org.apache.poi.ss.usermodel.RichTextString;
+import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.util.Internal;
} else {
int prevNum = row.getLastCellNum();
if(prevNum != -1){
- _cellNum = row.getCell(prevNum-1).getColumnIndex() + 1;
+ _cellNum = row.getCell(prevNum-1, Row.RETURN_NULL_AND_BLANK).getColumnIndex() + 1;
}
}
_sharedStringSource = row.getSheet().getWorkbook().getSharedStringSource();
XSSFTestDataSamples.writeOutAndReadBack(wb);
}
+
+ public void testBug56644ReturnNull() throws IOException {
+ Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56644.xlsx");
+ try {
+ wb.setMissingCellPolicy(Row.RETURN_BLANK_AS_NULL);
+ Sheet sheet = wb.getSheet("samplelist");
+ Row row = sheet.getRow(20);
+ row.createCell(2);
+ } finally {
+ wb.close();
+ }
+ }
+
+ public void testBug56644ReturnBlank() throws IOException {
+ Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56644.xlsx");
+ try {
+ wb.setMissingCellPolicy(Row.RETURN_NULL_AND_BLANK);
+ Sheet sheet = wb.getSheet("samplelist");
+ Row row = sheet.getRow(20);
+ row.createCell(2);
+ } finally {
+ wb.close();
+ }
+ }
+
+ public void testBug56644CreateBlank() throws IOException {
+ Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56644.xlsx");
+ try {
+ wb.setMissingCellPolicy(Row.CREATE_NULL_AS_BLANK);
+ Sheet sheet = wb.getSheet("samplelist");
+ Row row = sheet.getRow(20);
+ row.createCell(2);
+ } finally {
+ wb.close();
+ }
+ }
}