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
858859860861862863864865866867
* @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); }
872873874875876877878879880881
* @return the current setting for backups. */ public boolean getBackupFlag() { BackupRecord backupRecord = workbook.getBackupRecord(); return (backupRecord.getBackup() == 0) ? false : true; }
1202120312041205120612071208120912101211
/** * 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; }
582583584585586587588589590591592
throws Exception { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet s = wb.createSheet(); Workbook workbook = wb.getWorkbook(); BackupRecord record = workbook.getBackupRecord(); assertEquals(0, record.getBackup()); wb.setBackupFlag(true); assertEquals(1, record.getBackup()); }
1242124312441245124612471248124912501251
978979980981982983984985986987
99299399499599699799899910001001
448449450451452453454455456457458
*/ public void testBackupRecord() { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet(); InternalWorkbook workbook = wb.getWorkbook(); BackupRecord record = workbook.getBackupRecord(); assertEquals(0, record.getBackup()); wb.setBackupFlag(true); assertEquals(1, record.getBackup()); }
940941942943944945946947948949
954955956957958959960961962963