Added TurnOffReplaceWords format flag

Added space after UnderlineOn command when converting.  Fixed the conversion of Top Continue Message, when not defined in 16-bit, set to an empty string so that it is not inherited from the Base format
Added TurnOffReplaceWords flag
Don’t do ReplaceWords if TurnOffReplaceWords is set to true
This commit is contained in:
John Jenko 2013-07-17 15:13:02 +00:00
parent d055adfd11
commit 0eda70c1c8
5 changed files with 27 additions and 4 deletions

View File

@ -1685,6 +1685,18 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _ConvertCaretToDelta, "@ConvertCaretToDelta");
}
}
// This format flag turns off the Replace Words functionality.
// in 16-bit proms, this was done simply by having an empty Replace Words list.
// in 32-bit the inheiradence logic finds a replace words list in the base format
// if the plant format does not have one. Thus the need of this format flag.
private LazyLoad<bool> _TurnOffReplaceWords;
public bool TurnOffReplaceWords
{
get
{
return LazyLoad(ref _TurnOffReplaceWords, "@TurnOffReplaceWords");
}
}
}
#endregion
#region SectionNumber

View File

@ -215,7 +215,8 @@ namespace Volian.Controls.Library
}
// if in print mode, view mode, or non-active richtextbox do replace words. Only if in
// actual edit mode are replace words left as is.
if (wordsShouldBeReplaced)
// But don't do ReplaceWords if the TurnOffReplaceWords format flag is set
if (wordsShouldBeReplaced && !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.TurnOffReplaceWords)
text = DoReplaceWords2(text);
if (_MyItemInfo != null)
{

View File

@ -613,6 +613,7 @@ public struct Section
public string SearchAllReplaceWords;
public string SecTitleContinue;
public string ConvertCaretToDelta;
public string TurnOffReplaceWords;
/* end of Format flags */
public SectionNum SectionNumber;
public SectionHead SectionHeader;
@ -4094,6 +4095,11 @@ namespace fmtxml
if (XtraFlags.CapFirstLetterInHighSP == "True") fmtdata.ROData.CapFirstLetterInHighRO = "True";
else fmtdata.ROData.CapFirstLetterInHighRO = "False";
#endregion
#region New Format Flags
// by default TurnOffReplaceWords should be False.
// this will be overrided as needed (ex. NSP (Prairie Island) Deviations
fmtdata.SectData.TurnOffReplaceWords = "False";
#endregion
return true;
}
@ -4958,6 +4964,7 @@ namespace fmtxml
if (mainFmt.SectData.SearchAllReplaceWords != null && mainFmt.SectData.SearchAllReplaceWords == subFmt.SectData.SearchAllReplaceWords) subFmt.SectData.SearchAllReplaceWords = "null";
if (mainFmt.SectData.SecTitleContinue != null && mainFmt.SectData.SecTitleContinue == subFmt.SectData.SecTitleContinue) subFmt.SectData.SecTitleContinue = "null";
if (mainFmt.SectData.ConvertCaretToDelta != null && mainFmt.SectData.ConvertCaretToDelta == subFmt.SectData.ConvertCaretToDelta) subFmt.SectData.ConvertCaretToDelta = "null";
if (mainFmt.SectData.TurnOffReplaceWords != null && mainFmt.SectData.TurnOffReplaceWords == subFmt.SectData.TurnOffReplaceWords) subFmt.SectData.TurnOffReplaceWords = "null";
if (msctlay.SubPaginationWght == ssctlay.SubPaginationWght) subFmt.SectData.StepSectionData.StpSectLayData.SubPaginationWght = NullInt;
if (msctlay.TextTitleAdjustment == ssctlay.TextTitleAdjustment) subFmt.SectData.StepSectionData.StpSectLayData.TextTitleAdjustment = NullInt;

View File

@ -1056,7 +1056,10 @@ namespace fmtxml
}
dc.DocStructStyle = LoadVE_DocStyle();
if (offst[0] != 0) dc.ContTop = DoReplaceTokens(GetAsciiStringUntilNull(brFmt));
else dc.ContTop = null;
//else dc.ContTop = null;
// in 16-bit a null setting would prevent the Top Continue Message from printing
// we need to set this to a blank string, else it will be inherited from the BASE format(BASEall.xml)
else dc.ContTop = "";
if (offst[1] != 0) dc.ContBottom = DoReplaceTokens(GetAsciiStringUntilNull(brFmt));
else dc.ContBottom = null;
if (offst[2] != 0) dc.EndString = DoReplaceTokens(GetAsciiStringUntilNull(brFmt));
@ -1306,8 +1309,8 @@ namespace fmtxml
wkstr = Regex.Replace(wkstr, @"\x13([^\x13\xd6 ]*?)(?:[\x13\xd6]|(?= )|\Z)(.*?)", @"\b$1\b0$2");
//underline on/off
//wkstr = Regex.Replace(wkstr, @"\x16([^\x16 ]*?)(?:[\x16]|(?= )|\Z)(.*?)", @"\ul$1\ul0$2");
wkstr = Regex.Replace(wkstr, @"\x16([^\x16 ]*?)(?:[\x16]|(?= )|\Z)(.*?)", @"\ul$1\ulnone$2");
//wkstr = Regex.Replace(wkstr, @"\x16([^\x16 ]*?)(?:[\x16]|(?= )|\Z)(.*?)", @"\ul$1\ul0$2");
wkstr = Regex.Replace(wkstr, @"\x16([^\x16 ]*?)(?:[\x16]|(?= )|\Z)(.*?)", @"\ul $1\ulnone $2");
//narrator
wkstr = Regex.Replace(wkstr, @"\x86([^\x86 ]*?)(?:[\x86]|(?= )|\Z)(.*?)", @"\f{Narrator}$1\f0$2");

Binary file not shown.