Exemple #1
0
 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);
             }
         }
     }
 }
Exemple #2
0
 public virtual void setPropExp(short key, string expStr)
 {
     if (key == 302)
     {
         ExpMap.ExpStr = expStr;
     }
     else
     {
         if (ExpMap.PropEngMap == null)
         {
             ExpMap.PropEngMap = new ShortMap(15);
         }
         ExpParseInfo expInfo = new ExpParseInfo {
             ExpStr = expStr
         };
         ExpMap.PropEngMap.put(key, expInfo);
     }
 }
Exemple #3
0
 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);
     }
 }