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
This commit is contained in:
@@ -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("<<G"); // find the starting Plot Command
|
||||
sel.Text = val.Substring(0, pstart); // replace the RO token with what's in front of the X/Y Plot
|
||||
val = val.Substring(pstart); // set val to the start of the plot commands
|
||||
//float width = 72 * Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) / 12.0F;
|
||||
//float height = 72 * lines / 6.0F;
|
||||
string pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; //@"C:\Temp\XYPlot1.png";
|
||||
@@ -732,6 +736,14 @@ namespace VEPROMS.CSLA.Library
|
||||
float x = (float)sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToPage);
|
||||
|
||||
float y = (float)sel.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage);
|
||||
// if there is regular text before the plot, then count the number of lines
|
||||
// and adjust the y position accordingly
|
||||
int idx = sel.Text.IndexOf("\r");
|
||||
while ((idx>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);
|
||||
|
Reference in New Issue
Block a user