|
|
|
@@ -482,6 +482,7 @@ namespace Volian.Controls.Library
|
|
|
|
|
}
|
|
|
|
|
private string DoTransitionAdjustments(string text, bool boldTran)
|
|
|
|
|
{
|
|
|
|
|
bool undtran = _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.Underline;
|
|
|
|
|
string strippedText = StaticStripRtfCommands(text);
|
|
|
|
|
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v \\u]+)*\\v(\\[^v \\]+)* #Link:(ReferencedObject|Transition[^:]*?):[0-9]* ([0-9]*).*?\[END>");
|
|
|
|
|
MatchCollection matches = Regex.Matches(text, lookFor);
|
|
|
|
@@ -516,10 +517,10 @@ namespace Volian.Controls.Library
|
|
|
|
|
// Use a "\x1" as a token to replace later. Insert the unicode char, whose length is
|
|
|
|
|
// more than 1 character was throwing of the regexp Matches index, so that the resulting
|
|
|
|
|
// string may have been incorrect.
|
|
|
|
|
retstr = beforeTran + (boldTran ? @"\b " : null) + newvalue.Substring(0, indexLastSpace) + "\x1" + newvalue.Substring(indexLastSpace + 1) + (boldTran ? @"\b0" : null) + afterTran;
|
|
|
|
|
retstr = beforeTran + (boldTran ? @"\b " : null) + (undtran ? @"\ul " : null) + newvalue.Substring(0, indexLastSpace) + "\x1" + newvalue.Substring(indexLastSpace + 1) + (undtran ? @"\ulnone " : null) + (boldTran ? @"\b0" : null) + afterTran;
|
|
|
|
|
else
|
|
|
|
|
if (beforeTran.EndsWith(" "))
|
|
|
|
|
retstr = ReplaceLastSpaceWithHardSpace(beforeTran) + (boldTran ? @"\b " : null) + newvalue + (boldTran ? @"\b0" : null) + afterTran;
|
|
|
|
|
retstr = ReplaceLastSpaceWithHardSpace(beforeTran) + (boldTran ? @"\b " : null) + (undtran ? @"\ul " : null) + newvalue + (undtran? @"\ulnone ":null) + (boldTran ? @"\b0" : null) + afterTran;
|
|
|
|
|
else
|
|
|
|
|
Console.Write("");// Don't know where to put the Hard Space
|
|
|
|
|
}
|
|
|
|
@@ -1829,7 +1830,16 @@ namespace Volian.Controls.Library
|
|
|
|
|
with = with.Replace(@"\b ","");
|
|
|
|
|
with = with.Replace(@"\b0 ","");
|
|
|
|
|
}
|
|
|
|
|
if (((_Font.Style & E_Style.Underline) == E_Style.Underline) && with.Contains(@"\ul "))
|
|
|
|
|
bool IsUnderline = (((_Font.Style & E_Style.Underline) == E_Style.Underline) && with.Contains(@"\ul "));
|
|
|
|
|
// handle where replace words replaces a string with 'underline on'string'underline off', for example Point Beach
|
|
|
|
|
// had replaced OR's turning underline off in the middle of a transition, "EOP-0 UNIT 1, RACTORE TRIP OR SAFETY INJECTION".
|
|
|
|
|
if (!IsUnderline)
|
|
|
|
|
{
|
|
|
|
|
int repidxst = text.LastIndexOf(@"\ul ", foundMatch.MyMatch.Index);
|
|
|
|
|
int repidxend = text.IndexOf(@"\ulnone", foundMatch.MyMatch.Index + foundMatch.MyMatch.Length);
|
|
|
|
|
if (repidxst > -1 && repidxend > -1 && repidxst < foundMatch.MyMatch.Index && repidxend > (foundMatch.MyMatch.Index + foundMatch.MyMatch.Length)) IsUnderline = true;
|
|
|
|
|
}
|
|
|
|
|
if (IsUnderline)
|
|
|
|
|
{
|
|
|
|
|
with = with.Replace(@"\ul ", "");
|
|
|
|
|
with = with.Replace(@"\ulnone ", "");
|
|
|
|
|