Added logic to support the UnderlineAfterDashSpace flag
beefed up logic to better handle a Note/Caution off of a High Level Step and off of a High Level RNO (all on the same step)
This commit is contained in:
parent
d4e80da296
commit
b904c19005
@ -136,6 +136,7 @@ namespace Volian.Controls.Library
|
|||||||
int typ = ((int)itemInfo.MyContent.Type) % 10000;
|
int typ = ((int)itemInfo.MyContent.Type) % 10000;
|
||||||
bool tableHasBorder = tableShouldBeOutlined ? itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[typ].Type.IndexOf(@"Borderless") < 0 : false;
|
bool tableHasBorder = tableShouldBeOutlined ? itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[typ].Type.IndexOf(@"Borderless") < 0 : false;
|
||||||
bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value
|
bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value
|
||||||
|
bool underlineAfterDashSpace = (itemInfo.FormatStepData == null) ? false : itemInfo.FormatStepData.UnderlineAfterDashSpace;
|
||||||
if (epMode == E_EditPrintMode.Print && _MyItemInfo.IsStep)
|
if (epMode == E_EditPrintMode.Print && _MyItemInfo.IsStep)
|
||||||
{
|
{
|
||||||
if (_MyItemInfo.FormatStepData.UseSmartTemplate)
|
if (_MyItemInfo.FormatStepData.UseSmartTemplate)
|
||||||
@ -151,7 +152,7 @@ namespace Volian.Controls.Library
|
|||||||
@"\par\par\par ");
|
@"\par\par\par ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
text = CreateRtf(colorLinks, text, tableShouldBeOutlined, wordsShouldBeReplaced, numbersShouldBeFormated, tableHasBorder, ROsShouldBeAdjusted);
|
text = CreateRtf(colorLinks, text, tableShouldBeOutlined, wordsShouldBeReplaced, numbersShouldBeFormated, tableHasBorder, ROsShouldBeAdjusted, underlineAfterDashSpace);
|
||||||
|
|
||||||
StartText = text;
|
StartText = text;
|
||||||
}
|
}
|
||||||
@ -174,7 +175,7 @@ namespace Volian.Controls.Library
|
|||||||
public DisplayText(string text, VE_Font vFont, bool colorLinks)
|
public DisplayText(string text, VE_Font vFont, bool colorLinks)
|
||||||
{
|
{
|
||||||
TextFont = vFont;
|
TextFont = vFont;
|
||||||
StartText = CreateRtf(colorLinks, text, false, false, false, false, false);
|
StartText = CreateRtf(colorLinks, text, false, false, false, false, false, false);
|
||||||
}
|
}
|
||||||
public DisplayText(ItemInfo itemInfo, string text, bool colorLinks)
|
public DisplayText(ItemInfo itemInfo, string text, bool colorLinks)
|
||||||
{
|
{
|
||||||
@ -188,8 +189,9 @@ namespace Volian.Controls.Library
|
|||||||
bool numbersShouldBeFormated = !_MyFormat.PlantFormat.FormatData.SectData.StepSectionData.FortranFormatNumbers;
|
bool numbersShouldBeFormated = !_MyFormat.PlantFormat.FormatData.SectData.StepSectionData.FortranFormatNumbers;
|
||||||
int typ = ((int)itemInfo.MyContent.Type) % 10000;
|
int typ = ((int)itemInfo.MyContent.Type) % 10000;
|
||||||
bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value
|
bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value
|
||||||
|
bool underlineAfterDashSpace = (itemInfo.FormatStepData == null) ? false : itemInfo.FormatStepData.UnderlineAfterDashSpace;
|
||||||
|
|
||||||
text = CreateRtf(colorLinks, text, false, wordsShouldBeReplaced, numbersShouldBeFormated, false, ROsShouldBeAdjusted);
|
text = CreateRtf(colorLinks, text, false, wordsShouldBeReplaced, numbersShouldBeFormated, false, ROsShouldBeAdjusted, underlineAfterDashSpace);
|
||||||
StartText = text;
|
StartText = text;
|
||||||
// Shearon Harris Tables are Bold
|
// Shearon Harris Tables are Bold
|
||||||
if (itemInfo.IsTable && (TextFont.Style & E_Style.Bold) == E_Style.Bold)
|
if (itemInfo.IsTable && (TextFont.Style & E_Style.Bold) == E_Style.Bold)
|
||||||
@ -201,7 +203,12 @@ namespace Volian.Controls.Library
|
|||||||
StartText = Regex.Replace(text, @"(\\viewkind.*?)(?= |\\u[0-9]+?|\\'[0-9A-F])", @"$1\b");
|
StartText = Regex.Replace(text, @"(\\viewkind.*?)(?= |\\u[0-9]+?|\\'[0-9A-F])", @"$1\b");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string CreateRtf(bool colorLinks, string text, bool tableShouldBeOutlined, bool wordsShouldBeReplaced, bool numbersShouldBeFormated, bool tableHasBorder, bool ROsShouldBeAdjusted)
|
private bool InLinkedText(string text, int idx)
|
||||||
|
{
|
||||||
|
int endLink = text.Substring(0,idx).IndexOf(@"\[END>");
|
||||||
|
return (endLink > -1);
|
||||||
|
}
|
||||||
|
private string CreateRtf(bool colorLinks, string text, bool tableShouldBeOutlined, bool wordsShouldBeReplaced, bool numbersShouldBeFormated, bool tableHasBorder, bool ROsShouldBeAdjusted, bool underlineAfterDashSpace)
|
||||||
{
|
{
|
||||||
// Adjust RO display
|
// Adjust RO display
|
||||||
if (ROsShouldBeAdjusted)
|
if (ROsShouldBeAdjusted)
|
||||||
@ -296,9 +303,49 @@ namespace Volian.Controls.Library
|
|||||||
indxsym = NextUnicode(text, indxsym + incrindx);//text.IndexOf(@"\u", indxsym + incrindx);
|
indxsym = NextUnicode(text, indxsym + incrindx);//text.IndexOf(@"\u", indxsym + incrindx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (underlineAfterDashSpace)
|
||||||
|
{
|
||||||
|
MatchCollection mc = Regex.Matches(text, @"\\u8209\?\\f[0-9]+ ");
|
||||||
|
if (mc.Count > 0)
|
||||||
|
{
|
||||||
|
Match m = mc[0];
|
||||||
|
if (!InLinkedText(text, m.Index))
|
||||||
|
{
|
||||||
|
string str1 = text.Substring(0, m.Index + m.Length);
|
||||||
|
string str2 = text.Substring(m.Index + m.Length);
|
||||||
|
string str3 = "";
|
||||||
|
int iTerm = FindUnderlineTerminator(str2);
|
||||||
|
if (iTerm >= 0)
|
||||||
|
{
|
||||||
|
str3 = str2.Substring(iTerm);
|
||||||
|
str2 = str2.Substring(0, iTerm);
|
||||||
|
}
|
||||||
|
str2 = str2.Replace(@"\ulnone ", "");
|
||||||
|
str2 = str2.Replace(@"\ulnone", "");
|
||||||
|
str2 = str2.Replace(@"\ul ", "");
|
||||||
|
str2 = str2.Replace(@"\ul", "");
|
||||||
|
text = str1 + @"\ul " + str2 + @"\ulnone " + str3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
private int FindUnderlineTerminator(string text)
|
||||||
|
{
|
||||||
|
int idx = -1;
|
||||||
|
UnderlineTerminateList utl = _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.UnderlineTerminateList;
|
||||||
|
foreach (UnderlineTerminate ut in utl)
|
||||||
|
{
|
||||||
|
MatchCollection mc = Regex.Matches(text, "(?<!Link|ReferencedObject|Transition|TransitionRange)" + ut.Text);
|
||||||
|
if (mc.Count > 0)
|
||||||
|
{
|
||||||
|
Match m = mc[mc.Count - 1];
|
||||||
|
if (idx < 0 || idx > m.Index)
|
||||||
|
idx = m.Index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
private string DoSearchAndReplace(string text, string find, string replace)
|
private string DoSearchAndReplace(string text, string find, string replace)
|
||||||
{
|
{
|
||||||
return text.Replace(find, replace);
|
return text.Replace(find, replace);
|
||||||
|
@ -1918,7 +1918,10 @@ namespace Volian.Print.Library
|
|||||||
yoff += adj;
|
yoff += adj;
|
||||||
if (MyTab != null) MyTab.YOffset = ChildrenRight[0].YOffset;
|
if (MyTab != null) MyTab.YOffset = ChildrenRight[0].YOffset;
|
||||||
if (PartsRight.Count > 0) PartsRight[0].YOffset = ChildrenRight[0].YOffset;
|
if (PartsRight.Count > 0) PartsRight[0].YOffset = ChildrenRight[0].YOffset;
|
||||||
|
if (ChildrenAbove.Count == 0)
|
||||||
YTopMost = ChildrenRight[0].ChildrenAbove[0].YOffset;
|
YTopMost = ChildrenRight[0].ChildrenAbove[0].YOffset;
|
||||||
|
else
|
||||||
|
YTopMost = ChildrenAbove[0].YOffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Need code to determine if the table will overlap the Right Column if it does then
|
// Need code to determine if the table will overlap the Right Column if it does then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user