B2019-172 Logic added to process symbol characters in Section Titles being placed on the Auto Table Of Contents.

This commit is contained in:
John Jenko 2019-11-15 17:30:58 +00:00
parent ead7a40048
commit fd338bdb4a

View File

@ -1407,6 +1407,7 @@ namespace Volian.Print.Library
// logic put in for V.C. Summer who wants to their auto table of contents to print "OPERATOR ACTIONS" (set in the format) instead of "Procedure Steps" // logic put in for V.C. Summer who wants to their auto table of contents to print "OPERATOR ACTIONS" (set in the format) instead of "Procedure Steps"
// - note that Summer didn't want to change the section title because they want transition to say "procedure step" for the section title. 03/08/2016 // - note that Summer didn't want to change the section title because they want transition to say "procedure step" for the section title. 03/08/2016
string tocSecTitle = mySection.FormattedDisplayText;// B2017-019 - process "<u>" in section title string tocSecTitle = mySection.FormattedDisplayText;// B2017-019 - process "<u>" in section title
tocSecTitle= ConvertSpecialChars(tocSecTitle, ii.ActiveFormat.PlantFormat.FormatData); // B2019-172 process symbol characters
if (tocSecTitle.ToUpper() == "PROCEDURE STEPS" && tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle != "") if (tocSecTitle.ToUpper() == "PROCEDURE STEPS" && tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle != "")
tocSecTitle = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle; tocSecTitle = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle;
@ -1566,6 +1567,30 @@ namespace Volian.Print.Library
} }
return yLocation; return yLocation;
} }
// B2019-172 This will add the RTF font commands around the symbol characters
// This was copied for DisplaySearch and modified - added the FormatData parameter
private string ConvertSpecialChars(string str, FormatData fmtData)
{
string rtnVal = str;
rtnVal = rtnVal.Replace("\u00A0", @"\u160?"); //convert \u00A0 to a hard space (\u00A0 shows as a blank in the search text field)
rtnVal = rtnVal.Replace("\n", @"\line "); //B2018-020 SQL content record has "\line " for the hard return
// Bug fix B2014-057
// if we are searching for a symbol character in all procedure sets MyDocVersion is null
// when MyDocVersion is null, get the symbol list directly from the PROMS base format (BaseAll.xml)
if (fmtData != null && fmtData.SymbolList != null)
{
SymbolList sl = fmtData.SymbolList;
if (sl != null)
{
foreach (Symbol sym in sl)
{
string rplace = string.Format(sym.Unicode < 256 ? @"\'{0:X2}" : @"\u{0}?", sym.Unicode); // bug fix B2014-057 we were not including the ? in the replace
rtnVal = rtnVal.Replace(((char)sym.Unicode).ToString(), rplace);
}
}
}
return rtnVal;
}
private void AddTemplateTOCPageCounts(TableOfContentsData tOfC, float yLocation, float yPageStartAdj, float leftMargin, float secPagePos, float height, SectionInfo mySection) private void AddTemplateTOCPageCounts(TableOfContentsData tOfC, float yLocation, float yPageStartAdj, float leftMargin, float secPagePos, float height, SectionInfo mySection)
{ {