Title: Reference 3D Ptg
Description: Defined a cell in extern sheet.
REFERENCE:
This is HSSF only, as it matches the HSSF file format way of referring to the sheet by an extern index. The XSSF equivalent is {@link Ref3DPxg}
108109110111112113114115116117118119120
// all the ptgs give back the right things Ptg[] ptgs = fRecs[0].getParsedExpression(); assertEquals(1, ptgs.length); assertTrue(ptgs[0] instanceof Ref3DPtg); Ref3DPtg ptg = (Ref3DPtg)ptgs[0]; HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.create(stubHSSF); assertEquals("Sheet1!A1", ptg.toFormulaString(book)); // Now check we get the right formula back for // a few sample ones FormulaRecord fr;
706707708709710711712713714715716717
if (ptg instanceof Area3DPtg) { Area3DPtg a3p = (Area3DPtg) ((OperandPtg) ptg).copy(); a3p.setExternSheetIndex(newExtSheetIx); ptgs[i] = a3p; } else if (ptg instanceof Ref3DPtg) { Ref3DPtg r3p = (Ref3DPtg) ((OperandPtg) ptg).copy(); r3p.setExternSheetIndex(newExtSheetIx); ptgs[i] = r3p; } } NameRecord newNameRecord = workbook.createBuiltInName(NameRecord.BUILTIN_FILTER_DB, newSheetIndex+1); newNameRecord.setNameDefinition(ptgs);
244824492450245124522453245424552456245724582459
if (ptg instanceof Area3DPtg) { Area3DPtg a3p = (Area3DPtg) ((OperandPtg) ptg).copy(); a3p.setExternSheetIndex(newExtSheetIx); ptgs[i] = a3p; } else if (ptg instanceof Ref3DPtg) { Ref3DPtg r3p = (Ref3DPtg) ((OperandPtg) ptg).copy(); r3p.setExternSheetIndex(newExtSheetIx); ptgs[i] = r3p; } } NameRecord newNameRecord = createBuiltInName(NameRecord.BUILTIN_FILTER_DB, newSheetIndex+1); newNameRecord.setNameDefinition(ptgs);
160161162163164165166167168
byte ptgSid = in.readByte(); switch(ptgSid) { case AreaPtg.sid: return new AreaPtg(in); case Area3DPtg.sid: return new Area3DPtg(in); case RefPtg.sid: return new RefPtg(in); case Ref3DPtg.sid: return new Ref3DPtg(in); } return null; }
250125022503250425052506250725082509251025112512
239423952396239723982399240024012402240324042405