|
|
|
@@ -258,6 +258,28 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
TextFont = vFont;
|
|
|
|
|
StartText = CreateRtf(colorLinks, text, false, false, false, false, false, false, E_EditPrintMode.Edit);
|
|
|
|
|
}
|
|
|
|
|
// F2021-053: BNPP Alarm - need ability to have super/sub scripts in the text of Alarm Tables (ROs). Added a
|
|
|
|
|
// constructor that allows for passing in a flag to set whether replace words should be done on page list. If doing
|
|
|
|
|
// on page list, the object has a section not a step associated with it.
|
|
|
|
|
private bool _DoReplWordInPageList = false;
|
|
|
|
|
public DisplayText(ItemInfo itemInfo, string text, bool colorLinks, bool dorepl)
|
|
|
|
|
{
|
|
|
|
|
_DoReplWordInPageList = dorepl;
|
|
|
|
|
_FieldToEdit = E_FieldToEdit.Text;
|
|
|
|
|
_MyItemInfo = itemInfo;
|
|
|
|
|
OriginalText = text;
|
|
|
|
|
TextFont = itemInfo.GetItemFont();
|
|
|
|
|
_MyFormat = itemInfo.ActiveFormat;
|
|
|
|
|
|
|
|
|
|
bool wordsShouldBeReplaced = true;
|
|
|
|
|
bool numbersShouldBeFormated = !_MyFormat.PlantFormat.FormatData.SectData.StepSectionData.FortranFormatNumbers;
|
|
|
|
|
int typ = ((int)itemInfo.MyContent.Type) % 10000;
|
|
|
|
|
bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value
|
|
|
|
|
bool underlineAfterDashSpace = (itemInfo.FormatStepData == null) ? false : itemInfo.FormatStepData.UnderlineAfterDashSpace;
|
|
|
|
|
|
|
|
|
|
text = CreateRtf(colorLinks, text, false, wordsShouldBeReplaced, numbersShouldBeFormated, false, ROsShouldBeAdjusted, underlineAfterDashSpace, E_EditPrintMode.Edit);
|
|
|
|
|
StartText = text;
|
|
|
|
|
}
|
|
|
|
|
public DisplayText(ItemInfo itemInfo, string text, bool colorLinks)
|
|
|
|
|
{
|
|
|
|
|
_FieldToEdit = E_FieldToEdit.Text;
|
|
|
|
@@ -272,7 +294,7 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value
|
|
|
|
|
bool underlineAfterDashSpace = (itemInfo.FormatStepData == null) ? false : itemInfo.FormatStepData.UnderlineAfterDashSpace;
|
|
|
|
|
|
|
|
|
|
text = CreateRtf(colorLinks, text, false, wordsShouldBeReplaced, numbersShouldBeFormated, false, ROsShouldBeAdjusted, underlineAfterDashSpace,E_EditPrintMode.Edit);
|
|
|
|
|
text = CreateRtf(colorLinks, text, false, wordsShouldBeReplaced, numbersShouldBeFormated, false, ROsShouldBeAdjusted, underlineAfterDashSpace, E_EditPrintMode.Edit);
|
|
|
|
|
StartText = text;
|
|
|
|
|
// Shearon Harris Tables are Bold
|
|
|
|
|
if (itemInfo.IsTable && (TextFont.Style & E_Style.Bold) == E_Style.Bold)
|
|
|
|
@@ -2036,8 +2058,11 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
private string DoReplaceWords2(string Text)
|
|
|
|
|
{
|
|
|
|
|
if(!ProcessReplaceWords) return Text;
|
|
|
|
|
if (_MyItemInfo.MyContent.Type < 20000) return Text; // for now only replace in steps.
|
|
|
|
|
FoundMatches myMatches = new FoundMatches(Text,_MyItemInfo.FormatStepData.Font,_MyItemInfo);
|
|
|
|
|
// F2021-053: BNPP Alarm - need ability to have super/sub scripts in the text of Alarm Tables (ROs).
|
|
|
|
|
// if doing replace words for Page List items, the current item is not a step, use _DoReplWordInPageList flags this
|
|
|
|
|
if (_MyItemInfo.MyContent.Type < 20000 && !_DoReplWordInPageList) return Text; // for now only replace in steps.
|
|
|
|
|
VE_Font vf = _MyItemInfo.MyContent.Type >= 20000 ? _MyItemInfo.FormatStepData.Font : _MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font;
|
|
|
|
|
FoundMatches myMatches = new FoundMatches(Text,vf,_MyItemInfo);
|
|
|
|
|
// Exclude Link Text from Replace Word process
|
|
|
|
|
myMatches.AddLink(regFindLink, _MyFormat.PlantFormat.FormatData.SectData.ReplaceWordsInROs, _MyItemInfo.MyProcedure.MyDocVersion);
|
|
|
|
|
FormatConfig.ReplaceStrData rsl = _MyFormat.PlantFormat.UCFandOrigReplaceStrData;
|
|
|
|
@@ -2066,7 +2091,7 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
|
// C2021-045 if the BeforeList ReplaceWords flag is set, only do the replace word if the text ends with a colon
|
|
|
|
|
if (replaceit && onlyDoList && !Text.EndsWith(":"))
|
|
|
|
|
replaceit = false; // text does not end with a colon so don't replace this word
|
|
|
|
|
|
|
|
|
|
if (!replaceit && _DoReplWordInPageList) replaceit = true; // F2021-053: Do replace words in page list
|
|
|
|
|
if (replaceit)
|
|
|
|
|
{
|
|
|
|
|
if (!dicReplaceRegex.ContainsKey(rs))
|
|
|
|
|