From 12873d9187afedfdba7447eefab9a3e1f885a887 Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 24 May 2012 14:57:04 +0000 Subject: [PATCH] --- .../VEPROMS.CSLA.Library/Extension/DocumentExt.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index dad16f02..f155ddb5 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -609,7 +609,22 @@ namespace VEPROMS.CSLA.Library { string xyplot = selxy.Text; xyplot = xyplot.Replace("`", "\xB0"); + // The 16bit code must have kept the carriage returns in the word doc, if there + // are carriage returns in the plot language. Count number of carriage return/newlines + // so that they can be added back. + int cnt = 0; + int indxCr = xyplot.IndexOf("\r"); + while (indxCr > 0) + { + cnt++; + indxCr = xyplot.IndexOf("\r", indxCr + 1); + } + // Setting the selected text to "" actually sets it to "\r", thus cnt-- (subtract one + // from cnt since there's already a return in the string. + cnt--; selxy.Text = ""; + if (cnt>0)for (int icnt = 0; icnt < cnt; icnt++) selxy.Text = selxy.Text + "\r"; + string pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; //@"C:\Temp\XYPlot1.png"; RectangleF plotRect = CreatePlot(pngFile, xyplot, 600F, FormForPlotGraphics); //LBShape shape = myDoc.Shapes.AddPicture(@"C:\Temp\XYPlot.png", 0, 0, sel.Range);