public virtual void replaceMacros(IDictionary macros) { if ((macros != null) && (macros.Count != 0)) { ShortMap propGetMap = ExpMap.PropGetMap; if (propGetMap != null) { object obj2 = propGetMap[302]; if (obj2 is string) { string text = (string)obj2; propGetMap.put(302, MacroCalc.replaceMacros(text, macros)); } } string expStr = ExpMap.ExpStr; if (expStr != null) { ExpMap.ExpStr = MacroCalc.replaceMacros(expStr, macros); } ShortMap propEngMap = ExpMap.PropEngMap; if (propEngMap != null) { for (int i = 0; i < propEngMap.size(); i++) { ExpParseInfo expInfo = (ExpParseInfo)propEngMap.getValue(i); expInfo.ExpStr = MacroCalc.replaceMacros(expInfo.ExpStr, macros); } } } }
public virtual void calcProperties() { ShortMap propEngMap = ExpMap.PropEngMap; if (propEngMap != null) { if (row != null) { row.DataSet.CurrentRow = row; } for (int i = 0; i < propEngMap.size(); i++) { short key = propEngMap.getKey(i); if ((key != 304) && (key != 305)) { var expInfo = (ExpParseInfo)propEngMap.getValue(i); setPropResult(key, ConvertTool.getSingleValue(expInfo.Exp.calculate())); } } } }
public virtual void prepareCalculate() { try { int_4 = 0; if (ExpMap.ExpStr != null) { if (!PropertyDefine.CEX_DEFAULT.Equals(Extensible)) { ExpMap.Exp = new ExpParse(CellSet, ExpMap.ExpStr); // bool flag1 = !PropertyDefine.CEX_HORIZONTAL.Equals(Extensible) ? PropertyDefine.CEX_VERTICAL.Equals(Extensible) : true; } else { ExpMap.Exp = new ExpParse(CellSet, ExpMap.ExpStr, true); CellExt ext = CellSet.getCell(0, 0); if (ExpMap.Exp.Extended) { if ((prevCell == ext) && (nextCell != ext)) { Extensible = PropertyDefine.CEX_HORIZONTAL; } else if ((prevCell != ext) && (nextCell != ext)) { Extensible = PropertyDefine.CEX_NONE; } else { Extensible = PropertyDefine.CEX_VERTICAL; } } } object_1 = originObject; } else { ShortMap propGetMap = ExpMap.PropGetMap; if (propGetMap != null) { object_1 = propGetMap[302]; object obj2 = propGetMap[301]; if (((object_1 != null) && ((obj2 == null) || obj2.Equals(PropertyDefine.CDT_TEXT))) && (object_1 is string)) { object_1 = ConvertTool.parse((string)object_1, false); if (propGetMap[305] == null) { //string s = (string) propGetMap[304]; //if (!StringUtils.isSpaceString(s)) //{ propGetMap.put(305, ConvertTool.format(object_1, "{0}"));//s)); //} } } } } ShortMap propEngMap = ExpMap.PropEngMap; if (propEngMap != null) { for (int i = 0; i < propEngMap.size(); i++) { ExpParseInfo expInfo = (ExpParseInfo)propEngMap.getValue(i); expInfo.Exp = new ExpParse(CellSet, expInfo.ExpStr); } } } catch (ReportError error) { error.CellId = SourceId; throw error; } catch (Exception exception) { throw new ReportError(new StringBuilder("单元格").Append(SourceId).Append("中有错误,").Append(exception.Message).ToString().ToString(), exception); } }
private void method_13(ShortMap shortMap_0, int int_0, int int_1, int int_2, int int_3, int int_4, int int_5) { if (shortMap_0 != null) { for (int i = 0; i < shortMap_0.size(); i++) { int num3; int num5; char ch; short num2 = shortMap_0.getKey(i); string str = (string)method_15(int_0, int_1, num2); if (((str == null) || (str.Trim().Length == 0)) || (str.StartsWith("#REF!") || str.StartsWith("#ERR!"))) { continue; } StringBuilder builder = null; int num6 = str.Length; bool flag = false; int num4 = 0; goto Label_0188; Label_0075: ch = str[num4]; switch (ch) { case '\'': case '"': goto Label_015A; default: if (method_10(ch)) { goto Label_0146; } num3 = method_11(str, num4); num5 = num4; while (num5 < num3) { if (str[num5] == '.') { break; } num5++; } break; } if (!method_9(str, num4, num5)) { if (builder != null) { builder.Append(str.Substring(num4, num5 - num4)); } } else { if (builder == null) { builder = new StringBuilder(64); builder.Append(str.Substring(0, num4)); } if (!method_14(str, num4, num5, int_2, int_3, int_5, int_4, builder)) { goto Label_0193; } } if ((num5 < num3) && (builder != null)) { builder.Append(str.Substring(num5, num3 - num5)); } num4 = num3; goto Label_0188; Label_0146: if (builder != null) { builder.Append(ch); } num4++; goto Label_0188; Label_015A: num3 = ExpString.scanQuotation(str, num4, '\\'); if (num3 < 0) { goto Label_01E0; } if (builder != null) { builder.Append(str.Substring(num4, (num3 + 1) - num4)); } num4 = num3 + 1; Label_0188: if (num4 >= num6) { goto Label_0202; } goto Label_0075; Label_0193: if (_relativeList == null) { _relativeList = new ArrayList(10); } _relativeList.Add(new RelativeFix(int_0, int_1, num2)); method_16(int_0, int_1, num2, "#REF!" + str.ToString().ToString()); flag = true; goto Label_0202; Label_01E0: method_16(int_0, int_1, num2, "#ERR!" + str.ToString().ToString()); flag = true; Label_0202: if (!flag && (builder != null)) { method_16(int_0, int_1, num2, builder.ToString()); } } } }