51 lines
1.3 KiB
Java
51 lines
1.3 KiB
Java
package jxl.read.biff;
|
|
|
|
import jxl.CellType;
|
|
import jxl.LabelCell;
|
|
import jxl.WorkbookSettings;
|
|
import jxl.biff.FormattingRecords;
|
|
import jxl.biff.IntegerHelper;
|
|
import jxl.biff.StringHelper;
|
|
|
|
class LabelRecord extends CellValue implements LabelCell {
|
|
private int length;
|
|
|
|
private String string;
|
|
|
|
private static class Biff7 {
|
|
private Biff7() {}
|
|
}
|
|
|
|
public static Biff7 biff7 = new Biff7();
|
|
|
|
public LabelRecord(Record t, FormattingRecords fr, SheetImpl si, WorkbookSettings ws) {
|
|
super(t, fr, si);
|
|
byte[] data = getRecord().getData();
|
|
this.length = IntegerHelper.getInt(data[6], data[7]);
|
|
if (data[8] == 0) {
|
|
this.string = StringHelper.getString(data, this.length, 9, ws);
|
|
} else {
|
|
this.string = StringHelper.getUnicodeString(data, this.length, 9);
|
|
}
|
|
}
|
|
|
|
public LabelRecord(Record t, FormattingRecords fr, SheetImpl si, WorkbookSettings ws, Biff7 dummy) {
|
|
super(t, fr, si);
|
|
byte[] data = getRecord().getData();
|
|
this.length = IntegerHelper.getInt(data[6], data[7]);
|
|
this.string = StringHelper.getString(data, this.length, 8, ws);
|
|
}
|
|
|
|
public String getString() {
|
|
return this.string;
|
|
}
|
|
|
|
public String getContents() {
|
|
return this.string;
|
|
}
|
|
|
|
public CellType getType() {
|
|
return CellType.LABEL;
|
|
}
|
|
}
|