Description: sheet window settings
REFERENCE: PG 422 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org) @author Jason Height (jheight at chariot dot net dot au) @version 2.0-pre
111311141115111611171118111911201121112211231124112511261127
* headercolor = 0x40 <P> * pagebreakzoom = 0x0 <P> * normalzoom = 0x0 <p> */ private static WindowTwoRecord createWindowTwo() { WindowTwoRecord retval = new WindowTwoRecord(); retval.setOptions(( short ) 0x6b6); retval.setTopRow(( short ) 0); retval.setLeftCol(( short ) 0); retval.setHeaderColor(0x40); retval.setPageBreakZoom(( short ) 0); retval.setNormalZoom(( short ) 0); return retval; }
5051525354555657585960
*/ public void testSharedFormula() { List records = new ArrayList(); records.add( new FormulaRecord() ); records.add( new SharedFormulaRecord() ); records.add(new WindowTwoRecord()); constructValueRecord(records); Iterator iterator = valueRecord.getIterator(); RecordBase record = (RecordBase) iterator.next(); assertNotNull( "Row contains a value", record );
8283848586878889
formulaRecord.setColumn( (short) 1 ); blankRecord.setRow( 2 ); blankRecord.setColumn( (short) 2 ); records.add( formulaRecord ); records.add( blankRecord ); records.add(new WindowTwoRecord()); return records; }
7980818283848586878889909192
assertTrue( sheet.records.get(pos++) instanceof MergedCellsTable ); assertTrue( sheet.records.get(pos++) instanceof EOFRecord ); } private static Record createWindow2Record() { WindowTwoRecord result = new WindowTwoRecord(); result.setOptions(( short ) 0x6b6); result.setTopRow(( short ) 0); result.setLeftCol(( short ) 0); result.setHeaderColor(0x40); result.setPageBreakZoom(( short ) 0); result.setNormalZoom(( short ) 0); return result; }
114811491150115111521153115411551156115711581159116011611162
5758596061626364656667
@SuppressWarnings("deprecation") // uses deprecated {@link ValueRecordsAggregate#getValueRecords()} public void testSharedFormula() { List<Record> records = new ArrayList<Record>(); records.add(new FormulaRecord()); records.add(new SharedFormulaRecord()); records.add(new WindowTwoRecord()); constructValueRecord(records); CellValueRecordInterface[] cvrs = valueRecord.getValueRecords(); //Ensure that the SharedFormulaRecord has been converted assertEquals(1, cvrs.length);
8990919293949596
formulaRecord.setColumn((short) 1); blankRecord.setRow(2); blankRecord.setColumn((short) 2); records.add(formulaRecord); records.add(blankRecord); records.add(new WindowTwoRecord()); return records; }
116311641165116611671168116911701171117211731174117511761177
350351352353354355356357358359
HSSFSheet sheet = new HSSFSheet(workbook); sheets.add(sheet); workbook.setSheetName(sheets.size() - 1, "Sheet" + (sheets.size() - 1)); WindowTwoRecord windowTwo = (WindowTwoRecord) sheet.getSheet().findFirstRecordBySid(WindowTwoRecord.sid); windowTwo.setSelected(sheets.size() == 1); windowTwo.setPaged(sheets.size() == 1); return sheet; }
367368369370371372373374375376377378379
public HSSFSheet cloneSheet(int sheetNum) { HSSFSheet srcSheet = (HSSFSheet)sheets.get(sheetNum); String srcName = workbook.getSheetName(sheetNum); if (srcSheet != null) { HSSFSheet clonedSheet = srcSheet.cloneSheet(workbook); WindowTwoRecord windowTwo = (WindowTwoRecord) clonedSheet.getSheet().findFirstRecordBySid(WindowTwoRecord.sid); windowTwo.setSelected(sheets.size() == 1); windowTwo.setPaged(sheets.size() == 1); sheets.add(clonedSheet); workbook.setSheetName(sheets.size()-1, srcName+"[1]"); return clonedSheet; }