Description: Boolean specifying whether the GUI should store a backup of the file.
REFERENCE: PG 287 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org) @version 2.0-pre
448449450451452453454455456457458
*/ public void testBackupRecord() { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet(); Workbook workbook = wb.getWorkbook(); BackupRecord record = workbook.getBackupRecord(); assertEquals(0, record.getBackup()); wb.setBackupFlag(true); assertEquals(1, record.getBackup()); }
609610611612613614615616617618619
throws Exception { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet(); Workbook workbook = wb.getWorkbook(); BackupRecord record = workbook.getBackupRecord(); assertEquals(0, record.getBackup()); wb.setBackupFlag(true); assertEquals(1, record.getBackup()); }
1200120112021203120412051206120712081209
/** * creates the Backup record with backup set to 0. (loose the data, who cares) */ private static BackupRecord createBackup() { BackupRecord retval = new BackupRecord(); retval.setBackup(( short ) 0); // by default DONT save backups of files...just loose data return retval; }
1185118611871188118911901191119211931194
872873874875876877878879880881
* @param backupValue true to indicate a backup will be performed. */ public void setBackupFlag(boolean backupValue) { BackupRecord backupRecord = workbook.getBackupRecord(); backupRecord.setBackup(backupValue ? (short) 1 : (short) 0); }
886887888889890891892893894895
* @return the current setting for backups. */ public boolean getBackupFlag() { BackupRecord backupRecord = workbook.getBackupRecord(); return (backupRecord.getBackup() == 0) ? false : true; }
608609610611612613614615616617618
845846847848849850851852853854
859860861862863864865866867868
482483484485486487488489490491492