If I clone a sheet and try to get a cell that should contain a formula, I get a null. I'm using the latest CVS version (I needed DrawingRecord.clone() method). Sample code: FileInputStream fis = new FileInputStream("bug.xls"); HSSFWorkbook wb = HSSFWorkbook(fis); HSSFSheet s = wb.cloneSheet(0); HSSFRow r = s.getRow(0); HSSFCell c = r.getCell((short)0); return c; // returns null
Created attachment 15176 [details] Sample Excel file
strange, this is true. Even though both FormulaRecord and FormulaRecordAggregate implement apparently correct clone() method! Testcase added to TestUnfixedBugs. Fix TODO.
Fixed. FormulaRecordAggregates are wrapped in ValueRecordAggregates, which Sheet.clone() did not consider. Thanks for the bug report. Please verify. Testcase removed to TestHSSFSheet :)