B2019-171: Use format flag to handle differences between formats for uppercasing of ROs
B2019-171: Add flag to handle differences between formats for uppercasing of ROs
This commit is contained in:
		@@ -180,6 +180,19 @@ namespace VEPROMS.CSLA.Library
 | 
				
			|||||||
							@"\par\par\par ");
 | 
												@"\par\par\par ");
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
								// B2018-041 this logic was moved to fix this bug, but it is needed to keep Braidwood print of Procedure ROs to remain consistent with how it was 
 | 
				
			||||||
 | 
								// before the fix. Replace Hard Hyphens with normal hyphen so the PDF search for hyphens will work properly
 | 
				
			||||||
 | 
								// B2019-171: added a format flag, DoSpaceDashBeforeROResolve, so that this fix for B2018-041 would not affect Braidwood/Byron, RO's that were defined 
 | 
				
			||||||
 | 
								//  as Procedures should not have the text uppercased.
 | 
				
			||||||
 | 
								if (itemInfo.ActiveFormat.PlantFormat.FormatData.ROData.DoSpaceDashBeforeROResolve)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									if (text.Contains(@"\u8209?") && epMode == E_EditPrintMode.Print)
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										// Handle RTF Tokens followed immediately by a hard hyphen
 | 
				
			||||||
 | 
										text = Regex.Replace(text, @"(?<=\\[^\\?' \r\n\t]+)\\u8209\?", " -");
 | 
				
			||||||
 | 
										text = text.Replace(@"\u8209?", "-");
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			// Replace backslash symbol with normal backslash so the PDF search for backslashes will work properly
 | 
								// Replace backslash symbol with normal backslash so the PDF search for backslashes will work properly
 | 
				
			||||||
			if (text.Contains(@"\u9586?") && epMode == E_EditPrintMode.Print)
 | 
								if (text.Contains(@"\u9586?") && epMode == E_EditPrintMode.Print)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
@@ -278,11 +291,16 @@ namespace VEPROMS.CSLA.Library
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
			// B2018-041 moved this logic here from DisplayText() so the it does not defeat the Upcase RO's after Dash logic
 | 
								// B2018-041 moved this logic here from DisplayText() so the it does not defeat the Upcase RO's after Dash logic
 | 
				
			||||||
				// Replace Hard Hyphens with normal hyphen so the PDF search for hyphens will work properly
 | 
									// Replace Hard Hyphens with normal hyphen so the PDF search for hyphens will work properly
 | 
				
			||||||
			if (text.Contains(@"\u8209?") && epMode == E_EditPrintMode.Print)
 | 
								// B2019-171: added a format flag, DoSpaceDashBeforeROResolve, so that this fix for B2018-041 would not affect Braidwood/Byron, RO's that were defined 
 | 
				
			||||||
 | 
								//  as Procedures should not have the text uppercased.
 | 
				
			||||||
 | 
								if (_MyItemInfo == null || !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.DoSpaceDashBeforeROResolve)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				// Handle RTF Tokens followed immediately by a hard hyphen
 | 
									if (text.Contains(@"\u8209?") && epMode == E_EditPrintMode.Print)
 | 
				
			||||||
				text = Regex.Replace(text, @"(?<=\\[^\\?' \r\n\t]+)\\u8209\?", " -");
 | 
									{
 | 
				
			||||||
				text = text.Replace(@"\u8209?", "-");
 | 
										// Handle RTF Tokens followed immediately by a hard hyphen
 | 
				
			||||||
 | 
										text = Regex.Replace(text, @"(?<=\\[^\\?' \r\n\t]+)\\u8209\?", " -");
 | 
				
			||||||
 | 
										text = text.Replace(@"\u8209?", "-");
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			// if in print mode, view mode, or non-active richtextbox do replace words.  Only if in 
 | 
								// 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.
 | 
								// actual edit mode are replace words left as is.
 | 
				
			||||||
@@ -290,6 +308,7 @@ namespace VEPROMS.CSLA.Library
 | 
				
			|||||||
			if (wordsShouldBeReplaced && !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.TurnOffReplaceWords)
 | 
								if (wordsShouldBeReplaced && !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.TurnOffReplaceWords)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				int profileDepth1 = ProfileTimer.Push(">>>> DoReplaceWords2");
 | 
									int profileDepth1 = ProfileTimer.Push(">>>> DoReplaceWords2");
 | 
				
			||||||
 | 
									
 | 
				
			||||||
				text = DoReplaceWords2(text);
 | 
									text = DoReplaceWords2(text);
 | 
				
			||||||
				ProfileTimer.Pop(profileDepth1);
 | 
									ProfileTimer.Pop(profileDepth1);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6830,6 +6830,14 @@ namespace VEPROMS.CSLA.Library
 | 
				
			|||||||
				return LazyLoad(ref _CapFirstLetterInHighRO, "@CapFirstLetterInHighRO");
 | 
									return LazyLoad(ref _CapFirstLetterInHighRO, "@CapFirstLetterInHighRO");
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							private LazyLoad<bool> _DoSpaceDashBeforeROResolve;
 | 
				
			||||||
 | 
							public bool DoSpaceDashBeforeROResolve
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								get
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									return LazyLoad(ref _DoSpaceDashBeforeROResolve, "@DoSpaceDashBeforeROResolve");
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	#endregion
 | 
						#endregion
 | 
				
			||||||
	#endregion
 | 
						#endregion
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user