\r
package org.apache.poi.hssf.record.formula;\r
\r
+import org.apache.poi.ss.util.AreaReference;\r
import org.apache.poi.util.LittleEndianInput;\r
import org.apache.poi.util.LittleEndianOutput;\r
\r
protected Area2DPtgBase(int firstRow, int lastRow, int firstColumn, int lastColumn, boolean firstRowRelative, boolean lastRowRelative, boolean firstColRelative, boolean lastColRelative) {\r
super(firstRow, lastRow, firstColumn, lastColumn, firstRowRelative, lastRowRelative, firstColRelative, lastColRelative);\r
}\r
+ protected Area2DPtgBase(AreaReference ar) {\r
+ super(ar);\r
+ }\r
\r
protected Area2DPtgBase(LittleEndianInput in) {\r
readCoordinates(in);\r
writeCoordinates(out);\r
}\r
\r
- public Area2DPtgBase(String arearef) {\r
- super(arearef);\r
- }\r
-\r
public final int getSize() {\r
return SIZE;\r
}\r
package org.apache.poi.hssf.record.formula;
+import org.apache.poi.hssf.util.AreaReference;
import org.apache.poi.ss.formula.ExternSheetReferenceToken;
import org.apache.poi.ss.formula.FormulaRenderingWorkbook;
import org.apache.poi.ss.formula.WorkbookDependentFormula;
* @author Libin Roman (Vista Portal LDT. Developer)
* @author avik
* @author Jason Height (jheight at chariot dot net dot au)
- * @version 1.0-pre
*/
public final class Area3DPtg extends AreaPtgBase implements WorkbookDependentFormula, ExternSheetReferenceToken {
public final static byte sid = 0x3b;
private int field_1_index_extern_sheet;
- public Area3DPtg( String arearef, int externIdx ) {
- super(arearef);
- setExternSheetIndex( externIdx );
+ public Area3DPtg(String arearef, int externIdx) {
+ super(new AreaReference(arearef));
+ setExternSheetIndex(externIdx);
}
public Area3DPtg(LittleEndianInput in) {
setExternSheetIndex(externalSheetIndex);
}
+ public Area3DPtg(AreaReference arearef, int externIdx) {
+ super(arearef);
+ setExternSheetIndex(externIdx);
+ }
+
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(getClass().getName());
package org.apache.poi.hssf.record.formula;
+import org.apache.poi.ss.util.AreaReference;
import org.apache.poi.util.LittleEndianInput;
/**
super(in);
}
public AreaPtg(String arearef) {
- super(arearef);
+ super(new AreaReference(arearef));
+ }
+ public AreaPtg(AreaReference areaRef) {
+ super(areaRef);
}
protected byte getSid() {
return sid;
// do nothing
}
- protected AreaPtgBase(String arearef) {
- AreaReference ar = new AreaReference(arearef);
+ protected AreaPtgBase(AreaReference ar) {
CellReference firstCell = ar.getFirstCell();
CellReference lastCell = ar.getLastCell();
setFirstRow(firstCell.getRow());
package org.apache.poi.hssf.record.formula;
+import org.apache.poi.ss.util.CellReference;
import org.apache.poi.util.LittleEndianInput;
import org.apache.poi.util.LittleEndianOutput;
abstract class Ref2DPtgBase extends RefPtgBase {
private final static int SIZE = 5;
- /**
- * Takes in a String representation of a cell reference and fills out the
- * numeric fields.
- */
- protected Ref2DPtgBase(String cellref) {
- super(cellref);
- }
protected Ref2DPtgBase(int row, int column, boolean isRowRelative, boolean isColumnRelative) {
setRow(row);
readCoordinates(in);
}
+ protected Ref2DPtgBase(CellReference cr) {
+ super(cr);
+ }
+
public void write(LittleEndianOutput out) {
out.writeByte(getSid() + getPtgClass());
writeCoordinates(out);
* REFERENCE: <P>
* @author Libin Roman (Vista Portal LDT. Developer)
* @author Jason Height (jheight at chariot dot net dot au)
- * @version 1.0-pre
*/
public final class Ref3DPtg extends RefPtgBase implements WorkbookDependentFormula, ExternSheetReferenceToken {
public final static byte sid = 0x3a;
private final static int SIZE = 7; // 6 + 1 for Ptg
private int field_1_index_extern_sheet;
- /** Creates new AreaPtg */
- public Ref3DPtg() {}
public Ref3DPtg(LittleEndianInput in) {
field_1_index_extern_sheet = in.readShort();
}
public Ref3DPtg(String cellref, int externIdx ) {
- CellReference c= new CellReference(cellref);
- setRow(c.getRow());
- setColumn(c.getCol());
- setColRelative(!c.isColAbsolute());
- setRowRelative(!c.isRowAbsolute());
+ this(new CellReference(cellref), externIdx);
+ }
+
+ public Ref3DPtg(CellReference c, int externIdx) {
+ super(c);
setExternSheetIndex(externIdx);
}
return sb.toString();
}
- public void write(LittleEndianOutput out) {
- out.writeByte(sid + getPtgClass());
+ public void write(LittleEndianOutput out) {
+ out.writeByte(sid + getPtgClass());
out.writeShort(getExternSheetIndex());
writeCoordinates(out);
}
\r
package org.apache.poi.hssf.record.formula;\r
\r
+import org.apache.poi.ss.util.CellReference;\r
import org.apache.poi.util.LittleEndianInput;\r
\r
/**\r
* numeric fields.\r
*/\r
public RefPtg(String cellref) {\r
- super(cellref);\r
+ super(new CellReference(cellref));\r
}\r
\r
public RefPtg(int row, int column, boolean isRowRelative, boolean isColumnRelative) {\r
super(in);\r
}\r
\r
+ public RefPtg(CellReference cr) {\r
+ super(cr);\r
+ }\r
+\r
protected byte getSid() {\r
return sid;\r
}\r
package org.apache.poi.hssf.record.formula;
-import org.apache.poi.hssf.util.CellReference;
+import org.apache.poi.ss.util.CellReference;
import org.apache.poi.util.BitField;
import org.apache.poi.util.BitFieldFactory;
import org.apache.poi.util.LittleEndianInput;
// Required for clone methods
}
- /**
- * Takes in a String representation of a cell reference and fills out the
- * numeric fields.
- */
- protected RefPtgBase(String cellref) {
- CellReference c = new CellReference(cellref);
+ protected RefPtgBase(CellReference c) {
setRow(c.getRow());
setColumn(c.getCol());
setColRelative(!c.isColAbsolute());
setRowRelative(!c.isRowAbsolute());
}
- protected RefPtgBase(int row, int column, boolean isRowRelative, boolean isColumnRelative) {
- setRow(row);
- setColumn(column);
- setRowRelative(isRowRelative);
- setColRelative(isColumnRelative);
- }
-
- protected final void readCoordinates(LittleEndianInput in) {
+ protected final void readCoordinates(LittleEndianInput in) {
field_1_row = in.readUShort();
field_2_col = in.readUShort();
}