Added logic to support ConvertUnderscoreToUnderline flag
This commit is contained in:
parent
9b3e2ea0f7
commit
48df3eeee8
@ -913,7 +913,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
val = val.Replace("\x7F", "\x394"); //delta
|
val = val.Replace("\x7F", "\x394"); //delta
|
||||||
// An X/Y Plot RO type might have text preceding the Plot Commands
|
// An X/Y Plot RO type might have text preceding the Plot Commands
|
||||||
int pstart = val.IndexOf("<<G"); // find the starting Plot Command
|
int pstart = val.IndexOf("<<G"); // find the starting Plot Command
|
||||||
AddPrecedingText(sel, val.Substring(0, pstart),0.0F);// replace the RO token with what's in front of the X/Y Plot
|
// B2017-217 Added logic so that underscores are not converted to underline
|
||||||
|
AddPrecedingText(sel, val.Substring(0, pstart), 0.0F, sect.MyActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertUnderscoreToUnderline);// 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
|
val = val.Substring(pstart); // set val to the start of the plot commands
|
||||||
pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; //@"C:\Temp\XYPlot1.png";
|
pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; //@"C:\Temp\XYPlot1.png";
|
||||||
RectangleF plotRect = CreatePlot(pngFile, val, 600F, FormForPlotGraphics);
|
RectangleF plotRect = CreatePlot(pngFile, val, 600F, FormForPlotGraphics);
|
||||||
@ -966,7 +967,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
//AddInfo("\tRO Found {0} = '{1}'", sel.Text, val);
|
//AddInfo("\tRO Found {0} = '{1}'", sel.Text, val);
|
||||||
// if val is null, then InsertROValue will put in "RO Not Found" for the value
|
// if val is null, then InsertROValue will put in "RO Not Found" for the value
|
||||||
float indent = (float)sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToTextBoundary);
|
float indent = (float)sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToTextBoundary);
|
||||||
InsertROValue(sel, val, sect.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper, indent);
|
// B2017-217 Added logic so that underscores are not converted to underline
|
||||||
|
InsertROValue(sel, val, sect.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper, indent, sect.MyActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertUnderscoreToUnderline);
|
||||||
}
|
}
|
||||||
sel = FindRO();
|
sel = FindRO();
|
||||||
if (sel != null && sel.Start == lastStart)
|
if (sel != null && sel.Start == lastStart)
|
||||||
@ -1127,9 +1129,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return indxClose;
|
return indxClose;
|
||||||
}
|
}
|
||||||
public static void AddPrecedingText(LBSelection sel, string val, float indent)
|
public static void AddPrecedingText(LBSelection sel, string val, float indent, bool convertUnderline)
|
||||||
{
|
{
|
||||||
if (val.IndexOf("_") == -1) // Is some of the text underlined?
|
// B2017-217 Added logic so that underscores are not converted to underline
|
||||||
|
if (!convertUnderline || val.IndexOf("_") == -1) // Is some of the text underlined?
|
||||||
{
|
{
|
||||||
if (val.Contains("\r\n"))
|
if (val.Contains("\r\n"))
|
||||||
{
|
{
|
||||||
@ -1399,7 +1402,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
myFile.Delete();
|
myFile.Delete();
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
private static void InsertROValue(LBSelection sel, string roValue, bool upRoIfPrevUpper, float indent)
|
private static void InsertROValue(LBSelection sel, string roValue, bool upRoIfPrevUpper, float indent, bool convertUnderline)
|
||||||
{
|
{
|
||||||
if (roValue == null)
|
if (roValue == null)
|
||||||
{
|
{
|
||||||
@ -1449,7 +1452,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
roValue = roValue.Replace(@"[XB3]", "\xB3");
|
roValue = roValue.Replace(@"[XB3]", "\xB3");
|
||||||
sel.Text = roValue;
|
sel.Text = roValue;
|
||||||
// look for toggling of '_' to turn underlining on/off:
|
// look for toggling of '_' to turn underlining on/off:
|
||||||
AddPrecedingText(sel, roValue, indent); // parse underlining
|
AddPrecedingText(sel, roValue, indent,convertUnderline); // parse underlining
|
||||||
// B2017-177 Don't print text RO in red
|
// B2017-177 Don't print text RO in red
|
||||||
//sel.Font.Color = LBWdColor.wdColorRed;
|
//sel.Font.Color = LBWdColor.wdColorRed;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user