This commit is contained in:
2010-06-23 18:16:06 +00:00
parent 7108411a49
commit edfc3d71b0
8 changed files with 255 additions and 57 deletions

View File

@@ -827,18 +827,21 @@ namespace PrintMSWord
string tmp = DisplayRO.ConvertFortranFormatToScienctificNotation(roValue);
// Look for superscript or subscript and insert the appropriate commands
Match roMatch = Regex.Match(tmp, @"(.*?)\\(super|sub) (.*?)\\nosupersub ");
//Match roMatch = Regex.Match(tmp, @"(.*?)\\(super|sub) (.*?)\\nosupersub ");
Match roMatch = Regex.Match(tmp, @"(.*?)\\(up3|dn3) (.*?)\\(up0|dn0) ");
if (roMatch.Groups.Count == 4)// Superscript or subscript found
{
sel.Font.Color = LBWdColor.wdColorRed;
while (roMatch.Groups.Count == 4)
{
sel.TypeText(roMatch.Groups[1].Value); // output the text preceeding the super or sub command
sel.Font.Position = roMatch.Groups[2].Value=="super" ? 2 : -2; // Shift the vertical position for super or sub
sel.Font.Position = roMatch.Groups[2].Value == "up3" ? 2 : -2; // Shift the vertical position for super or sub
//sel.Font.Position = roMatch.Groups[2].Value == "super" ? 2 : -2; // Shift the vertical position for super or sub
sel.TypeText(roMatch.Groups[3].Value); // output the superscript or subscript
sel.Font.Position = 0; // restore the vertical position
tmp = tmp.Substring(roMatch.Length); // remove the processed text
roMatch = Regex.Match(tmp, @"(.*?)\\(super|sub) (.*?)\\nosupersub "); // check to see if the text contain another super or sub
//roMatch = Regex.Match(tmp, @"(.*?)\\(super|sub) (.*?)\\nosupersub "); // check to see if the text contain another super or sub
roMatch = Regex.Match(tmp, @"(.*?)\\(up3|dn3) (.*?)\\(up0|dn0) "); // check to see if the text contain another super or sub
}
if(tmp != "")// Add any remaining text
sel.TypeText(tmp);

View File

@@ -446,18 +446,21 @@ namespace PrintMSWord
string tmp = DisplayRO.ConvertFortranFormatToScienctificNotation(roValue);
// Look for superscript or subscript and insert the appropriate commands
Match roMatch = Regex.Match(tmp, @"(.*?)\\(super|sub) (.*?)\\nosupersub ");
//Match roMatch = Regex.Match(tmp, @"(.*?)\\(super|sub) (.*?)\\nosupersub ");
Match roMatch = Regex.Match(tmp, @"(.*?)\\(up3|dn3) (.*?)\\(up0|dn0) ");
if (roMatch.Groups.Count == 4)// Superscript or subscript found
{
sel.Font.Color = LBWdColor.wdColorRed;
while (roMatch.Groups.Count == 4)
{
sel.TypeText(roMatch.Groups[1].Value); // output the text preceeding the super or sub command
sel.Font.Position = roMatch.Groups[2].Value=="super" ? 2 : -2; // Shift the vertical position for super or sub
//sel.Font.Position = roMatch.Groups[2].Value=="super" ? 2 : -2; // Shift the vertical position for super or sub
sel.Font.Position = roMatch.Groups[2].Value == "up3" ? 2 : -2; // Shift the vertical position for super or sub
sel.TypeText(roMatch.Groups[3].Value); // output the superscript or subscript
sel.Font.Position = 0; // restore the vertical position
tmp = tmp.Substring(roMatch.Length); // remove the processed text
roMatch = Regex.Match(tmp, @"(.*?)\\(super|sub) (.*?)\\nosupersub "); // check to see if the text contain another super or sub
//roMatch = Regex.Match(tmp, @"(.*?)\\(super|sub) (.*?)\\nosupersub "); // check to see if the text contain another super or sub
roMatch = Regex.Match(tmp, @"(.*?)\\(up3|dn3) (.*?)\\(up0|dn0) "); // check to see if the text contain another super or sub
}
if(tmp != "")// Add any remaining text
sel.TypeText(tmp);
@@ -540,7 +543,7 @@ namespace PrintMSWord
}
catch (Exception ex)
{
AddInfo("Error==={0:s.ffff}==========>{1} - {2}", DateTime.Now, ex.GetType().Name, ex.Message);
AddInfo("RemovePDFFiles Error==={0:s.ffff}==========>{1} - {2}", DateTime.Now, ex.GetType().Name, ex.Message);
Application.DoEvents();
}
}