1 19 20 package jxl.biff; 21 22 import jxl.read.biff.Record; 23 24 27 public class WorkspaceInformationRecord extends WritableRecordData 28 { 29 32 private int wsoptions; 33 34 private static final int fitToPages = 0x100; 36 private static final int defaultOptions = 0x4c1; 37 38 43 public WorkspaceInformationRecord(Record t) 44 { 45 super(t); 46 byte[] data = getRecord().getData(); 47 48 wsoptions = IntegerHelper.getInt(data[0], data[1]); 49 } 50 51 54 public WorkspaceInformationRecord() 55 { 56 super(Type.WSBOOL); 57 wsoptions = defaultOptions; 58 } 59 60 65 public boolean getFitToPages() 66 { 67 return ((wsoptions & fitToPages) != 0); 68 } 69 70 75 public void setFitToPages(boolean b) 76 { 77 wsoptions = b ? wsoptions | fitToPages : 78 wsoptions & ~fitToPages; 79 } 80 81 86 public byte[] getData() 87 { 88 byte[] data = new byte[2]; 89 90 IntegerHelper.getTwoBytes(wsoptions, data, 0); 92 93 return data; 94 } 95 } 96 97 98 99 100 101 102 103 104 105 | Popular Tags |