Fixed a bug where the page number was not being resolved in page number transitions to sections that have a hard return.

Better handling of hard returns
This commit is contained in:
2015-08-31 20:47:24 +00:00
parent d79bc6762a
commit 11d58df488
4 changed files with 8 additions and 8 deletions

View File

@@ -621,7 +621,7 @@ namespace VEPROMS.CSLA.Library
string findLink = @"<START\].*?\[END>";
MatchCollection ms = Regex.Matches(Text, findLink);
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\line ?|\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
foreach (Match mm in ms)
{
Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline);

View File

@@ -2337,7 +2337,7 @@ namespace VEPROMS.CSLA.Library
retval = StripLinks(retval);
retval = ReplaceSpecialCharacters(retval);
retval = retval.Replace("\u2011", "-");
retval = retval.Replace(@"\line ", ";");
retval = Regex.Replace(retval, @"\\line ?", ";"); // better handing of hard returns - replace with semi-colon for use on tree view
retval = retval.Replace("\r\n", ";");
retval = retval.Replace("\n", ";"); //added for consistency checking with approved version
return retval;
@@ -2357,8 +2357,8 @@ namespace VEPROMS.CSLA.Library
//retval = Regex.Replace(retval, @"\\nosupersub ?", "");
retval = Regex.Replace(retval, @"\\up[320] ?", "");
retval = Regex.Replace(retval, @"\\dn[320] ?", "");
retval = Regex.Replace(retval, @"\\li[0-9]* ?", "");
retval = Regex.Replace(retval, @"\\fi-[0-9]* ?", "");
retval = Regex.Replace(retval, @"\\li[0-9]+ ?", ""); // changed the * to a + to "\\line " for hard returns part of bug fix B2015-140
retval = Regex.Replace(retval, @"\\fi-[0-9]+ ?", "");
return retval;
}
public static string StripLinks(string rtf)