public void TestToFormulaString() { Ref3DPtg target = new Ref3DPtg("A1", (short)0); HSSFWorkbook wb = CreateWorkbookWithSheet("my sheet"); HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.Create(wb); Assert.AreEqual("'my sheet'!A1", target.ToFormulaString(book)); wb.SetSheetName(0, "ProfitAndLoss"); Assert.AreEqual("ProfitAndLoss!A1", target.ToFormulaString(book)); wb.SetSheetName(0, "profit+loss"); Assert.AreEqual("'profit+loss'!A1", target.ToFormulaString(book)); }
public MockRefEval(Ref3DPtg ptg, ValueEval value) : base(-1, -1, ptg.Row, ptg.Column) { _value = value; }
/** * * @param sheetIden may be <code>null</code> * @param part1 * @param part2 may be <code>null</code> */ private ParseNode CreateAreaRefParseNode(SheetIdentifier sheetIden, SimpleRangePart part1, SimpleRangePart part2) { int extIx; if (sheetIden == null) { extIx = Int32.MinValue; } else { String sName = sheetIden.SheetID.Name; if (sheetIden.BookName == null) { extIx = _book.GetExternalSheetIndex(sName); } else { extIx = _book.GetExternalSheetIndex(sheetIden.BookName, sName); } } Ptg ptg; if (part2 == null) { CellReference cr = part1.getCellReference(); if (sheetIden == null) { ptg = new RefPtg(cr); } else { ptg = new Ref3DPtg(cr, extIx); } } else { AreaReference areaRef = CreateAreaRef(part1, part2); if (sheetIden == null) { ptg = new AreaPtg(areaRef); } else { ptg = new Area3DPtg(areaRef, extIx); } } return new ParseNode(ptg); }
public LazyRefEval(Ref3DPtg ptg, SheetRefEvaluator sre) : base(ptg.Row, ptg.Column) { _evaluator = sre; }
public ValueEval GetRef3DEval(Ref3DPtg rptg) { SheetRangeEvaluator sre = CreateExternSheetRefEvaluator(rptg.ExternSheetIndex); return new LazyRefEval(rptg.Row, rptg.Column, sre); }