1 19 20 package jxl.biff.drawing; 21 22 import common.Logger; 23 import jxl.biff.WritableRecordData; 24 import jxl.biff.Type; 25 import jxl.biff.IntegerHelper; 26 import jxl.read.biff.Record; 27 28 31 public class TextObjectRecord extends WritableRecordData 32 { 33 36 private static Logger logger = Logger.getLogger(TextObjectRecord.class); 37 38 41 private byte[] data; 42 43 46 private int textLength; 47 48 51 TextObjectRecord(String t) 52 { 53 super(Type.TXO); 54 55 textLength = t.length(); 56 } 57 58 63 public TextObjectRecord(Record t) 64 { 65 super(t); 66 data = getRecord().getData(); 67 textLength = IntegerHelper.getInt(data[10], data[11]); 68 } 69 70 75 public TextObjectRecord(byte[] d) 76 { 77 super(Type.TXO); 78 data = d; 79 } 80 81 86 public byte[] getData() 87 { 88 if (data != null) 89 { 90 return data; 91 } 92 93 data = new byte[18]; 94 95 int options = 0; 97 options |= (0x1 << 1); options |= (0x1 << 4); options |= (0x1 << 9); IntegerHelper.getTwoBytes(options, data, 0); 101 102 105 IntegerHelper.getTwoBytes(textLength, data, 10); 107 108 IntegerHelper.getTwoBytes(0x10, data, 12); 110 111 return data; 112 } 113 } 114 115 116 117 118 | Popular Tags |