From a72f752b604aca8e16cb9da869302738c0bf10b0 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 11 Jan 2012 16:49:29 +0000 Subject: [PATCH] removed converting # and ~ to super/subscript commands in RO values replace # and ~ with super/subscript commands, only done for ROs in Word attachments --- PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs | 5 +++-- PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index 559872cc..c7d24505 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -937,8 +937,9 @@ namespace VEPROMS.CSLA.Library // ([+-]?|\\u8209\?) either an optional single character Plus (+) or Minus (-) or non-breaking dash (\u8209?) // ([0-9]+) a group of at least one digits string retval = Regex.Replace(str, @"([+-]?|\\u8209\?)([0-9]+)[.]([0-9]*?)0*E([+-]?|\\u8209\?)([0-9]+)", new MatchEvaluator(FixFortranNumber)); - retval = Regex.Replace(retval, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript - retval = Regex.Replace(retval, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// DOS Subscript + // don't convert # and ~ to super/subscripts, this is a DOS holdout and is done only for non-procedure step sections + //retval = Regex.Replace(retval, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript + //retval = Regex.Replace(retval, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// DOS Subscript return retval; } private static string FixFortranNumber(Match match) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 5ddae996..d1a9d5d8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -796,6 +796,9 @@ namespace VEPROMS.CSLA.Library //string tmp = DisplayRO.ConvertFortranFormatToScienctificNotation(roValue); string tmp = ROFSTLookup.ConvertFortranFormatToScienctificNotation(roValue); + // Only in Word sections, convert the # to superscripts and ~ to subscrtipts + tmp = Regex.Replace(tmp, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript + tmp = Regex.Replace(tmp, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// DOS Subscript // Look for superscript or subscript and insert the appropriate commands Match roMatch = Regex.Match(tmp, @"(.*?)\\(up2|dn2) (.*?)\\(up0|dn0) "); if (roMatch.Groups.Count == 5)// Superscript or subscript found