* Bug 28774: Excel will crash when opening xls-files with images.
*/
public void test28774() {
-
HSSFWorkbook wb = openSample("28774.xls");
assertTrue("no errors reading sample xls", true);
writeOutAndReadBack(wb);
assertTrue("no errors writing sample xls", true);
}
+
+ /**
+ * Had a problem apparently, not sure what as it
+ * works just fine...
+ */
+ public void test44891() throws Exception {
+ HSSFWorkbook wb = openSample("44891.xls");
+ assertTrue("no errors reading sample xls", true);
+ writeOutAndReadBack(wb);
+ assertTrue("no errors writing sample xls", true);
+ }
}
import java.io.File;
import java.io.FileOutputStream;
+import java.util.Iterator;
import java.util.List;
import junit.framework.TestCase;
}
assertEquals(true, cell.getBooleanCellValue());
}
-}
+
+ public void testClassCast_bug44861() throws Exception {
+ HSSFWorkbook wb = HSSFTestDataSamples.
+ openSampleWorkbook("44861.xls");
+
+ // Check direct
+ HSSFFormulaEvaluator.evaluateAllFormulaCells(wb);
+
+ // And via calls
+ int numSheets = wb.getNumberOfSheets();
+ for(int i=0; i<numSheets; i++) {
+ HSSFSheet s = wb.getSheetAt(i);
+ HSSFFormulaEvaluator eval = new HSSFFormulaEvaluator(s,wb);
+
+ for(Iterator rows = s.rowIterator(); rows.hasNext();) {
+ HSSFRow r = (HSSFRow)rows.next();
+ eval.setCurrentRow(r);
+
+ for(Iterator cells = r.cellIterator(); cells.hasNext();) {
+ HSSFCell c = (HSSFCell)cells.next();
+ eval.evaluateFormulaCell(c);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file