first commit
This commit is contained in:
commit
4d332ef662
27586 changed files with 3281783 additions and 0 deletions
69
rus/WEB-INF/lib/jxl_src/jxl/biff/DValParser.java
Normal file
69
rus/WEB-INF/lib/jxl_src/jxl/biff/DValParser.java
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
package jxl.biff;
|
||||
|
||||
import jxl.common.Logger;
|
||||
|
||||
public class DValParser {
|
||||
private static Logger logger = Logger.getLogger(DValParser.class);
|
||||
|
||||
private static int PROMPT_BOX_VISIBLE_MASK = 1;
|
||||
|
||||
private static int PROMPT_BOX_AT_CELL_MASK = 2;
|
||||
|
||||
private static int VALIDITY_DATA_CACHED_MASK = 4;
|
||||
|
||||
private boolean promptBoxVisible;
|
||||
|
||||
private boolean promptBoxAtCell;
|
||||
|
||||
private boolean validityDataCached;
|
||||
|
||||
private int numDVRecords;
|
||||
|
||||
private int objectId;
|
||||
|
||||
public DValParser(byte[] data) {
|
||||
int options = IntegerHelper.getInt(data[0], data[1]);
|
||||
this.promptBoxVisible = ((options & PROMPT_BOX_VISIBLE_MASK) != 0);
|
||||
this.promptBoxAtCell = ((options & PROMPT_BOX_AT_CELL_MASK) != 0);
|
||||
this.validityDataCached = ((options & VALIDITY_DATA_CACHED_MASK) != 0);
|
||||
this.objectId = IntegerHelper.getInt(data[10], data[11], data[12], data[13]);
|
||||
this.numDVRecords = IntegerHelper.getInt(data[14], data[15], data[16], data[17]);
|
||||
}
|
||||
|
||||
public DValParser(int objid, int num) {
|
||||
this.objectId = objid;
|
||||
this.numDVRecords = num;
|
||||
this.validityDataCached = true;
|
||||
}
|
||||
|
||||
public byte[] getData() {
|
||||
byte[] data = new byte[18];
|
||||
int options = 0;
|
||||
if (this.promptBoxVisible)
|
||||
options |= PROMPT_BOX_VISIBLE_MASK;
|
||||
if (this.promptBoxAtCell)
|
||||
options |= PROMPT_BOX_AT_CELL_MASK;
|
||||
if (this.validityDataCached)
|
||||
options |= VALIDITY_DATA_CACHED_MASK;
|
||||
IntegerHelper.getTwoBytes(options, data, 0);
|
||||
IntegerHelper.getFourBytes(this.objectId, data, 10);
|
||||
IntegerHelper.getFourBytes(this.numDVRecords, data, 14);
|
||||
return data;
|
||||
}
|
||||
|
||||
public void dvRemoved() {
|
||||
this.numDVRecords--;
|
||||
}
|
||||
|
||||
public int getNumberOfDVRecords() {
|
||||
return this.numDVRecords;
|
||||
}
|
||||
|
||||
public int getObjectId() {
|
||||
return this.objectId;
|
||||
}
|
||||
|
||||
public void dvAdded() {
|
||||
this.numDVRecords++;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue