From 3dfb222834145e560b21be5dd1be9123a8a73a68 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 23 Apr 2013 15:42:02 +0000 Subject: [PATCH] Added logic to handle cases when and RO value contains an X/Y Plot but with text before the plot language fixed bad indexes - inserting the superscript On/Off commands --- .../VEPROMS.CSLA.Library/Extension/DocumentExt.cs | 14 +++++++++++++- PROMS/XYPlots/XYPlots.cs | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 16ee919f..ce768df8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -723,7 +723,11 @@ namespace VEPROMS.CSLA.Library try { val = val.Replace("`", "\xB0"); - sel.Text = ""; + //sel.Text = ""; + // An X/Y Plot RO type might have text preceding the Plot Commands + int pstart = val.IndexOf("<0) && (idx < sel.Text.Length+1)) + { + idx = sel.Text.IndexOf("\r", idx + 1); + y += (float)sel.ParagraphFormat.LineSpacing; // get_Information(LBWdLineSpacing.wdLineSpaceSingle); + } //LBInlineShape shape = sel.InlineShapes.AddPicture(pngFile); LBRange myRange = sel.Paragraphs.First.Range; float yTop = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage); diff --git a/PROMS/XYPlots/XYPlots.cs b/PROMS/XYPlots/XYPlots.cs index fc6b417b..1c6537f2 100644 --- a/PROMS/XYPlots/XYPlots.cs +++ b/PROMS/XYPlots/XYPlots.cs @@ -915,7 +915,7 @@ namespace XYPlots private int addpower(int i) { int tlen; - powerstring = string.Format("x10{0}{1}{2}", SuperScript[1], i.ToString(), SuperScript[2]); + powerstring = string.Format("x10{0}{1}{2}", SuperScript[0], i.ToString(), SuperScript[1]); valuestring = valuestring + powerstring; tlen = SuperScript[0].Length + SuperScript[1].Length; return (powerstring.Length - tlen);