1 19 20 package jxl.write.biff; 21 22 import jxl.biff.Type; 23 import jxl.biff.IntegerHelper; 24 import jxl.biff.StringHelper; 25 import jxl.biff.WritableRecordData; 26 27 31 class BoundsheetRecord extends WritableRecordData 32 { 33 36 private boolean hidden; 37 38 41 private boolean chartOnly; 42 43 46 private String name; 47 48 51 private byte[] data; 52 53 58 public BoundsheetRecord(String n) 59 { 60 super(Type.BOUNDSHEET); 61 name = n; 62 hidden = false; 63 chartOnly = false; 64 } 65 66 69 void setHidden() 70 { 71 hidden = true; 72 } 73 74 77 void setChartOnly() 78 { 79 chartOnly = true; 80 } 81 82 87 public byte[] getData() 88 { 89 data = new byte[name.length() * 2 + 8]; 90 91 if (chartOnly) 92 { 93 data[5] = 0x02; 94 } 95 else 96 { 97 data[5] = 0; } 99 100 if (hidden) 101 { 102 data[4] = 0x1; 103 data[5] = 0x0; 104 } 105 106 data[6] = (byte) name.length(); 107 data[7] = 1; 108 StringHelper.getUnicodeBytes(name, data, 8); 109 110 return data; 111 } 112 } 113 114 115 116 117 118 119 120 121 | Popular Tags |