From f1d48204c68c5ff56cc84773be1b37862912dd86 Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 16 Jun 2011 10:30:28 +0000 Subject: [PATCH] --- .../Config/ROFSTLookup.cs | 24 +++++++++++++++++++ .../Config/SectionConfig.cs | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index 73bd9977..0c747804 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -569,6 +569,30 @@ namespace VEPROMS.CSLA.Library } } //rtnstr = rtnstr.Replace("`", @"\'b0"); // convert backquote to degree - left over from DOS days. + rtnstr = ProcessMacros(rtnstr); + return rtnstr; + } + + // + // Takes the ro text value and sees if a macro has been used. If so it will perform the macro + // operation on the substring in the text value + // + // right now the only macro is @HSP(), where every space between the "(" and ")" will be replaced with a hardspace + // + private string ProcessMacros(string str) + { + if( str == null || str == "" ) return str; + string rtnstr = str; + int indx = -1; + while ((indx = rtnstr.ToUpper().IndexOf("@HSP("))>-1) + { + string resstr = rtnstr.Substring(0,indx); + int endHsp = rtnstr.IndexOf(")",indx); + string tmpstr = rtnstr.Substring(indx+5,endHsp-indx-5); + tmpstr = tmpstr.Replace(" ", @"\u160?"); + resstr = resstr + tmpstr; + rtnstr = resstr + rtnstr.Substring(endHsp+1); + } return rtnstr; } diff --git a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs index ea388a4d..98b7c753 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs @@ -178,7 +178,8 @@ namespace VEPROMS.CSLA.Library SectionInfo sectionInfo = SectionInfo.Get(_Section.ItemID); return sectionInfo.LocalFormat; } - return _SectionInfo.LocalFormat; + if (_SectionInfo != null)return _SectionInfo.LocalFormat; + return null; } set {