From 7e0da06b0593b148508e4928d2154c85fb5f0777 Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 16 Jun 2011 10:18:38 +0000 Subject: [PATCH] --- PROMS/fmtxml/FmtFileToXml.cs | 5614 +++++++++++++++++---------------- PROMS/fmtxml/FmtToXml.cs | 84 +- PROMS/fmtxml/GenXmlToSvg.cs | 16 +- PROMS/fmtxml/TranslateDoc.XSL | 28 +- PROMS/fmtxml/TranslateFMT.XSL | Bin 191884 -> 190136 bytes 5 files changed, 2959 insertions(+), 2783 deletions(-) diff --git a/PROMS/fmtxml/FmtFileToXml.cs b/PROMS/fmtxml/FmtFileToXml.cs index efb6cb9b..272f9f73 100644 --- a/PROMS/fmtxml/FmtFileToXml.cs +++ b/PROMS/fmtxml/FmtFileToXml.cs @@ -419,7 +419,7 @@ public struct GeneralPrint public string AlternateFloatingFoldout; public string SectionLevelFoldouts; public string RevDateWithForwardSlash; - public string SpecialStepsFoldout; + //public string SpecialStepsFoldout; // Added AllowDuplex to eliminate hardcoded check for WEP2 and WPB formats // for the Disable Automatic Duplexing public string AllowDuplex; @@ -595,10 +595,10 @@ public struct Section public string SectForeColor; public string SectBackColor; /* Format Flags moved here... */ - public string CancelSecTitlesOnS1; - public string CancelSecTitlesOnS2; - public string CancelSecTitlesOnE0; - public string CancelSecTitlesOnE2; + //public string CancelSecTitlesOnS1; // moved to docstyle + //public string CancelSecTitlesOnS2; + //public string CancelSecTitlesOnE0; + //public string CancelSecTitlesOnE2; public string MetaSectEndMessage; public string ReadOnlyTypeInContMsg; public string ReplaceWordsInROs; @@ -654,7 +654,7 @@ public struct StepSection public string ContinueSectionHeader; public string CompressHPSub; public string CompressHPSuper; - public string UndSpecialStepsFoldout; + //public string UndSpecialStepsFoldout; public string UnderlineAllMetaTitles; public string BoldOnlySectionZero; public string ImperfectStructure; @@ -1109,275 +1109,275 @@ public enum E_TransFormatXlate : uint /////////////////////////// namespace fmtxml { - public partial class FmtFileToXml - { - #region localdata + public partial class FmtFileToXml + { + #region localdata public XtraFlgs BaseXtraFlags; // used to set up all flags for the Base format. - public XtraFlgs SubXtraFlags; - public static int MAXSTEPS = 47; - public static int MAXBOXES = 12; - public static int MAXTABS = 20; - public static int MAXTRANS = 15; - public static int MAXCHECKOFFS = 18; - public static int MAXCHKHEADINGS = 5; - public static int MAXSEQ = 9; - public static int MAXREPLACE = 60; - #region XtraFlagBits - // XtraFlag translation fields... - // - // XtraFlag[0] from 16-bit... - public static int DOUBLERNOSPACE = 0x0001; - public static int MIXCAUTIONSANDNOTES = 0x0002; - public static int ALWAYSUSEEXTRALINES = 0x0008; - public static int ALWAYSTABNOTE = 0x0010; - public static int ALWAYSTABCAUTION = 0x0020; - public static int SPECIALPAGEBREAKFLAG = 0x0080; - public static int DONTPAGINATEONFIRSTSUBSTEP = 0x0200; - public static int IMPERFECTSTRUCTURE = 0x0800; - public static int DONTUSEHALFLINES = 0x1000; - public static int FORTRANFORMATNUMBERS = 0x2000; - public static int ALLUNITS = 0x4000; - public static int CAPSTRANSITIONS = 0x8000; + public XtraFlgs SubXtraFlags; + public static int MAXSTEPS = 47; + public static int MAXBOXES = 12; + public static int MAXTABS = 20; + public static int MAXTRANS = 15; + public static int MAXCHECKOFFS = 18; + public static int MAXCHKHEADINGS = 5; + public static int MAXSEQ = 9; + public static int MAXREPLACE = 60; + #region XtraFlagBits + // XtraFlag translation fields... + // + // XtraFlag[0] from 16-bit... + public static int DOUBLERNOSPACE = 0x0001; + public static int MIXCAUTIONSANDNOTES = 0x0002; + public static int ALWAYSUSEEXTRALINES = 0x0008; + public static int ALWAYSTABNOTE = 0x0010; + public static int ALWAYSTABCAUTION = 0x0020; + public static int SPECIALPAGEBREAKFLAG = 0x0080; + public static int DONTPAGINATEONFIRSTSUBSTEP = 0x0200; + public static int IMPERFECTSTRUCTURE = 0x0800; + public static int DONTUSEHALFLINES = 0x1000; + public static int FORTRANFORMATNUMBERS = 0x2000; + public static int ALLUNITS = 0x4000; + public static int CAPSTRANSITIONS = 0x8000; - // XtraFlag[1] from 16-bit... - public static int CAPTRANSTEP = 0x0001; - public static int TSTEPNOFLAG = 0x0004; - public static int LOWERCASETRANNUMBER = 0x0008; - public static int CONDENSEDCHANGEBAR = 0x0020; - public static int DOREVDATE = 0x0040; - public static int SEPARATEBOX = 0x0080; - public static int NUMBERHIGHLEVELRNO = 0x0100; - public static int ALTERNATEFOLDOUTPAGES = 0x1000; - public static int DONTTRYTOFILLHALFOFPAGE = 0x8000; + // XtraFlag[1] from 16-bit... + public static int CAPTRANSTEP = 0x0001; + public static int TSTEPNOFLAG = 0x0004; + public static int LOWERCASETRANNUMBER = 0x0008; + public static int CONDENSEDCHANGEBAR = 0x0020; + public static int DOREVDATE = 0x0040; + public static int SEPARATEBOX = 0x0080; + public static int NUMBERHIGHLEVELRNO = 0x0100; + public static int ALTERNATEFOLDOUTPAGES = 0x1000; + public static int DONTTRYTOFILLHALFOFPAGE = 0x8000; - // XtraFlag[2] from 16-bit... - public static int DONTCAPITALIZETITLE = 0x0001; - public static int NOSPACEDOUBLERNO = 0x0004; - public static int DONTOFFSETTAB = 0x0010; - public static int UPSETPNTAFTRDASH = 0x0020; - public static int LOWERCASEREVNUM = 0x0040; - public static int DONOTCOMPRESSSTEPS = 0x0080; - public static int REDUCELINEAFTERNOTEANDCAUT = 0x0100; - public static int RNOSAMELEVEL = 0x0200; - public static int BOLDHIGHLEVELRNO = 0x2000; - public static int ONELINEBEFORENOTECAUTIONTAB = 0x4000; - public static int CONTINUOUSCHANGEBARS = 0x8000; + // XtraFlag[2] from 16-bit... + public static int DONTCAPITALIZETITLE = 0x0001; + public static int NOSPACEDOUBLERNO = 0x0004; + public static int DONTOFFSETTAB = 0x0010; + public static int UPSETPNTAFTRDASH = 0x0020; + public static int LOWERCASEREVNUM = 0x0040; + public static int DONOTCOMPRESSSTEPS = 0x0080; + public static int REDUCELINEAFTERNOTEANDCAUT = 0x0100; + public static int RNOSAMELEVEL = 0x0200; + public static int BOLDHIGHLEVELRNO = 0x2000; + public static int ONELINEBEFORENOTECAUTIONTAB = 0x4000; + public static int CONTINUOUSCHANGEBARS = 0x8000; - // XtraFlag[3] from 16-bit... - //public static int CHECKOFFONALLSTEPS = 0x0004; - public static int DONTBOXAC = 0x0020; - public static int USETOPCONTINUEMESSAGEATEND = 0x0080; - public static int UPCASETRANAND = 0x2000; - public static int UPCASEALLSETPOINTUNITS = 0x4000; + // XtraFlag[3] from 16-bit... + //public static int CHECKOFFONALLSTEPS = 0x0004; + public static int DONTBOXAC = 0x0020; + public static int USETOPCONTINUEMESSAGEATEND = 0x0080; + public static int UPCASETRANAND = 0x2000; + public static int UPCASEALLSETPOINTUNITS = 0x4000; - // XtraFlag[4] from 16-bit... - public static int DEV_FORMAT = 0x0001; - public static int DONTDOSTEXTRAATTOP = 0x0004; - public static int XLINES_STEPFIX = 0x0008; - public static int REBOXCAUTNOTE = 0x0010; - public static int IMMSTEPSPCHDR = 0x0020; - public static int FLOATINGCONTINUEMESSAGE = 0x0080; - public static int ABSOLUTEFIXEDCHANGECOLUMN = 0x0200; - public static int LJBORDERLESSTABLE = 0x0800; - public static int SUPPRESSANDINTRAN = 0x1000; - public static int CAPHIGHSETPNT = 0x2000; + // XtraFlag[4] from 16-bit... + public static int DEV_FORMAT = 0x0001; + public static int DONTDOSTEXTRAATTOP = 0x0004; + public static int XLINES_STEPFIX = 0x0008; + public static int REBOXCAUTNOTE = 0x0010; + public static int IMMSTEPSPCHDR = 0x0020; + public static int FLOATINGCONTINUEMESSAGE = 0x0080; + public static int ABSOLUTEFIXEDCHANGECOLUMN = 0x0200; + public static int LJBORDERLESSTABLE = 0x0800; + public static int SUPPRESSANDINTRAN = 0x1000; + public static int CAPHIGHSETPNT = 0x2000; public static int CAPFIRSTLETTERINHIGHSP = 0x4000; - public static int CAPSPIFLASTLOWER = 0x8000; + public static int CAPSPIFLASTLOWER = 0x8000; - // XtraFlag[5] from 16-bit... - public static int ALTERNATEFLOATINGFOLDOUT = 0x0001; - public static int WRAPSAMEASEDIT = 0x0002; - public static int KEEPSTEPSONPAGE = 0x0004; - public static int SPECIFIEDSUBSTEPSONLY = 0x0008; - public static int THREEBLANKSABOVENOTESCAUTIONS = 0x0010; - public static int IMPERFECTSUBSTEP = 0x0040; - public static int DONTBREAKONSECTIONS = 0x0080; - public static int NOSTEPNUMIFONLYONESTEP = 0x0100; - public static int SHOWSECTIONTITLES = 0x0200; - public static int LJTABS = 0x0400; - public static int DONTNUMBERRNOSUBS = 0x0800; - public static int DROPCHECKOFF = 0x4000; - public static int NOCHECKOFFSINRNO = 0x8000; + // XtraFlag[5] from 16-bit... + public static int ALTERNATEFLOATINGFOLDOUT = 0x0001; + public static int WRAPSAMEASEDIT = 0x0002; + public static int KEEPSTEPSONPAGE = 0x0004; + public static int SPECIFIEDSUBSTEPSONLY = 0x0008; + public static int THREEBLANKSABOVENOTESCAUTIONS = 0x0010; + public static int IMPERFECTSUBSTEP = 0x0040; + public static int DONTBREAKONSECTIONS = 0x0080; + public static int NOSTEPNUMIFONLYONESTEP = 0x0100; + public static int SHOWSECTIONTITLES = 0x0200; + public static int LJTABS = 0x0400; + public static int DONTNUMBERRNOSUBS = 0x0800; + public static int DROPCHECKOFF = 0x4000; + public static int NOCHECKOFFSINRNO = 0x8000; - // XtraFlag[6] from 16-bit... + // XtraFlag[6] from 16-bit... - public static int CHGBARMESSAGEFROMEDIT = 0x0001; - public static int CHANGEBARTORNOSEP = 0X0002; + public static int CHGBARMESSAGEFROMEDIT = 0x0001; + public static int CHANGEBARTORNOSEP = 0X0002; public static int CHGSTYLEPERSECTION = 0x0008; - public static int SECTIONLEVELFOLDOUTS = 0x0010; + public static int SECTIONLEVELFOLDOUTS = 0x0010; public static int BOXCONTACTIONS = 0x0020; - public static int DOSECTIONTRANS = 0x0040; - public static int UPSPIFPREVUPPER = 0x0100; - public static int CONTINUESECTIONHEADER = 0x0200; - public static int GLOBALPROCINFO = 0x0400; - public static int COMPRESSHPSUB = 0x0800; - public static int BULLETONCONTINUOUS = 0x1000; - public static int CANCELSECTITLESONS2 = 0x2000; - public static int NOENDFORSINGLE = 0x4000; - public static int USEMETASECTIONS = 0x8000; + public static int DOSECTIONTRANS = 0x0040; + public static int UPSPIFPREVUPPER = 0x0100; + public static int CONTINUESECTIONHEADER = 0x0200; + public static int GLOBALPROCINFO = 0x0400; + public static int COMPRESSHPSUB = 0x0800; + public static int BULLETONCONTINUOUS = 0x1000; + public static int CANCELSECTITLESONS2 = 0x2000; + public static int NOENDFORSINGLE = 0x4000; + public static int USEMETASECTIONS = 0x8000; - // XtraFlag[7] from 16-bit... + // XtraFlag[7] from 16-bit... - public static int RNOCONTINUEONLY = 0x0001; - public static int CAP1STCHARTRANS = 0x0002; - public static int DONTPAGINATEONFIRSTSUBSTEP3X = 0x0004; - public static int RNOSEPAFTERAER = 0x0008; - public static int REVDATEWITHFORWARDSLASH = 0x0010; - public static int USEALTERNATESTEPBOX = 0x0040; - public static int CANCELSECTITLESONS1 = 0x0080; - public static int SPECIALSTEPSFOLDOUT = 0x0100; - public static int UNDERLINEAFTERDASHSPACE = 0x0200; - public static int NOSPACEINNOTEORCAUTION = 0x0400; - public static int USEXTRAREVNUMBER = 0x0800; - public static int UNDERLINESETPOINTS = 0x1000; - public static int DOSECTIONTRANSTYPEB = 0x2000; - public static int PAGINATEONLOWERSTEPLEVEL = 0x4000; - public static int USETRANSITIONMODIFIER = 0x8000; + public static int RNOCONTINUEONLY = 0x0001; + public static int CAP1STCHARTRANS = 0x0002; + public static int DONTPAGINATEONFIRSTSUBSTEP3X = 0x0004; + public static int RNOSEPAFTERAER = 0x0008; + public static int REVDATEWITHFORWARDSLASH = 0x0010; + public static int USEALTERNATESTEPBOX = 0x0040; + public static int CANCELSECTITLESONS1 = 0x0080; + public static int SPECIALSTEPSFOLDOUT = 0x0100; + public static int UNDERLINEAFTERDASHSPACE = 0x0200; + public static int NOSPACEINNOTEORCAUTION = 0x0400; + public static int USEXTRAREVNUMBER = 0x0800; + public static int UNDERLINESETPOINTS = 0x1000; + public static int DOSECTIONTRANSTYPEB = 0x2000; + public static int PAGINATEONLOWERSTEPLEVEL = 0x4000; + public static int USETRANSITIONMODIFIER = 0x8000; - // XtraFlag[8] from 16-bit... + // XtraFlag[8] from 16-bit... - public static int CUSTOMSPACING = 0x0001; - public static int ENHANCEDSHORTFORMDEV = 0x0002; - public static int PAGEBREAKONHIGHLEVELSTEP = 0x0010; - public static int PAGEBREAKONCAUTIONS = 0X0040; - public static int PAGEBREAKONNOTES = 0X0080; - public static int ALIGNNULLTABWSECTHEAD = 0X0100; - public static int DONTUSESECTITLES = 0x0200; - public static int TEXTSUBFOLLOWSTEXTSTYLE = 0x0400; - public static int TRANSPROCTITLEINPAREN = 0x0800; - public static int HARDSPTRANPROCNUMB = 0x1000; - public static int TREATANDORASSEQUENTIAL = 0x2000; - public static int DONTSPLITSTEPINPRNTSTEP = 0x4000; - public static int LINEABOVEUNDERSECTION = 0x8000; + public static int CUSTOMSPACING = 0x0001; + public static int ENHANCEDSHORTFORMDEV = 0x0002; + public static int PAGEBREAKONHIGHLEVELSTEP = 0x0010; + public static int PAGEBREAKONCAUTIONS = 0X0040; + public static int PAGEBREAKONNOTES = 0X0080; + public static int ALIGNNULLTABWSECTHEAD = 0X0100; + public static int DONTUSESECTITLES = 0x0200; + public static int TEXTSUBFOLLOWSTEXTSTYLE = 0x0400; + public static int TRANSPROCTITLEINPAREN = 0x0800; + public static int HARDSPTRANPROCNUMB = 0x1000; + public static int TREATANDORASSEQUENTIAL = 0x2000; + public static int DONTSPLITSTEPINPRNTSTEP = 0x4000; + public static int LINEABOVEUNDERSECTION = 0x8000; - // XtraFlag[9] from 16-bit... + // XtraFlag[9] from 16-bit... - public static int PICAIGNOREFIVESIXTHS = 0x0004; - public static int SPACEFORNOSECNUMB = 0x0008; - public static int NONEDITABLESTEPS = 0x0010; - public static int BOXEDSUBSTEPS = 0x0020; - public static int DONTNUMBERHIGHLEVELSTEPS = 0x0040; - public static int NOSTEPNUMBERFORHIGHLEVELRNO = 0x0400; - public static int PROMPTFORCAUTINTYPE = 0x0800; - public static int CAUTION1SAMEROWASPARENT = 0x1000; - public static int WOLFCREEKBACKGROUNDFORMAT = 0x4000; - public static int ENHANCEDSTEPNUMFROMPREV = 0x8000; + public static int PICAIGNOREFIVESIXTHS = 0x0004; + public static int SPACEFORNOSECNUMB = 0x0008; + public static int NONEDITABLESTEPS = 0x0010; + public static int BOXEDSUBSTEPS = 0x0020; + public static int DONTNUMBERHIGHLEVELSTEPS = 0x0040; + public static int NOSTEPNUMBERFORHIGHLEVELRNO = 0x0400; + public static int PROMPTFORCAUTINTYPE = 0x0800; + public static int CAUTION1SAMEROWASPARENT = 0x1000; + public static int WOLFCREEKBACKGROUNDFORMAT = 0x4000; + public static int ENHANCEDSTEPNUMFROMPREV = 0x8000; - // XtraFlag[10] from 16-bit... + // XtraFlag[10] from 16-bit... - public static int CONTROLUNDERLINESTYLE = 0x0001; - public static int MULTIPLECHANGEIDS = 0x0008; - public static int USEMULTILINESECTIONTITLE = 0x0010; - public static int PAGEBREAKONFIRSTBLANKLINE = 0x0040; - public static int DONTPRINTNOTITLE = 0x0080; - public static int UNDSPECIALSTEPSFOLDOUT = 0x0800; - public static int PUTONPAGEBYITSELF = 0x4000; + public static int CONTROLUNDERLINESTYLE = 0x0001; + public static int MULTIPLECHANGEIDS = 0x0008; + public static int USEMULTILINESECTIONTITLE = 0x0010; + public static int PAGEBREAKONFIRSTBLANKLINE = 0x0040; + public static int DONTPRINTNOTITLE = 0x0080; + public static int UNDSPECIALSTEPSFOLDOUT = 0x0800; + public static int PUTONPAGEBYITSELF = 0x4000; - // XtraFlag[11] from 16-bit... + // XtraFlag[11] from 16-bit... - public static int SECTITLECONTINUE = 0x0001; - public static int CANCELSECTITLESONE0 = 0x0002; - public static int METASECTENDMESSAGE = 0x0004; - public static int CANCELSECTITLESONE2 = 0x0040; - public static int COMPRESSHPSUPER = 0x2000; + public static int SECTITLECONTINUE = 0x0001; + public static int CANCELSECTITLESONE0 = 0x0002; + public static int METASECTENDMESSAGE = 0x0004; + public static int CANCELSECTITLESONE2 = 0x0040; + public static int COMPRESSHPSUPER = 0x2000; - // XtraFlag[12] from 16-bit... + // XtraFlag[12] from 16-bit... - public static int MATCHUPRNOCAUTNOTE = 0x0001; - public static int PAGINATEATHIGHESTPAGINLEVEL = 0x0008; - public static int USELONGPROCTITLES = 0x0100; - public static int SPECIALLANDSCAPEMODE = 0x1000; - public static int RNOINPAGELIST = 0x2000; - public static int STPCAUTNOTETABINPAGELIST = 0x4000; - public static int READONLYTYPEINCONTMSG = 0x8000; + public static int MATCHUPRNOCAUTNOTE = 0x0001; + public static int PAGINATEATHIGHESTPAGINLEVEL = 0x0008; + public static int USELONGPROCTITLES = 0x0100; + public static int SPECIALLANDSCAPEMODE = 0x1000; + public static int RNOINPAGELIST = 0x2000; + public static int STPCAUTNOTETABINPAGELIST = 0x4000; + public static int READONLYTYPEINCONTMSG = 0x8000; - // XtraFlag[13] from 16-bit... + // XtraFlag[13] from 16-bit... - public static int CENTERONELINEONLY = 0X0001; - public static int TIETABTOLEVEL = 0x0002; - public static int ACCESSORYDOCSINDUPLEX = 0x0008; - public static int FOLDOUTSINDUPLEX = 0x0010; - public static int USESTEXTRAREALVALUE = 0x0040; - public static int SUBTABLEGETSUP1LEVEL = 0x0080; - public static int DONTCOUNTFOLDOUTPAGES = 0x0200; - public static int SEARCHALLREPLACEWORDS = 0x1000; + public static int CENTERONELINEONLY = 0X0001; + public static int TIETABTOLEVEL = 0x0002; + public static int ACCESSORYDOCSINDUPLEX = 0x0008; + public static int FOLDOUTSINDUPLEX = 0x0010; + public static int USESTEXTRAREALVALUE = 0x0040; + public static int SUBTABLEGETSUP1LEVEL = 0x0080; + public static int DONTCOUNTFOLDOUTPAGES = 0x0200; + public static int SEARCHALLREPLACEWORDS = 0x1000; - // XtraFlag[14] from 16-bit... + // XtraFlag[14] from 16-bit... - public static int REMEMBERCAUTIONSANDNOTES = 0x0001; - public static int RTFADJUSTMENTS = 0x0008; - public static int CENTERONELINEADJUST = 0x0010; - public static int COUNTALLSUBLEVELS = 0x0020; - public static int DONTREPLACEWORDSINROS = 0x0080; - public static int HIGHLEVELRNOBEFOREAERSUBSTPS = 0x0100; - public static int UNDERLINEALLMETATITLES = 0x0200; - public static int DONTBREAKCAUTIONSORNOTES = 0x0400; - public static int BOLDONLYSECTIONZERO = 0x0800; - public static int DONTBREAKONRNO = 0x1000; - public static int RNOCHECKOFFSAMEASPARENT = 0x2000; - public static int USESTEPTYPEWIDTHOVERRRIDE = 0x4000; - public static int WOLFCREEKCKLFORMAT = 0x8000; + public static int REMEMBERCAUTIONSANDNOTES = 0x0001; + public static int RTFADJUSTMENTS = 0x0008; + public static int CENTERONELINEADJUST = 0x0010; + public static int COUNTALLSUBLEVELS = 0x0020; + public static int DONTREPLACEWORDSINROS = 0x0080; + public static int HIGHLEVELRNOBEFOREAERSUBSTPS = 0x0100; + public static int UNDERLINEALLMETATITLES = 0x0200; + public static int DONTBREAKCAUTIONSORNOTES = 0x0400; + public static int BOLDONLYSECTIONZERO = 0x0800; + public static int DONTBREAKONRNO = 0x1000; + public static int RNOCHECKOFFSAMEASPARENT = 0x2000; + public static int USESTEPTYPEWIDTHOVERRRIDE = 0x4000; + public static int WOLFCREEKCKLFORMAT = 0x8000; - // XtraFlag[15] from 16-bit... + // XtraFlag[15] from 16-bit... - public static int DONTPAGINATEONFIRSTSUBSTEP2X = 0x0001; - public static int USESTEPTYPEWIDTHOVERRRIDEEDITPRINT = 0x0002; - public static int PARTIALSTEPCOMPRESSION = 0x0004; - public static int USESMARTTEMPLATE = 0x0008; - public static int CHECKOFFONHLSONLY = 0x0010; - public static int CAUTION2SAMEROWASPARENT = 0x0080; - public static int CENTERTEXTWITHINWIDTH = 0x0200; - public static int DONTBREAKEQUIPMENTLIST = 0x0400; - public static int ALWAYSTABCAUTION2 = 0x1000; - public static int VIRTUALDOTINHLSTAB = 0x2000; - public static int IMPERFECTSTRUCTUREPLUS4 = 0x4000; + public static int DONTPAGINATEONFIRSTSUBSTEP2X = 0x0001; + public static int USESTEPTYPEWIDTHOVERRRIDEEDITPRINT = 0x0002; + public static int PARTIALSTEPCOMPRESSION = 0x0004; + public static int USESMARTTEMPLATE = 0x0008; + public static int CHECKOFFONHLSONLY = 0x0010; + public static int CAUTION2SAMEROWASPARENT = 0x0080; + public static int CENTERTEXTWITHINWIDTH = 0x0200; + public static int DONTBREAKEQUIPMENTLIST = 0x0400; + public static int ALWAYSTABCAUTION2 = 0x1000; + public static int VIRTUALDOTINHLSTAB = 0x2000; + public static int IMPERFECTSTRUCTUREPLUS4 = 0x4000; - // XtraFlag[16] from 16-bit... + // XtraFlag[16] from 16-bit... - public static int USERNOTYPEINACTABLE = 0x0002; - public static int ABSOLUTETRANSITIONUPDATE = 0x0004; - public static int SEPARATEBOXCAUTIONS = 0x0008; - public static int HLSTEXTINPAGELIST = 0x0020; - public static int LOWERCASESTEPINTRAN = 0x0080; - public static int CHANGEBARSONLINKEDTEXT = 0X1000; - public static int QUOTEDSUBSTEPS = 0x2000; + public static int USERNOTYPEINACTABLE = 0x0002; + public static int ABSOLUTETRANSITIONUPDATE = 0x0004; + public static int SEPARATEBOXCAUTIONS = 0x0008; + public static int HLSTEXTINPAGELIST = 0x0020; + public static int LOWERCASESTEPINTRAN = 0x0080; + public static int CHANGEBARSONLINKEDTEXT = 0X1000; + public static int QUOTEDSUBSTEPS = 0x2000; - // XtraFlag[17] from 16-bit... + // XtraFlag[17] from 16-bit... - public static int OVERRIDEENHANCEDTABS = 0x0008; - public static int NONEWLINEAFTERRNO = 0x0020; - public static int DOSECTIONSEPARATORLINE = 0x0040; - public static int PARENSONEXTPAGENUMTRANS = 0x0080; - public static int ATLEASTTWODIGITSFORHLS = 0x0100; - public static int DONTBREAKOPTEQUIPMENTLIST = 0x0200; - public static int PAGELISTCHANGEIDSWITHCOMMAS = 0x0400; - public static int DONTSTARTLINEWITHDASH = 0x0800; - public static int NOBLANKLINEBEFORESUBSTEP = 0x1000; + public static int OVERRIDEENHANCEDTABS = 0x0008; + public static int NONEWLINEAFTERRNO = 0x0020; + public static int DOSECTIONSEPARATORLINE = 0x0040; + public static int PARENSONEXTPAGENUMTRANS = 0x0080; + public static int ATLEASTTWODIGITSFORHLS = 0x0100; + public static int DONTBREAKOPTEQUIPMENTLIST = 0x0200; + public static int PAGELISTCHANGEIDSWITHCOMMAS = 0x0400; + public static int DONTSTARTLINEWITHDASH = 0x0800; + public static int NOBLANKLINEBEFORESUBSTEP = 0x1000; public static int DONTBREAKCAUTIONSNOTESONSUBSTPS = 0x2000; public static int DONTCONVERTCARETTODELTA = 0x4000; - // XtraFlag[18] (was VEAIRFLAG) from 16-bit... - public static int NORNO = 0x0002; - public static int ONLYSINGLECOLUMN = 0x0008; - public static int XCHNGTRANSPFORHARD = 0x0020; - public static int WOLFCREEKCKLBACKGNDFORMAT = 0x0040; - #endregion - // use the following to define which step the AlternateStepType data is associated with. - // i.e. look in new.def to determine the #defines for the original step type associated - // with the name of the define. Note that all have been incremented by 1 since these are + // XtraFlag[18] (was VEAIRFLAG) from 16-bit... + public static int NORNO = 0x0002; + public static int ONLYSINGLECOLUMN = 0x0008; + public static int XCHNGTRANSPFORHARD = 0x0020; + public static int WOLFCREEKCKLBACKGNDFORMAT = 0x0040; + #endregion + // use the following to define which step the AlternateStepType data is associated with. + // i.e. look in new.def to determine the #defines for the original step type associated + // with the name of the define. Note that all have been incremented by 1 since these are // indices into the step list and we introduced 'Base' at index 0. - // (ALT_HIGH, ALT_CONTINUOUS, ALT_IMMEDIATE, ALT_LOSSOFAC, ALT_HIGH5) - private int[] altsteps = {2, 9, 3, 18, 41}; // before increment of 1: { 1, 8, 2, 17, 40 }; + // (ALT_HIGH, ALT_CONTINUOUS, ALT_IMMEDIATE, ALT_LOSSOFAC, ALT_HIGH5) + private int[] altsteps = { 2, 9, 3, 18, 41 }; // before increment of 1: { 1, 8, 2, 17, 40 }; - // use the following to define which step the AlternateSubType data is associated with. - // (see above) (ALT_STANDARD, ALT_AND, ALT_OR, ALT_EQUIPMENTLIST, ALT_EQUIPMENTWBLANK, ALT_EXPLICITAND - private int[] altsubsteps = {1, 4, 5, 11, 14, 19, // before increment of 1: {0, 3, 4, 10, 13, 18, + // use the following to define which step the AlternateSubType data is associated with. + // (see above) (ALT_STANDARD, ALT_AND, ALT_OR, ALT_EQUIPMENTLIST, ALT_EQUIPMENTWBLANK, ALT_EXPLICITAND + private int[] altsubsteps = {1, 4, 5, 11, 14, 19, // before increment of 1: {0, 3, 4, 10, 13, 18, // ALT_IMPLICITOR, ALT_PARAGRAPH, ALT_EQUIPMENTOPT, ALT_EQUIPMENTOPTWBLANK, ALT_TITLEWITHTEXTRIGHT 35, 24, 30, 31, 42, // before increment of 1: 34, 23, 29, 30, 41, // ALT_TITLEWITHTEXTBELOW, ALT_CONTACSEQUENTIAL, ALT_CONTACAND, ALT_CONTACOR, ALT_CONTACPARAGRAPH 43, 44, 45, 46, 47}; // before increment of 1: 42, 43, 44, 45, 46}; - private string[] StepTypes = { + private string[] StepTypes = { "Base", "Substep","High","Immediate","And","Or","Caution","Note","Table","Continuous", "AERTable","EquipmentList","Title","PageNumber","EquipmentWBlank","ProcNumber", "RevNumber","AccPages","LossOfAC","ExplicitAnd","Caution1","Caution2", @@ -1387,7 +1387,7 @@ namespace fmtxml "RNOType","High5","TitleWithTextRight","TitleWithTextBelow", "ContAcSequential","ContAcAnd","ContAcOr","ContAcParagraph" }; - private string[] ParentTypes = { + private string[] ParentTypes = { "", "Base","Base","High","Substep","Substep","Base","Base","Base","High", "Table","Substep","Base","Title","EquipmentList","Title", "Title","Base","High","And","Caution","Caution", @@ -1517,122 +1517,125 @@ namespace fmtxml #endregion private Int16[] Tabindx; - private BinaryReader brFmt; - private string fmtName; + private BinaryReader brFmt; + private string fmtName; - private static Dictionary dicChar; - #endregion - public FormatData BaseFormat; - public bool HasBase; - public FormatData MyFormat; + private static Dictionary dicChar; + #endregion + public FormatData BaseFormat; + public static List> StepParentList = new List>(); + public static List> StepList = new List>(); + public bool HasBase; + public FormatData MyFormat; public string MyPath; - public FmtFileToXml(FmtFileToXml gendata, string alias, string nm, string path) - { - //DateTime tStart = DateTime.Now; + public FmtFileToXml(FmtFileToXml gendata, string alias, string nm, string path) + { + //DateTime tStart = DateTime.Now; MyPath = path; - if (gendata == null) - HasBase = false; - else - { - HasBase = true; - BaseFormat = gendata.MyFormat; - } - BuildDictionaryText(); - fmtName = alias; + if (gendata == null) + HasBase = false; + else + { + HasBase = true; + BaseFormat = gendata.MyFormat; + + } + BuildDictionaryText(); + fmtName = alias; //if (fmtName.ToUpper() != "CPLS" && fmtName.ToUpper() != "BASE") return; - //if (fmtName.ToUpper() != "OHLP" && fmtName.ToUpper() != "BASE" && fmtName.ToUpper() != "WCN2") return; + //if (fmtName.ToUpper() != "OHLP" && fmtName.ToUpper() != "BASE" && fmtName.ToUpper() != "WCN2") return; //if (fmtName.ToUpper() != "AEP" && fmtName.ToUpper() != "BASE") return; - try - { + try + { LoadFormatFile(nm + ".fmt", ref SubXtraFlags); - } - catch (Exception ex) - { - MessageBox.Show("Format name FAILED = " + nm, ex.Message); - } - //Console.WriteLine(" {0:0.000} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - tStart.Ticks).TotalSeconds); - } - #region GetBinaryReaderData - private byte[] GetByteArray(BinaryReader br, int len) - { - byte[] input; // = new byte[len + 1]; - input = br.ReadBytes(len); - return input; - } - - public static Regex Reg2; - public static void BuildDictionaryText() - { - #region ExtraUnicodeConvert - dicChar = new Dictionary(); - // note that the following characters needed adjusted, i.e. the - // default conversion to unicode did not result in the desired letter, - // so an extra conversion was needed. - dicChar[966] = 216; // dist zero - dicChar[201] = 274; // capital E with macron (line above) - dicChar[127] = 916; // delta - dicChar[964] = 947; // little gamma - dicChar[920] = 952; // little theta - dicChar[915] = 961; // little rho - dicChar[191] = 964; // little tau - dicChar[8801] = 8773; // approx. equal - dicChar[8734] = 8857; // circle w/ dot - dicChar[7] = 9679; // bullet - dicChar[8976] = 9830; // diamond - // dicChar[15] = 167; // grave 15=F; 167=xA7 - #endregion - #region DefinedLineDrawChars - // do all of the box/line draw characters to unicode. These were part - // of the Volian Line Draw font. - dicChar[179] = 9474; // b3 - dicChar[180] = 9508; // b4 - dicChar[181] = 9569; - dicChar[182] = 9570; - dicChar[183] = 9558; - dicChar[184] = 9557; - dicChar[185] = 9571; // b9 - dicChar[186] = 9553; // ba - dicChar[187] = 9559; - dicChar[188] = 9565; - dicChar[189] = 9564; - dicChar[190] = 9563; - dicChar[191] = 9488; - dicChar[192] = 9492; // c0 - dicChar[193] = 9524; - dicChar[194] = 9516; - dicChar[195] = 9500; - dicChar[196] = 9472; - dicChar[197] = 9532; // C5 - dicChar[198] = 9566; - dicChar[199] = 9567; - dicChar[200] = 9562; - dicChar[201] = 9556; - dicChar[202] = 9577; // ca - dicChar[203] = 9574; - dicChar[204] = 9568; - dicChar[205] = 9552; - dicChar[206] = 9580; - dicChar[207] = 9575; - dicChar[208] = 9576; // d0 - dicChar[209] = 9572; - dicChar[210] = 9573; - dicChar[211] = 9561; - dicChar[212] = 9560; - dicChar[213] = 9554; // d5 - dicChar[214] = 9555; - dicChar[215] = 9579; - dicChar[216] = 9578; - dicChar[217] = 9496; - dicChar[218] = 9484; // da - dicChar[219] = 9608; - dicChar[220] = 9604; - dicChar[221] = 9612; - dicChar[222] = 9616; - dicChar[223] = 9600; - #endregion - #region StyleTokens + } + catch (Exception ex) + { + MessageBox.Show("Format name FAILED = " + nm, ex.Message); + } + //Console.WriteLine(" {0:0.000} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - tStart.Ticks).TotalSeconds); + } + #region GetBinaryReaderData + private byte[] GetByteArray(BinaryReader br, int len) + { + byte[] input; // = new byte[len + 1]; + input = br.ReadBytes(len); + return input; + } - /* + public static Regex Reg2; + public static void BuildDictionaryText() + { + #region ExtraUnicodeConvert + dicChar = new Dictionary(); + // note that the following characters needed adjusted, i.e. the + // default conversion to unicode did not result in the desired letter, + // so an extra conversion was needed. + dicChar[966] = 216; // dist zero + dicChar[201] = 274; // capital E with macron (line above) + dicChar[127] = 916; // delta + dicChar[964] = 947; // little gamma + dicChar[920] = 952; // little theta + dicChar[915] = 961; // little rho + dicChar[191] = 964; // little tau + dicChar[8801] = 8773; // approx. equal + dicChar[8734] = 8857; // circle w/ dot + dicChar[7] = 9679; // bullet + dicChar[8976] = 9830; // diamond + // dicChar[15] = 167; // grave 15=F; 167=xA7 + #endregion + #region DefinedLineDrawChars + // do all of the box/line draw characters to unicode. These were part + // of the Volian Line Draw font. + dicChar[179] = 9474; // b3 + dicChar[180] = 9508; // b4 + dicChar[181] = 9569; + dicChar[182] = 9570; + dicChar[183] = 9558; + dicChar[184] = 9557; + dicChar[185] = 9571; // b9 + dicChar[186] = 9553; // ba + dicChar[187] = 9559; + dicChar[188] = 9565; + dicChar[189] = 9564; + dicChar[190] = 9563; + dicChar[191] = 9488; + dicChar[192] = 9492; // c0 + dicChar[193] = 9524; + dicChar[194] = 9516; + dicChar[195] = 9500; + dicChar[196] = 9472; + dicChar[197] = 9532; // C5 + dicChar[198] = 9566; + dicChar[199] = 9567; + dicChar[200] = 9562; + dicChar[201] = 9556; + dicChar[202] = 9577; // ca + dicChar[203] = 9574; + dicChar[204] = 9568; + dicChar[205] = 9552; + dicChar[206] = 9580; + dicChar[207] = 9575; + dicChar[208] = 9576; // d0 + dicChar[209] = 9572; + dicChar[210] = 9573; + dicChar[211] = 9561; + dicChar[212] = 9560; + dicChar[213] = 9554; // d5 + dicChar[214] = 9555; + dicChar[215] = 9579; + dicChar[216] = 9578; + dicChar[217] = 9496; + dicChar[218] = 9484; // da + dicChar[219] = 9608; + dicChar[220] = 9604; + dicChar[221] = 9612; + dicChar[222] = 9616; + dicChar[223] = 9600; + #endregion + #region StyleTokens + + /* * char AttrOnList[7] = {0xd3,0xd5,0xae,0xb2,SUBSCRIPT_ON,SUPERSCRIPT_ON,0}; char AttrOffList[7] = {0xd4,0xd6,0xaf,0xdd,SUBSCRIPT_OFF,SUPERSCRIPT_OFF,0}; int AttrList[7] = {BUNDERLINE_WORD, BOLD_WORD, UNDERLINE_WORD, @@ -1681,409 +1684,409 @@ namespace fmtxml dicChar[29] = 163; dicChar[30] = 163; * */ -#endregion + #endregion - char[] creg = new char[dicChar.Count]; - int i = 0; - foreach (int ic in dicChar.Keys) - { - creg[i] = (char)ic; - i++; - } - Reg2 = new Regex("[" + new string(creg) + "]"); - } - public static string ReplaceChars(Match m) - { - char[] cs = m.Value.ToCharArray(); - for (int i = 0; i < cs.Length; i++) - { - if (dicChar.ContainsKey((int)(cs[i]))) - { - int iKey = (int)cs[i]; - int iValue = dicChar[iKey]; - //if(iKey<32 && iKey!=7)Console.WriteLine(" {0} {1} {2} {3}", iKey, (char)iKey, iValue, (char)iValue); - cs[i] = (char)iValue; - } - } - return new string(cs); - } - public static string ConvertText(string s1) - { - string s2 = Reg2.Replace(s1, new MatchEvaluator(ReplaceChars)); - return s2; - } - private string GetStringFromByteNoConvert(Byte[] barray, int offset) - { - offset--; - StringBuilder inpstr = new StringBuilder(); - byte input = 0; - int cnt = 0; - bool stillread = true; - do - { - input = barray[offset++]; - if (input == 0) stillread = false; - inpstr.Append(Convert.ToChar(input)); - cnt++; - } while (stillread); + char[] creg = new char[dicChar.Count]; + int i = 0; + foreach (int ic in dicChar.Keys) + { + creg[i] = (char)ic; + i++; + } + Reg2 = new Regex("[" + new string(creg) + "]"); + } + public static string ReplaceChars(Match m) + { + char[] cs = m.Value.ToCharArray(); + for (int i = 0; i < cs.Length; i++) + { + if (dicChar.ContainsKey((int)(cs[i]))) + { + int iKey = (int)cs[i]; + int iValue = dicChar[iKey]; + //if(iKey<32 && iKey!=7)Console.WriteLine(" {0} {1} {2} {3}", iKey, (char)iKey, iValue, (char)iValue); + cs[i] = (char)iValue; + } + } + return new string(cs); + } + public static string ConvertText(string s1) + { + string s2 = Reg2.Replace(s1, new MatchEvaluator(ReplaceChars)); + return s2; + } + private string GetStringFromByteNoConvert(Byte[] barray, int offset) + { + offset--; + StringBuilder inpstr = new StringBuilder(); + byte input = 0; + int cnt = 0; + bool stillread = true; + do + { + input = barray[offset++]; + if (input == 0) stillread = false; + inpstr.Append(Convert.ToChar(input)); + cnt++; + } while (stillread); - string retstr = inpstr.ToString(); - retstr = retstr.Replace('<', '{'); - retstr = retstr.Replace('>', '}'); - //retstr = ConvertText(retstr); - if (retstr.Substring(retstr.Length - 1, 1) == "\0") return retstr.Substring(0, retstr.Length - 1); - return retstr; - } - private string GetStringFromByte(Byte[] barray, int offset) - { - offset--; - StringBuilder inpstr = new StringBuilder(); - byte input = 0; - int cnt = 0; - bool stillread = true; - do - { - input = barray[offset++]; - if (input == 0) stillread = false; - inpstr.Append(Convert.ToChar(input)); - cnt++; - } while (stillread); + string retstr = inpstr.ToString(); + retstr = retstr.Replace('<', '{'); + retstr = retstr.Replace('>', '}'); + //retstr = ConvertText(retstr); + if (retstr.Substring(retstr.Length - 1, 1) == "\0") return retstr.Substring(0, retstr.Length - 1); + return retstr; + } + private string GetStringFromByte(Byte[] barray, int offset) + { + offset--; + StringBuilder inpstr = new StringBuilder(); + byte input = 0; + int cnt = 0; + bool stillread = true; + do + { + input = barray[offset++]; + if (input == 0) stillread = false; + inpstr.Append(Convert.ToChar(input)); + cnt++; + } while (stillread); - string retstr = inpstr.ToString(); - retstr = retstr.Replace('<', '{'); - retstr = retstr.Replace('>', '}'); - retstr = ConvertText(retstr); - if (retstr.Substring(retstr.Length - 1, 1) == "\0") return retstr.Substring(0, retstr.Length - 1); - return retstr; - } - private string GetStringUntilNull(BinaryReader br) - { - StringBuilder inpstr = new StringBuilder(); - byte input = 0; - int cnt = 0; - bool stillread = true; - do - { - try - { - input = br.ReadByte(); - if (input == 0) stillread = false; - inpstr.Append(Convert.ToChar(input)); - } - catch (System.IO.EndOfStreamException) - { - stillread = false; - } - cnt++; - } while (stillread); + string retstr = inpstr.ToString(); + retstr = retstr.Replace('<', '{'); + retstr = retstr.Replace('>', '}'); + retstr = ConvertText(retstr); + if (retstr.Substring(retstr.Length - 1, 1) == "\0") return retstr.Substring(0, retstr.Length - 1); + return retstr; + } + static public string GetStringUntilNull(BinaryReader br) + { + StringBuilder inpstr = new StringBuilder(); + byte input = 0; + int cnt = 0; + bool stillread = true; + do + { + try + { + input = br.ReadByte(); + if (input == 0) stillread = false; + inpstr.Append(Convert.ToChar(input)); + } + catch (System.IO.EndOfStreamException) + { + stillread = false; + } + cnt++; + } while (stillread); - string retstr = inpstr.ToString(); - retstr = retstr.Replace('<', '{'); - retstr = retstr.Replace('>', '}'); - if (retstr.Substring(retstr.Length - 1, 1) == "\0") return retstr.Substring(0, retstr.Length - 1); - return retstr; - } - private string GetString(BinaryReader br, int len) - { - StringBuilder inpstr = new StringBuilder(); - byte input = 0; - int cnt = 0; - do - { - try - { - input = br.ReadByte(); - inpstr.Append(Convert.ToChar(input)); - } - catch (System.IO.EndOfStreamException) - { - input = 0; - while (cnt < len) - { - inpstr.Append(Convert.ToChar(input)); - cnt++; - } - } - cnt++; - } while (cnt < len); + string retstr = inpstr.ToString(); + retstr = retstr.Replace('<', '{'); + retstr = retstr.Replace('>', '}'); + if (retstr.Substring(retstr.Length - 1, 1) == "\0") return retstr.Substring(0, retstr.Length - 1); + return retstr; + } + private string GetString(BinaryReader br, int len) + { + StringBuilder inpstr = new StringBuilder(); + byte input = 0; + int cnt = 0; + do + { + try + { + input = br.ReadByte(); + inpstr.Append(Convert.ToChar(input)); + } + catch (System.IO.EndOfStreamException) + { + input = 0; + while (cnt < len) + { + inpstr.Append(Convert.ToChar(input)); + cnt++; + } + } + cnt++; + } while (cnt < len); - string retstr = inpstr.ToString(); - retstr = retstr.Replace('<', '{'); - retstr = retstr.Replace('>', '}'); - if (retstr.Substring(retstr.Length - 1, 1) == "\0") return retstr.Substring(0, retstr.Length - 1); - return retstr; - } - #endregion - private VE_Font LoadVE_Font() - { - UInt32 ui = brFmt.ReadUInt32(); - //if (ui > 0) - Always set the font, even if it is 0 (default) - //{ - VE_Font retval = new VE_Font(ui); - return retval; - //} - //return null; - } - private VE_Font LoadVE_FontByte() - { - byte bt = brFmt.ReadByte(); - if (bt > 0) - { - VE_Font retval = new VE_Font(Convert.ToUInt32(bt)); - return retval; - } - return null; - } - #region XtraFlags + string retstr = inpstr.ToString(); + retstr = retstr.Replace('<', '{'); + retstr = retstr.Replace('>', '}'); + if (retstr.Substring(retstr.Length - 1, 1) == "\0") return retstr.Substring(0, retstr.Length - 1); + return retstr; + } + #endregion + private VE_Font LoadVE_Font() + { + UInt32 ui = brFmt.ReadUInt32(); + //if (ui > 0) - Always set the font, even if it is 0 (default) + //{ + VE_Font retval = new VE_Font(ui); + return retval; + //} + //return null; + } + private VE_Font LoadVE_FontByte() + { + byte bt = brFmt.ReadByte(); + if (bt > 0) + { + VE_Font retval = new VE_Font(Convert.ToUInt32(bt)); + return retval; + } + return null; + } + #region XtraFlags private void AddFlags(ref XtraFlgs XtraFlags, int i, Int16 flg) - { - if (i == 0) - { - if ((flg & DOUBLERNOSPACE) > 0) XtraFlags.DoubleRNOSpace = true.ToString(); - if ((flg & MIXCAUTIONSANDNOTES) > 0) XtraFlags.MixCautionsAndNotes = true.ToString(); - if ((flg & ALWAYSUSEEXTRALINES) > 0) XtraFlags.AlwaysUseExtralines = true.ToString(); - if ((flg & ALWAYSTABNOTE) > 0) XtraFlags.AlwaysTabNote = true.ToString(); - if ((flg & ALWAYSTABCAUTION) > 0) XtraFlags.AlwaysTabCaution = true.ToString(); - if ((flg & SPECIALPAGEBREAKFLAG) > 0) XtraFlags.SpecialPageBreakFlag = true.ToString(); - if ((flg & DONTPAGINATEONFIRSTSUBSTEP) > 0) XtraFlags.DontPaginateOnFirstSubStep = true.ToString(); - if ((flg & IMPERFECTSTRUCTURE) > 0) XtraFlags.ImperfectStructure = true.ToString(); - if ((flg & DONTUSEHALFLINES) > 0) XtraFlags.DontUseHalfLines = true.ToString(); - if ((flg & FORTRANFORMATNUMBERS) > 0) XtraFlags.FortranFormatNumbers = true.ToString(); - if ((flg & ALLUNITS) > 0) XtraFlags.AllUnits = true.ToString(); - if ((flg & CAPSTRANSITIONS) > 0) XtraFlags.CapsTransitions = true.ToString(); - } - else if (i == 1) - { - if ((flg & CAPTRANSTEP) > 0) XtraFlags.CapTranStep = true.ToString(); - if ((flg & TSTEPNOFLAG) > 0) XtraFlags.TSTepNoFlag = true.ToString(); - if ((flg & LOWERCASETRANNUMBER) > 0) XtraFlags.LowerCaseTranNumber = true.ToString(); - if ((flg & CONDENSEDCHANGEBAR) > 0) XtraFlags.CondensedChangeBar = true.ToString(); - if ((flg & DOREVDATE) > 0) XtraFlags.DoRevDate = true.ToString(); - if ((flg & SEPARATEBOX) > 0) XtraFlags.SeparateBox = true.ToString(); - if ((flg & NUMBERHIGHLEVELRNO) > 0) XtraFlags.NumberHighLevelRNO = true.ToString(); - if ((flg & ALTERNATEFOLDOUTPAGES) > 0) XtraFlags.AlternateFoldoutPages = true.ToString(); - if ((flg & DONTTRYTOFILLHALFOFPAGE) > 0) XtraFlags.DontTryToFillHalfOfPage = true.ToString(); - } - else if (i == 2) - { - if ((flg & DONTCAPITALIZETITLE) > 0) XtraFlags.DontCapitalizeTitle = true.ToString(); - if ((flg & NOSPACEDOUBLERNO) > 0) XtraFlags.NoSpaceDoubleRNO = true.ToString(); - if ((flg & DONTOFFSETTAB) > 0) XtraFlags.DontOffsetTab = true.ToString(); - if ((flg & UPSETPNTAFTRDASH) > 0) XtraFlags.UpSetpntAftrDash = true.ToString(); - if ((flg & LOWERCASEREVNUM) > 0) XtraFlags.LowerCaseRevnum = true.ToString(); - if ((flg & DONOTCOMPRESSSTEPS) > 0) XtraFlags.DoNotCompressSteps = true.ToString(); - if ((flg & REDUCELINEAFTERNOTEANDCAUT) > 0) XtraFlags.ReduceLineAfterNoteAndCaut = true.ToString(); - if ((flg & RNOSAMELEVEL) > 0) XtraFlags.RNOSameLevel = true.ToString(); - if ((flg & BOLDHIGHLEVELRNO) > 0) XtraFlags.BoldHighLevelRNO = true.ToString(); - if ((flg & ONELINEBEFORENOTECAUTIONTAB) > 0) XtraFlags.OneLineBeforeNoteCautionTab = true.ToString(); - if ((flg & CONTINUOUSCHANGEBARS) > 0) XtraFlags.ContinuousChangeBars = true.ToString(); - } - else if (i == 3) - { - if ((flg & DONTBOXAC) > 0) XtraFlags.DontBoxAC = true.ToString(); - if ((flg & USETOPCONTINUEMESSAGEATEND) > 0) XtraFlags.UseTopContinueMessageAtEnd = true.ToString(); - if ((flg & UPCASETRANAND) > 0) XtraFlags.UpcaseTranAnd = true.ToString(); - if ((flg & UPCASEALLSETPOINTUNITS) > 0) XtraFlags.UpcaseAllSetpointUnits = true.ToString(); - } - else if (i == 4) - { - if ((flg & DEV_FORMAT) > 0) XtraFlags.Dev_Format = true.ToString(); - if ((flg & DONTDOSTEXTRAATTOP) > 0) XtraFlags.DontDoSTExtraAtTop = true.ToString(); - if ((flg & XLINES_STEPFIX) > 0) XtraFlags.Xlines_StepFix = true.ToString(); - if ((flg & REBOXCAUTNOTE) > 0) XtraFlags.ReBoxCautNote = true.ToString(); - if ((flg & IMMSTEPSPCHDR) > 0) XtraFlags.IMMStepSpcHdr = true.ToString(); - if ((flg & FLOATINGCONTINUEMESSAGE) > 0) XtraFlags.FloatingContinueMessage = true.ToString(); - if ((flg & ABSOLUTEFIXEDCHANGECOLUMN) > 0) XtraFlags.AbsoluteFixedChangeColumn = true.ToString(); - if ((flg & LJBORDERLESSTABLE) > 0) XtraFlags.LJBorderlessTable = true.ToString(); - if ((flg & SUPPRESSANDINTRAN) > 0) XtraFlags.SuppressAndInTran = true.ToString(); - if ((flg & CAPHIGHSETPNT) > 0) XtraFlags.CapHighSetpnt = true.ToString(); - if ((flg & CAPSPIFLASTLOWER) > 0) XtraFlags.CapsPIFLastLower = true.ToString(); + { + if (i == 0) + { + if ((flg & DOUBLERNOSPACE) > 0) XtraFlags.DoubleRNOSpace = true.ToString(); + if ((flg & MIXCAUTIONSANDNOTES) > 0) XtraFlags.MixCautionsAndNotes = true.ToString(); + if ((flg & ALWAYSUSEEXTRALINES) > 0) XtraFlags.AlwaysUseExtralines = true.ToString(); + if ((flg & ALWAYSTABNOTE) > 0) XtraFlags.AlwaysTabNote = true.ToString(); + if ((flg & ALWAYSTABCAUTION) > 0) XtraFlags.AlwaysTabCaution = true.ToString(); + if ((flg & SPECIALPAGEBREAKFLAG) > 0) XtraFlags.SpecialPageBreakFlag = true.ToString(); + if ((flg & DONTPAGINATEONFIRSTSUBSTEP) > 0) XtraFlags.DontPaginateOnFirstSubStep = true.ToString(); + if ((flg & IMPERFECTSTRUCTURE) > 0) XtraFlags.ImperfectStructure = true.ToString(); + if ((flg & DONTUSEHALFLINES) > 0) XtraFlags.DontUseHalfLines = true.ToString(); + if ((flg & FORTRANFORMATNUMBERS) > 0) XtraFlags.FortranFormatNumbers = true.ToString(); + if ((flg & ALLUNITS) > 0) XtraFlags.AllUnits = true.ToString(); + if ((flg & CAPSTRANSITIONS) > 0) XtraFlags.CapsTransitions = true.ToString(); + } + else if (i == 1) + { + if ((flg & CAPTRANSTEP) > 0) XtraFlags.CapTranStep = true.ToString(); + if ((flg & TSTEPNOFLAG) > 0) XtraFlags.TSTepNoFlag = true.ToString(); + if ((flg & LOWERCASETRANNUMBER) > 0) XtraFlags.LowerCaseTranNumber = true.ToString(); + if ((flg & CONDENSEDCHANGEBAR) > 0) XtraFlags.CondensedChangeBar = true.ToString(); + if ((flg & DOREVDATE) > 0) XtraFlags.DoRevDate = true.ToString(); + if ((flg & SEPARATEBOX) > 0) XtraFlags.SeparateBox = true.ToString(); + if ((flg & NUMBERHIGHLEVELRNO) > 0) XtraFlags.NumberHighLevelRNO = true.ToString(); + if ((flg & ALTERNATEFOLDOUTPAGES) > 0) XtraFlags.AlternateFoldoutPages = true.ToString(); + if ((flg & DONTTRYTOFILLHALFOFPAGE) > 0) XtraFlags.DontTryToFillHalfOfPage = true.ToString(); + } + else if (i == 2) + { + if ((flg & DONTCAPITALIZETITLE) > 0) XtraFlags.DontCapitalizeTitle = true.ToString(); + if ((flg & NOSPACEDOUBLERNO) > 0) XtraFlags.NoSpaceDoubleRNO = true.ToString(); + if ((flg & DONTOFFSETTAB) > 0) XtraFlags.DontOffsetTab = true.ToString(); + if ((flg & UPSETPNTAFTRDASH) > 0) XtraFlags.UpSetpntAftrDash = true.ToString(); + if ((flg & LOWERCASEREVNUM) > 0) XtraFlags.LowerCaseRevnum = true.ToString(); + if ((flg & DONOTCOMPRESSSTEPS) > 0) XtraFlags.DoNotCompressSteps = true.ToString(); + if ((flg & REDUCELINEAFTERNOTEANDCAUT) > 0) XtraFlags.ReduceLineAfterNoteAndCaut = true.ToString(); + if ((flg & RNOSAMELEVEL) > 0) XtraFlags.RNOSameLevel = true.ToString(); + if ((flg & BOLDHIGHLEVELRNO) > 0) XtraFlags.BoldHighLevelRNO = true.ToString(); + if ((flg & ONELINEBEFORENOTECAUTIONTAB) > 0) XtraFlags.OneLineBeforeNoteCautionTab = true.ToString(); + if ((flg & CONTINUOUSCHANGEBARS) > 0) XtraFlags.ContinuousChangeBars = true.ToString(); + } + else if (i == 3) + { + if ((flg & DONTBOXAC) > 0) XtraFlags.DontBoxAC = true.ToString(); + if ((flg & USETOPCONTINUEMESSAGEATEND) > 0) XtraFlags.UseTopContinueMessageAtEnd = true.ToString(); + if ((flg & UPCASETRANAND) > 0) XtraFlags.UpcaseTranAnd = true.ToString(); + if ((flg & UPCASEALLSETPOINTUNITS) > 0) XtraFlags.UpcaseAllSetpointUnits = true.ToString(); + } + else if (i == 4) + { + if ((flg & DEV_FORMAT) > 0) XtraFlags.Dev_Format = true.ToString(); + if ((flg & DONTDOSTEXTRAATTOP) > 0) XtraFlags.DontDoSTExtraAtTop = true.ToString(); + if ((flg & XLINES_STEPFIX) > 0) XtraFlags.Xlines_StepFix = true.ToString(); + if ((flg & REBOXCAUTNOTE) > 0) XtraFlags.ReBoxCautNote = true.ToString(); + if ((flg & IMMSTEPSPCHDR) > 0) XtraFlags.IMMStepSpcHdr = true.ToString(); + if ((flg & FLOATINGCONTINUEMESSAGE) > 0) XtraFlags.FloatingContinueMessage = true.ToString(); + if ((flg & ABSOLUTEFIXEDCHANGECOLUMN) > 0) XtraFlags.AbsoluteFixedChangeColumn = true.ToString(); + if ((flg & LJBORDERLESSTABLE) > 0) XtraFlags.LJBorderlessTable = true.ToString(); + if ((flg & SUPPRESSANDINTRAN) > 0) XtraFlags.SuppressAndInTran = true.ToString(); + if ((flg & CAPHIGHSETPNT) > 0) XtraFlags.CapHighSetpnt = true.ToString(); + if ((flg & CAPSPIFLASTLOWER) > 0) XtraFlags.CapsPIFLastLower = true.ToString(); if ((flg & CAPFIRSTLETTERINHIGHSP) > 0) XtraFlags.CapFirstLetterInHighSP = true.ToString(); - } - else if (i == 5) - { - if ((flg & ALTERNATEFLOATINGFOLDOUT) > 0) XtraFlags.AlternateFloatingFoldout = true.ToString(); - if ((flg & WRAPSAMEASEDIT) > 0) XtraFlags.WrapSameAsEdit = true.ToString(); - if ((flg & KEEPSTEPSONPAGE) > 0) XtraFlags.KeepStepsOnPage = true.ToString(); - if ((flg & SPECIFIEDSUBSTEPSONLY) > 0) XtraFlags.SpecifiedSubstepsOnly = true.ToString(); - if ((flg & THREEBLANKSABOVENOTESCAUTIONS) > 0) XtraFlags.ThreeBlanksAboveNotesCautions = true.ToString(); - if ((flg & IMPERFECTSUBSTEP) > 0) XtraFlags.ImperfectSubstep = true.ToString(); - if ((flg & DONTBREAKONSECTIONS) > 0) XtraFlags.DontBreakOnSections = true.ToString(); - if ((flg & NOSTEPNUMIFONLYONESTEP) > 0) XtraFlags.NoStepNumIfOnlyOneStep = true.ToString(); - if ((flg & SHOWSECTIONTITLES) > 0) XtraFlags.ShowSectionTitles = true.ToString(); - if ((flg & LJTABS) > 0) XtraFlags.LJTabs = true.ToString(); - if ((flg & DONTNUMBERRNOSUBS) > 0) XtraFlags.DontNumberRNOSubs = true.ToString(); - if ((flg & DROPCHECKOFF) > 0) XtraFlags.DropCheckOff = true.ToString(); - if ((flg & NOCHECKOFFSINRNO) > 0) XtraFlags.NoCheckOffsInRNO = true.ToString(); - } - else if (i == 6) - { + } + else if (i == 5) + { + if ((flg & ALTERNATEFLOATINGFOLDOUT) > 0) XtraFlags.AlternateFloatingFoldout = true.ToString(); + if ((flg & WRAPSAMEASEDIT) > 0) XtraFlags.WrapSameAsEdit = true.ToString(); + if ((flg & KEEPSTEPSONPAGE) > 0) XtraFlags.KeepStepsOnPage = true.ToString(); + if ((flg & SPECIFIEDSUBSTEPSONLY) > 0) XtraFlags.SpecifiedSubstepsOnly = true.ToString(); + if ((flg & THREEBLANKSABOVENOTESCAUTIONS) > 0) XtraFlags.ThreeBlanksAboveNotesCautions = true.ToString(); + if ((flg & IMPERFECTSUBSTEP) > 0) XtraFlags.ImperfectSubstep = true.ToString(); + if ((flg & DONTBREAKONSECTIONS) > 0) XtraFlags.DontBreakOnSections = true.ToString(); + if ((flg & NOSTEPNUMIFONLYONESTEP) > 0) XtraFlags.NoStepNumIfOnlyOneStep = true.ToString(); + if ((flg & SHOWSECTIONTITLES) > 0) XtraFlags.ShowSectionTitles = true.ToString(); + if ((flg & LJTABS) > 0) XtraFlags.LJTabs = true.ToString(); + if ((flg & DONTNUMBERRNOSUBS) > 0) XtraFlags.DontNumberRNOSubs = true.ToString(); + if ((flg & DROPCHECKOFF) > 0) XtraFlags.DropCheckOff = true.ToString(); + if ((flg & NOCHECKOFFSINRNO) > 0) XtraFlags.NoCheckOffsInRNO = true.ToString(); + } + else if (i == 6) + { if ((flg & CHGBARMESSAGEFROMEDIT) > 0) XtraFlags.ChgBarMessageFromEdit = true.ToString(); if ((flg & CHANGEBARTORNOSEP) > 0) XtraFlags.ChangeBarToRNOSep = true.ToString(); - if ((flg & CHGSTYLEPERSECTION) > 0) XtraFlags.ChangeStyleForEverySection = true.ToString(); - if ((flg & SECTIONLEVELFOLDOUTS) > 0) XtraFlags.SectionLevelFoldouts = true.ToString(); + if ((flg & CHGSTYLEPERSECTION) > 0) XtraFlags.ChangeStyleForEverySection = true.ToString(); + if ((flg & SECTIONLEVELFOLDOUTS) > 0) XtraFlags.SectionLevelFoldouts = true.ToString(); if ((flg & BOXCONTACTIONS) > 0) XtraFlags.BoxContinousActions = true.ToString(); - if ((flg & DOSECTIONTRANS) > 0) XtraFlags.DoSectionTrans = true.ToString(); - if ((flg & UPSPIFPREVUPPER) > 0) XtraFlags.UpSpIfPrevUpper = true.ToString(); - if ((flg & CONTINUESECTIONHEADER) > 0) XtraFlags.ContinueSectionHeader = true.ToString(); - if ((flg & GLOBALPROCINFO) > 0) XtraFlags.GlobalProcInfo = true.ToString(); - if ((flg & COMPRESSHPSUB) > 0) XtraFlags.CompressHPSub = true.ToString(); - if ((flg & BULLETONCONTINUOUS) > 0) XtraFlags.BulletOnContinuous = true.ToString(); - if ((flg & CANCELSECTITLESONS2) > 0) XtraFlags.CancelSecTitlesOnS2 = true.ToString(); - if ((flg & NOENDFORSINGLE) > 0) XtraFlags.NoEndForSingle = true.ToString(); - if ((flg & USEMETASECTIONS) > 0) XtraFlags.UseMetaSections = true.ToString(); - } - else if (i == 7) - { - if ((flg & RNOCONTINUEONLY) > 0) XtraFlags.RNOContinueOnly = true.ToString(); - if ((flg & CAP1STCHARTRANS) > 0) XtraFlags.Cap1stCharTrans = true.ToString(); - if ((flg & DONTPAGINATEONFIRSTSUBSTEP3X) > 0) XtraFlags.DontPaginateOnFirstSubstep3X = true.ToString(); - if ((flg & RNOSEPAFTERAER) > 0) XtraFlags.RNOSepAfterAER = true.ToString(); - if ((flg & REVDATEWITHFORWARDSLASH) > 0) XtraFlags.RevDateWithForwardSlash = true.ToString(); - if ((flg & USEALTERNATESTEPBOX) > 0) XtraFlags.UseAlternateStepBox = true.ToString(); - if ((flg & CANCELSECTITLESONS1) > 0) XtraFlags.CancelSecTitlesOnS1 = true.ToString(); - if ((flg & SPECIALSTEPSFOLDOUT) > 0) XtraFlags.SpecialStepsFoldout = true.ToString(); - if ((flg & UNDERLINEAFTERDASHSPACE) > 0) XtraFlags.UnderlineAfterDashSpace = true.ToString(); - if ((flg & NOSPACEINNOTEORCAUTION) > 0) XtraFlags.NoSpaceInNoteOrCaution = true.ToString(); - if ((flg & USEXTRAREVNUMBER) > 0) XtraFlags.UseXtraRevNumber = true.ToString(); - if ((flg & UNDERLINESETPOINTS) > 0) XtraFlags.UnderlineSetpoints = true.ToString(); - if ((flg & DOSECTIONTRANSTYPEB) > 0) XtraFlags.DoSectionTransTypeB = true.ToString(); - if ((flg & PAGINATEONLOWERSTEPLEVEL) > 0) XtraFlags.PaginateOnLowerStepLevel = true.ToString(); - if ((flg & USETRANSITIONMODIFIER) > 0) XtraFlags.UseTransitionModifier = true.ToString(); - } - else if (i == 8) - { - if ((flg & CUSTOMSPACING) > 0) XtraFlags.CustomSpacing = true.ToString(); - if ((flg & ENHANCEDSHORTFORMDEV) > 0) XtraFlags.EnhancedShortFormDev = true.ToString(); - if ((flg & PAGEBREAKONHIGHLEVELSTEP) > 0) XtraFlags.PageBreakOnHighLevelStep = true.ToString(); - if ((flg & PAGEBREAKONCAUTIONS) > 0) XtraFlags.PageBreakOnCautions = true.ToString(); - if ((flg & PAGEBREAKONNOTES) > 0) XtraFlags.PageBreakOnNotes = true.ToString(); - if ((flg & ALIGNNULLTABWSECTHEAD) > 0) XtraFlags.AlignNullTabWSectHead = true.ToString(); - if ((flg & DONTUSESECTITLES) > 0) XtraFlags.DontUseSecTitles = true.ToString(); - if ((flg & TEXTSUBFOLLOWSTEXTSTYLE) > 0) XtraFlags.TextSubFollowsTextStyle = true.ToString(); - if ((flg & TRANSPROCTITLEINPAREN) > 0) XtraFlags.TranProcTitleInParen = true.ToString(); - if ((flg & HARDSPTRANPROCNUMB) > 0) XtraFlags.HardSpTranProcNumb = true.ToString(); - if ((flg & TREATANDORASSEQUENTIAL) > 0) XtraFlags.TreatAndOrAsSequential = true.ToString(); - if ((flg & DONTSPLITSTEPINPRNTSTEP) > 0) XtraFlags.DontSplitStepInPrntStep = true.ToString(); - if ((flg & LINEABOVEUNDERSECTION) > 0) XtraFlags.LineAboveUnderSection = true.ToString(); - } - else if (i == 9) - { - if ((flg & PICAIGNOREFIVESIXTHS) > 0) XtraFlags.PicaIgnoreFiveSixths = true.ToString(); - if ((flg & SPACEFORNOSECNUMB) > 0) XtraFlags.SpaceFoRNOSecNumb = true.ToString(); - if ((flg & NONEDITABLESTEPS) > 0) XtraFlags.NonEditableSteps = true.ToString(); - if ((flg & BOXEDSUBSTEPS) > 0) XtraFlags.BoxedSubsteps = true.ToString(); - if ((flg & DONTNUMBERHIGHLEVELSTEPS) > 0) XtraFlags.DontNumberHighLevelSteps = true.ToString(); - if ((flg & NOSTEPNUMBERFORHIGHLEVELRNO) > 0) XtraFlags.NoStepNumberForHighLevelRNO = true.ToString(); - if ((flg & PROMPTFORCAUTINTYPE) > 0) XtraFlags.PromptForCautinType = true.ToString(); - if ((flg & CAUTION1SAMEROWASPARENT) > 0) XtraFlags.Caution1SameRowAsParent = true.ToString(); - if ((flg & WOLFCREEKBACKGROUNDFORMAT) > 0) XtraFlags.WolfCreekBackgroundFormat = true.ToString(); - if ((flg & ENHANCEDSTEPNUMFROMPREV) > 0) XtraFlags.EnhancedStepNumFromPrev = true.ToString(); - } - else if (i == 10) - { - if ((flg & CONTROLUNDERLINESTYLE) > 0) XtraFlags.ControlUnderlineStyle = true.ToString(); - if ((flg & MULTIPLECHANGEIDS) > 0) XtraFlags.MultipleChangeIds = true.ToString(); - if ((flg & USEMULTILINESECTIONTITLE) > 0) XtraFlags.UseMultiLineSectionTitle = true.ToString(); - if ((flg & PAGEBREAKONFIRSTBLANKLINE) > 0) XtraFlags.PageBreakOnFirstBlankLine = true.ToString(); - if ((flg & DONTPRINTNOTITLE) > 0) XtraFlags.DontPrintNoTitle = true.ToString(); - if ((flg & UNDSPECIALSTEPSFOLDOUT) > 0) XtraFlags.UndSpecialStepsFoldout = true.ToString(); - if ((flg & PUTONPAGEBYITSELF) > 0) XtraFlags.PutOnPageByItself = true.ToString(); - } - else if (i == 11) - { - if ((flg & SECTITLECONTINUE) > 0) XtraFlags.SecTitleContinue = true.ToString(); - if ((flg & CANCELSECTITLESONE0) > 0) XtraFlags.CancelSecTitlesOnE0 = true.ToString(); - if ((flg & METASECTENDMESSAGE) > 0) XtraFlags.MetaSectEndMessage = true.ToString(); - if ((flg & CANCELSECTITLESONE2) > 0) XtraFlags.CancelSecTitlesOnE2 = true.ToString(); - if ((flg & COMPRESSHPSUPER) > 0) XtraFlags.CompressHPSuper = true.ToString(); - } - else if (i == 12) - { - if ((flg & MATCHUPRNOCAUTNOTE) > 0) XtraFlags.MatchUpRNOCautNote = true.ToString(); - if ((flg & PAGINATEATHIGHESTPAGINLEVEL) > 0) XtraFlags.PaginateAtHighestPaginLevel = true.ToString(); - if ((flg & USELONGPROCTITLES) > 0) XtraFlags.UseLongProcTitles = true.ToString(); - if ((flg & SPECIALLANDSCAPEMODE) > 0) XtraFlags.SpecialLandscapeMode = true.ToString(); - if ((flg & RNOINPAGELIST) > 0) XtraFlags.RNOInPagelist = true.ToString(); - if ((flg & STPCAUTNOTETABINPAGELIST) > 0) XtraFlags.StpCautNoteTabInPagelist = true.ToString(); - if ((flg & READONLYTYPEINCONTMSG) > 0) XtraFlags.ReadOnlyTypeInContMsg = true.ToString(); - } - else if (i == 13) - { - if ((flg & CENTERONELINEONLY) > 0) XtraFlags.CenterOneLineOnly = true.ToString(); - if ((flg & TIETABTOLEVEL) > 0) XtraFlags.TieTabToLevel = true.ToString(); - if ((flg & ACCESSORYDOCSINDUPLEX) > 0) XtraFlags.AccessoryDocsInDuplex = true.ToString(); - if ((flg & FOLDOUTSINDUPLEX) > 0) XtraFlags.FoldoutsInDuplex = true.ToString(); - if ((flg & USESTEXTRAREALVALUE) > 0) XtraFlags.UseSTExtraRealValue = true.ToString(); - if ((flg & SUBTABLEGETSUP1LEVEL) > 0) XtraFlags.SubTableGetSup1Level = true.ToString(); - if ((flg & DONTCOUNTFOLDOUTPAGES) > 0) XtraFlags.DontCountFoldoutPages = true.ToString(); - if ((flg & SEARCHALLREPLACEWORDS) > 0) XtraFlags.SearchAllReplaceWords = true.ToString(); - } - else if (i == 14) - { - if ((flg & REMEMBERCAUTIONSANDNOTES) > 0) XtraFlags.RememberCautionsAndNotes = true.ToString(); - if ((flg & RTFADJUSTMENTS) > 0) XtraFlags.RtfAdjustments = true.ToString(); - if ((flg & CENTERONELINEADJUST) > 0) XtraFlags.CenterOneLineAdjust = true.ToString(); - if ((flg & COUNTALLSUBLEVELS) > 0) XtraFlags.CountAllSubLevels = true.ToString(); - if ((flg & DONTREPLACEWORDSINROS) > 0) XtraFlags.DontReplaceWordsInROs = true.ToString(); - if ((flg & HIGHLEVELRNOBEFOREAERSUBSTPS) > 0) XtraFlags.HighLevelRNOBeforeAERSubStps = true.ToString(); - if ((flg & UNDERLINEALLMETATITLES) > 0) XtraFlags.UnderlineAllMetaTitles = true.ToString(); - if ((flg & DONTBREAKCAUTIONSORNOTES) > 0) XtraFlags.DontBreakCautionsOrNotes = true.ToString(); - if ((flg & BOLDONLYSECTIONZERO) > 0) XtraFlags.BoldOnlySectionZero = true.ToString(); - if ((flg & DONTBREAKONRNO) > 0) XtraFlags.DontBreakOnRNO = true.ToString(); - if ((flg & RNOCHECKOFFSAMEASPARENT) > 0) XtraFlags.RNOCheckOffSameAsParent = true.ToString(); - if ((flg & USESTEPTYPEWIDTHOVERRRIDE) > 0) XtraFlags.UseStepTypeWidthOverride = true.ToString(); - if ((flg & WOLFCREEKCKLFORMAT) > 0) XtraFlags.WolfcreekCKLFormat = true.ToString(); - } - else if (i == 15) - { - if ((flg & DONTPAGINATEONFIRSTSUBSTEP2X) > 0) XtraFlags.DontPaginateOnFirstSubStep2X = true.ToString(); - if ((flg & USESTEPTYPEWIDTHOVERRRIDEEDITPRINT) > 0) XtraFlags.UseStepTypeWidthOverrideEditPrint = true.ToString(); - if ((flg & PARTIALSTEPCOMPRESSION) > 0) XtraFlags.PartialStepCompression = true.ToString(); - if ((flg & USESMARTTEMPLATE) > 0) XtraFlags.UseSmartTemplate = true.ToString(); - if ((flg & CHECKOFFONHLSONLY) > 0) XtraFlags.CheckoffOnHLSOnly = true.ToString(); - if ((flg & CAUTION2SAMEROWASPARENT) > 0) XtraFlags.Caution2SameRowAsParent = true.ToString(); - if ((flg & CENTERTEXTWITHINWIDTH) > 0) XtraFlags.CenterTextWithinWidth = true.ToString(); - if ((flg & DONTBREAKEQUIPMENTLIST) > 0) XtraFlags.DontBreakEquipmentList = true.ToString(); - if ((flg & ALWAYSTABCAUTION2) > 0) XtraFlags.AlwaysTabCaution2 = true.ToString(); - if ((flg & VIRTUALDOTINHLSTAB) > 0) XtraFlags.VirtualDotInHLSTab = true.ToString(); - if ((flg & IMPERFECTSTRUCTUREPLUS4) > 0) XtraFlags.ImperfectStructurePlus4 = true.ToString(); - } - else if (i == 16) - { - if ((flg & USERNOTYPEINACTABLE) > 0) XtraFlags.UseRNOTypeInActable = true.ToString(); - if ((flg & ABSOLUTETRANSITIONUPDATE) > 0) XtraFlags.AbsoluteTransitionUpdate = true.ToString(); - if ((flg & SEPARATEBOXCAUTIONS) > 0) XtraFlags.SeparateBoxCautions = true.ToString(); - if ((flg & HLSTEXTINPAGELIST) > 0) XtraFlags.HLSTextInPagelist = true.ToString(); - if ((flg & LOWERCASESTEPINTRAN) > 0) XtraFlags.LowerCaseStepInTran = true.ToString(); - if ((flg & CHANGEBARSONLINKEDTEXT) > 0) XtraFlags.ChangeBarsOnLinkedText = true.ToString(); - if ((flg & QUOTEDSUBSTEPS) > 0) XtraFlags.QuotedSubsteps = true.ToString(); - } - else if (i == 17) - { - if ((flg & OVERRIDEENHANCEDTABS) > 0) XtraFlags.OverrideEnhancedTabs = true.ToString(); - if ((flg & NONEWLINEAFTERRNO) > 0) XtraFlags.NoNewlineAfterRNO = true.ToString(); - if ((flg & DOSECTIONSEPARATORLINE) > 0) XtraFlags.DoSectionSeparatorLine = true.ToString(); - if ((flg & PARENSONEXTPAGENUMTRANS) > 0) XtraFlags.ParensOnExtPagenumTrans = true.ToString(); - if ((flg & ATLEASTTWODIGITSFORHLS) > 0) XtraFlags.AtLeastTwoDigitsForHLS = true.ToString(); - if ((flg & DONTBREAKOPTEQUIPMENTLIST) > 0) - XtraFlags.DontBreakOptEquipmentList = true.ToString(); - if ((flg & PAGELISTCHANGEIDSWITHCOMMAS) > 0) XtraFlags.PagelistChangeIDsWithCommas = true.ToString(); - if ((flg & DONTSTARTLINEWITHDASH) > 0) XtraFlags.DontStartLineWithDash = true.ToString(); - if ((flg & NOBLANKLINEBEFORESUBSTEP) > 0) XtraFlags.NoBlankLineBeforeSubstep = true.ToString(); + if ((flg & DOSECTIONTRANS) > 0) XtraFlags.DoSectionTrans = true.ToString(); + if ((flg & UPSPIFPREVUPPER) > 0) XtraFlags.UpSpIfPrevUpper = true.ToString(); + if ((flg & CONTINUESECTIONHEADER) > 0) XtraFlags.ContinueSectionHeader = true.ToString(); + if ((flg & GLOBALPROCINFO) > 0) XtraFlags.GlobalProcInfo = true.ToString(); + if ((flg & COMPRESSHPSUB) > 0) XtraFlags.CompressHPSub = true.ToString(); + if ((flg & BULLETONCONTINUOUS) > 0) XtraFlags.BulletOnContinuous = true.ToString(); + if ((flg & CANCELSECTITLESONS2) > 0) XtraFlags.CancelSecTitlesOnS2 = true.ToString(); + if ((flg & NOENDFORSINGLE) > 0) XtraFlags.NoEndForSingle = true.ToString(); + if ((flg & USEMETASECTIONS) > 0) XtraFlags.UseMetaSections = true.ToString(); + } + else if (i == 7) + { + if ((flg & RNOCONTINUEONLY) > 0) XtraFlags.RNOContinueOnly = true.ToString(); + if ((flg & CAP1STCHARTRANS) > 0) XtraFlags.Cap1stCharTrans = true.ToString(); + if ((flg & DONTPAGINATEONFIRSTSUBSTEP3X) > 0) XtraFlags.DontPaginateOnFirstSubstep3X = true.ToString(); + if ((flg & RNOSEPAFTERAER) > 0) XtraFlags.RNOSepAfterAER = true.ToString(); + if ((flg & REVDATEWITHFORWARDSLASH) > 0) XtraFlags.RevDateWithForwardSlash = true.ToString(); + if ((flg & USEALTERNATESTEPBOX) > 0) XtraFlags.UseAlternateStepBox = true.ToString(); + if ((flg & CANCELSECTITLESONS1) > 0) XtraFlags.CancelSecTitlesOnS1 = true.ToString(); + if ((flg & SPECIALSTEPSFOLDOUT) > 0) XtraFlags.SpecialStepsFoldout = true.ToString(); + if ((flg & UNDERLINEAFTERDASHSPACE) > 0) XtraFlags.UnderlineAfterDashSpace = true.ToString(); + if ((flg & NOSPACEINNOTEORCAUTION) > 0) XtraFlags.NoSpaceInNoteOrCaution = true.ToString(); + if ((flg & USEXTRAREVNUMBER) > 0) XtraFlags.UseXtraRevNumber = true.ToString(); + if ((flg & UNDERLINESETPOINTS) > 0) XtraFlags.UnderlineSetpoints = true.ToString(); + if ((flg & DOSECTIONTRANSTYPEB) > 0) XtraFlags.DoSectionTransTypeB = true.ToString(); + if ((flg & PAGINATEONLOWERSTEPLEVEL) > 0) XtraFlags.PaginateOnLowerStepLevel = true.ToString(); + if ((flg & USETRANSITIONMODIFIER) > 0) XtraFlags.UseTransitionModifier = true.ToString(); + } + else if (i == 8) + { + if ((flg & CUSTOMSPACING) > 0) XtraFlags.CustomSpacing = true.ToString(); + if ((flg & ENHANCEDSHORTFORMDEV) > 0) XtraFlags.EnhancedShortFormDev = true.ToString(); + if ((flg & PAGEBREAKONHIGHLEVELSTEP) > 0) XtraFlags.PageBreakOnHighLevelStep = true.ToString(); + if ((flg & PAGEBREAKONCAUTIONS) > 0) XtraFlags.PageBreakOnCautions = true.ToString(); + if ((flg & PAGEBREAKONNOTES) > 0) XtraFlags.PageBreakOnNotes = true.ToString(); + if ((flg & ALIGNNULLTABWSECTHEAD) > 0) XtraFlags.AlignNullTabWSectHead = true.ToString(); + if ((flg & DONTUSESECTITLES) > 0) XtraFlags.DontUseSecTitles = true.ToString(); + if ((flg & TEXTSUBFOLLOWSTEXTSTYLE) > 0) XtraFlags.TextSubFollowsTextStyle = true.ToString(); + if ((flg & TRANSPROCTITLEINPAREN) > 0) XtraFlags.TranProcTitleInParen = true.ToString(); + if ((flg & HARDSPTRANPROCNUMB) > 0) XtraFlags.HardSpTranProcNumb = true.ToString(); + if ((flg & TREATANDORASSEQUENTIAL) > 0) XtraFlags.TreatAndOrAsSequential = true.ToString(); + if ((flg & DONTSPLITSTEPINPRNTSTEP) > 0) XtraFlags.DontSplitStepInPrntStep = true.ToString(); + if ((flg & LINEABOVEUNDERSECTION) > 0) XtraFlags.LineAboveUnderSection = true.ToString(); + } + else if (i == 9) + { + if ((flg & PICAIGNOREFIVESIXTHS) > 0) XtraFlags.PicaIgnoreFiveSixths = true.ToString(); + if ((flg & SPACEFORNOSECNUMB) > 0) XtraFlags.SpaceFoRNOSecNumb = true.ToString(); + if ((flg & NONEDITABLESTEPS) > 0) XtraFlags.NonEditableSteps = true.ToString(); + if ((flg & BOXEDSUBSTEPS) > 0) XtraFlags.BoxedSubsteps = true.ToString(); + if ((flg & DONTNUMBERHIGHLEVELSTEPS) > 0) XtraFlags.DontNumberHighLevelSteps = true.ToString(); + if ((flg & NOSTEPNUMBERFORHIGHLEVELRNO) > 0) XtraFlags.NoStepNumberForHighLevelRNO = true.ToString(); + if ((flg & PROMPTFORCAUTINTYPE) > 0) XtraFlags.PromptForCautinType = true.ToString(); + if ((flg & CAUTION1SAMEROWASPARENT) > 0) XtraFlags.Caution1SameRowAsParent = true.ToString(); + if ((flg & WOLFCREEKBACKGROUNDFORMAT) > 0) XtraFlags.WolfCreekBackgroundFormat = true.ToString(); + if ((flg & ENHANCEDSTEPNUMFROMPREV) > 0) XtraFlags.EnhancedStepNumFromPrev = true.ToString(); + } + else if (i == 10) + { + if ((flg & CONTROLUNDERLINESTYLE) > 0) XtraFlags.ControlUnderlineStyle = true.ToString(); + if ((flg & MULTIPLECHANGEIDS) > 0) XtraFlags.MultipleChangeIds = true.ToString(); + if ((flg & USEMULTILINESECTIONTITLE) > 0) XtraFlags.UseMultiLineSectionTitle = true.ToString(); + if ((flg & PAGEBREAKONFIRSTBLANKLINE) > 0) XtraFlags.PageBreakOnFirstBlankLine = true.ToString(); + if ((flg & DONTPRINTNOTITLE) > 0) XtraFlags.DontPrintNoTitle = true.ToString(); + if ((flg & UNDSPECIALSTEPSFOLDOUT) > 0) XtraFlags.UndSpecialStepsFoldout = true.ToString(); + if ((flg & PUTONPAGEBYITSELF) > 0) XtraFlags.PutOnPageByItself = true.ToString(); + } + else if (i == 11) + { + if ((flg & SECTITLECONTINUE) > 0) XtraFlags.SecTitleContinue = true.ToString(); + if ((flg & CANCELSECTITLESONE0) > 0) XtraFlags.CancelSecTitlesOnE0 = true.ToString(); + if ((flg & METASECTENDMESSAGE) > 0) XtraFlags.MetaSectEndMessage = true.ToString(); + if ((flg & CANCELSECTITLESONE2) > 0) XtraFlags.CancelSecTitlesOnE2 = true.ToString(); + if ((flg & COMPRESSHPSUPER) > 0) XtraFlags.CompressHPSuper = true.ToString(); + } + else if (i == 12) + { + if ((flg & MATCHUPRNOCAUTNOTE) > 0) XtraFlags.MatchUpRNOCautNote = true.ToString(); + if ((flg & PAGINATEATHIGHESTPAGINLEVEL) > 0) XtraFlags.PaginateAtHighestPaginLevel = true.ToString(); + if ((flg & USELONGPROCTITLES) > 0) XtraFlags.UseLongProcTitles = true.ToString(); + if ((flg & SPECIALLANDSCAPEMODE) > 0) XtraFlags.SpecialLandscapeMode = true.ToString(); + if ((flg & RNOINPAGELIST) > 0) XtraFlags.RNOInPagelist = true.ToString(); + if ((flg & STPCAUTNOTETABINPAGELIST) > 0) XtraFlags.StpCautNoteTabInPagelist = true.ToString(); + if ((flg & READONLYTYPEINCONTMSG) > 0) XtraFlags.ReadOnlyTypeInContMsg = true.ToString(); + } + else if (i == 13) + { + if ((flg & CENTERONELINEONLY) > 0) XtraFlags.CenterOneLineOnly = true.ToString(); + if ((flg & TIETABTOLEVEL) > 0) XtraFlags.TieTabToLevel = true.ToString(); + if ((flg & ACCESSORYDOCSINDUPLEX) > 0) XtraFlags.AccessoryDocsInDuplex = true.ToString(); + if ((flg & FOLDOUTSINDUPLEX) > 0) XtraFlags.FoldoutsInDuplex = true.ToString(); + if ((flg & USESTEXTRAREALVALUE) > 0) XtraFlags.UseSTExtraRealValue = true.ToString(); + if ((flg & SUBTABLEGETSUP1LEVEL) > 0) XtraFlags.SubTableGetSup1Level = true.ToString(); + if ((flg & DONTCOUNTFOLDOUTPAGES) > 0) XtraFlags.DontCountFoldoutPages = true.ToString(); + if ((flg & SEARCHALLREPLACEWORDS) > 0) XtraFlags.SearchAllReplaceWords = true.ToString(); + } + else if (i == 14) + { + if ((flg & REMEMBERCAUTIONSANDNOTES) > 0) XtraFlags.RememberCautionsAndNotes = true.ToString(); + if ((flg & RTFADJUSTMENTS) > 0) XtraFlags.RtfAdjustments = true.ToString(); + if ((flg & CENTERONELINEADJUST) > 0) XtraFlags.CenterOneLineAdjust = true.ToString(); + if ((flg & COUNTALLSUBLEVELS) > 0) XtraFlags.CountAllSubLevels = true.ToString(); + if ((flg & DONTREPLACEWORDSINROS) > 0) XtraFlags.DontReplaceWordsInROs = true.ToString(); + if ((flg & HIGHLEVELRNOBEFOREAERSUBSTPS) > 0) XtraFlags.HighLevelRNOBeforeAERSubStps = true.ToString(); + if ((flg & UNDERLINEALLMETATITLES) > 0) XtraFlags.UnderlineAllMetaTitles = true.ToString(); + if ((flg & DONTBREAKCAUTIONSORNOTES) > 0) XtraFlags.DontBreakCautionsOrNotes = true.ToString(); + if ((flg & BOLDONLYSECTIONZERO) > 0) XtraFlags.BoldOnlySectionZero = true.ToString(); + if ((flg & DONTBREAKONRNO) > 0) XtraFlags.DontBreakOnRNO = true.ToString(); + if ((flg & RNOCHECKOFFSAMEASPARENT) > 0) XtraFlags.RNOCheckOffSameAsParent = true.ToString(); + if ((flg & USESTEPTYPEWIDTHOVERRRIDE) > 0) XtraFlags.UseStepTypeWidthOverride = true.ToString(); + if ((flg & WOLFCREEKCKLFORMAT) > 0) XtraFlags.WolfcreekCKLFormat = true.ToString(); + } + else if (i == 15) + { + if ((flg & DONTPAGINATEONFIRSTSUBSTEP2X) > 0) XtraFlags.DontPaginateOnFirstSubStep2X = true.ToString(); + if ((flg & USESTEPTYPEWIDTHOVERRRIDEEDITPRINT) > 0) XtraFlags.UseStepTypeWidthOverrideEditPrint = true.ToString(); + if ((flg & PARTIALSTEPCOMPRESSION) > 0) XtraFlags.PartialStepCompression = true.ToString(); + if ((flg & USESMARTTEMPLATE) > 0) XtraFlags.UseSmartTemplate = true.ToString(); + if ((flg & CHECKOFFONHLSONLY) > 0) XtraFlags.CheckoffOnHLSOnly = true.ToString(); + if ((flg & CAUTION2SAMEROWASPARENT) > 0) XtraFlags.Caution2SameRowAsParent = true.ToString(); + if ((flg & CENTERTEXTWITHINWIDTH) > 0) XtraFlags.CenterTextWithinWidth = true.ToString(); + if ((flg & DONTBREAKEQUIPMENTLIST) > 0) XtraFlags.DontBreakEquipmentList = true.ToString(); + if ((flg & ALWAYSTABCAUTION2) > 0) XtraFlags.AlwaysTabCaution2 = true.ToString(); + if ((flg & VIRTUALDOTINHLSTAB) > 0) XtraFlags.VirtualDotInHLSTab = true.ToString(); + if ((flg & IMPERFECTSTRUCTUREPLUS4) > 0) XtraFlags.ImperfectStructurePlus4 = true.ToString(); + } + else if (i == 16) + { + if ((flg & USERNOTYPEINACTABLE) > 0) XtraFlags.UseRNOTypeInActable = true.ToString(); + if ((flg & ABSOLUTETRANSITIONUPDATE) > 0) XtraFlags.AbsoluteTransitionUpdate = true.ToString(); + if ((flg & SEPARATEBOXCAUTIONS) > 0) XtraFlags.SeparateBoxCautions = true.ToString(); + if ((flg & HLSTEXTINPAGELIST) > 0) XtraFlags.HLSTextInPagelist = true.ToString(); + if ((flg & LOWERCASESTEPINTRAN) > 0) XtraFlags.LowerCaseStepInTran = true.ToString(); + if ((flg & CHANGEBARSONLINKEDTEXT) > 0) XtraFlags.ChangeBarsOnLinkedText = true.ToString(); + if ((flg & QUOTEDSUBSTEPS) > 0) XtraFlags.QuotedSubsteps = true.ToString(); + } + else if (i == 17) + { + if ((flg & OVERRIDEENHANCEDTABS) > 0) XtraFlags.OverrideEnhancedTabs = true.ToString(); + if ((flg & NONEWLINEAFTERRNO) > 0) XtraFlags.NoNewlineAfterRNO = true.ToString(); + if ((flg & DOSECTIONSEPARATORLINE) > 0) XtraFlags.DoSectionSeparatorLine = true.ToString(); + if ((flg & PARENSONEXTPAGENUMTRANS) > 0) XtraFlags.ParensOnExtPagenumTrans = true.ToString(); + if ((flg & ATLEASTTWODIGITSFORHLS) > 0) XtraFlags.AtLeastTwoDigitsForHLS = true.ToString(); + if ((flg & DONTBREAKOPTEQUIPMENTLIST) > 0) + XtraFlags.DontBreakOptEquipmentList = true.ToString(); + if ((flg & PAGELISTCHANGEIDSWITHCOMMAS) > 0) XtraFlags.PagelistChangeIDsWithCommas = true.ToString(); + if ((flg & DONTSTARTLINEWITHDASH) > 0) XtraFlags.DontStartLineWithDash = true.ToString(); + if ((flg & NOBLANKLINEBEFORESUBSTEP) > 0) XtraFlags.NoBlankLineBeforeSubstep = true.ToString(); if ((flg & DONTBREAKCAUTIONSNOTESONSUBSTPS) > 0) XtraFlags.DontBreakCautionsNotesOnSubstps = true.ToString(); if ((flg & DONTCONVERTCARETTODELTA) > 0) XtraFlags.DontConvertCaretToDelta = true.ToString(); } - else if (i == 18) - { - if ((flg & NORNO) > 0) XtraFlags.NoRNO = true.ToString(); - if ((flg & ONLYSINGLECOLUMN) > 0) XtraFlags.OnlySingleColumn = true.ToString(); - if ((flg & XCHNGTRANSPFORHARD) > 0) XtraFlags.XChngTranSpForHard = true.ToString(); - if ((flg & WOLFCREEKCKLBACKGNDFORMAT) > 0) XtraFlags.WolfcreekCKLBackgndFormat = true.ToString(); - } - } - #endregion - #region ReadInFile + else if (i == 18) + { + if ((flg & NORNO) > 0) XtraFlags.NoRNO = true.ToString(); + if ((flg & ONLYSINGLECOLUMN) > 0) XtraFlags.OnlySingleColumn = true.ToString(); + if ((flg & XCHNGTRANSPFORHARD) > 0) XtraFlags.XChngTranSpForHard = true.ToString(); + if ((flg & WOLFCREEKCKLBACKGNDFORMAT) > 0) XtraFlags.WolfcreekCKLBackgndFormat = true.ToString(); + } + } + #endregion + #region ReadInFile private float RowToPoints(int i) { return (i * 12); // row_in_points = input * 72/6, row = input * 12 @@ -2096,40 +2099,40 @@ namespace fmtxml int[] rtCheckOffGroups = new int[MAXSTEPS + 1]; private string _fmtFileName; private uint _PlantDefaultFontStyle; - public bool ReadInFmtFile(ref FormatData fmtdata, ref XtraFlgs XtraFlags, string fname) - { + public bool ReadInFmtFile(ref FormatData fmtdata, ref XtraFlgs XtraFlags, string fname) + { _fmtFileName = fname; - int[] tmpshort3 = new int[3]; - ArrayList stringoffsets = new ArrayList(); - byte tmpbyte; - Int16 tmpshort; - string tmpstr; - try - { - tmpshort = brFmt.ReadInt16(); - fmtdata.Name = GetStringUntilNull(brFmt); - for (int i = 0; i < 3; i++) - { - tmpshort = brFmt.ReadInt16(); - tmpstr = GetStringUntilNull(brFmt); - } + int[] tmpshort3 = new int[3]; + ArrayList stringoffsets = new ArrayList(); + byte tmpbyte; + Int16 tmpshort; + string tmpstr; + try + { + tmpshort = brFmt.ReadInt16(); + fmtdata.Name = GetStringUntilNull(brFmt); + for (int i = 0; i < 3; i++) + { + tmpshort = brFmt.ReadInt16(); + tmpstr = GetStringUntilNull(brFmt); + } - short vnum = brFmt.ReadInt16(); // number of ints, etc. - long posatints = brFmt.BaseStream.Position; - long tstloc = vnum + posatints; - fmtdata.FontData = new VE_Font(0); - #region LoadInts - tmpbyte = brFmt.ReadByte(); // FirstChar + short vnum = brFmt.ReadInt16(); // number of ints, etc. + long posatints = brFmt.BaseStream.Position; + long tstloc = vnum + posatints; + fmtdata.FontData = new VE_Font(0); + #region LoadInts + tmpbyte = brFmt.ReadByte(); // FirstChar - // NOTE 16bit had xtraflag as 18 & had a VEAIRFlag. VEAIRFlag actually - // had some flags used in other formats besides it, so these were rolled - // into the xtraflag array just to make conversion easier. - Int16[] xtraflag = new Int16[19]; - for (int i = 0; i < 19; i++) - { - xtraflag[i] = brFmt.ReadInt16(); + // NOTE 16bit had xtraflag as 18 & had a VEAIRFlag. VEAIRFlag actually + // had some flags used in other formats besides it, so these were rolled + // into the xtraflag array just to make conversion easier. + Int16[] xtraflag = new Int16[19]; + for (int i = 0; i < 19; i++) + { + xtraflag[i] = brFmt.ReadInt16(); AddFlags(ref XtraFlags, i, xtraflag[i]); - } + } // if this format has an associated PSI or TPL file, just read in the string & save // it. string otherfile = MyPath + @"\" + fname.Substring(0, fname.LastIndexOf(".")) + @".tpl"; @@ -2138,21 +2141,21 @@ namespace fmtxml // http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char otherfile = MyPath + @"\" + fname.Substring(0, fname.LastIndexOf(".")) + @".ini"; if (File.Exists(otherfile)) PsiIniToXml(ref fmtdata, otherfile); - fmtdata.PurchaseOptions = ((E_PurchaseOptions)brFmt.ReadInt16()).ToString(); + fmtdata.PurchaseOptions = ((E_PurchaseOptions)brFmt.ReadInt16()).ToString(); fmtdata.ProcData.ProcForeColor = "Black"; fmtdata.ProcData.ProcBackColor = "White"; - fmtdata.EditData = new GeneralEditor(); - fmtdata.EditData.EMode = ((E_EMode)brFmt.ReadInt16()).ToString(); - fmtdata.SectData = new Section(); + fmtdata.EditData = new GeneralEditor(); + fmtdata.EditData.EMode = ((E_EMode)brFmt.ReadInt16()).ToString(); + fmtdata.SectData = new Section(); fmtdata.SectData.SectForeColor = "Black"; fmtdata.SectData.SectBackColor = "White"; - fmtdata.SectData.StepSectionData = new StepSection(); + fmtdata.SectData.StepSectionData = new StepSection(); fmtdata.SectData.StepSectionData.TopRow = (Int16)(RowToPoints(brFmt.ReadInt16())); - tmpshort = brFmt.ReadInt16(); // Appendlines - not used. - fmtdata.PrintData = new GeneralPrint(); - fmtdata.PrintData.DoPrnDrvrAdjusts = brFmt.ReadInt16(); - fmtdata.StepData = new Step[MAXSTEPS+1]; // add 1 for the 'BASE' - for (int i = 0; i < MAXSTEPS+1; i++) + tmpshort = brFmt.ReadInt16(); // Appendlines - not used. + fmtdata.PrintData = new GeneralPrint(); + fmtdata.PrintData.DoPrnDrvrAdjusts = brFmt.ReadInt16(); + fmtdata.StepData = new Step[MAXSTEPS + 1]; // add 1 for the 'BASE' + for (int i = 0; i < MAXSTEPS + 1; i++) { fmtdata.StepData[i].Type = StepTypes[i]; fmtdata.StepData[i].ParentType = ParentTypes[i]; @@ -2166,7 +2169,7 @@ namespace fmtxml if (i > 1) { uint tmpuint = brFmt.ReadUInt32(); - if (i == 40 && tmpuint==0) // check if RNOtype's font = 0, if so use the plant default + if (i == 40 && tmpuint == 0) // check if RNOtype's font = 0, if so use the plant default { fmtdata.StepData[i].Font = new VE_Font(_PlantDefaultFontStyle); } @@ -2174,103 +2177,103 @@ namespace fmtxml fmtdata.StepData[i].Font = new VE_Font(tmpuint); } } - for (int i = 1; i < MAXSTEPS+1; i++) - { - Int16 tmpcoli = brFmt.ReadInt16(); - int tmpcol = (tmpcoli & 0x0F00) >> 8; - if (tmpcol > 0 && tmpcol < WinColors.Length) - fmtdata.StepData[i].StepLayoutData.ForeColor = WinColors[tmpcol]; - else - fmtdata.StepData[i].StepLayoutData.ForeColor = "Black"; - tmpcol = (tmpcoli & 0xF); - if (tmpcol > 0 && tmpcol < WinColors.Length) - fmtdata.StepData[i].StepLayoutData.BackColor = WinColors[tmpcol]; - else - fmtdata.StepData[i].StepLayoutData.BackColor = "White"; - } + for (int i = 1; i < MAXSTEPS + 1; i++) + { + Int16 tmpcoli = brFmt.ReadInt16(); + int tmpcol = (tmpcoli & 0x0F00) >> 8; + if (tmpcol > 0 && tmpcol < WinColors.Length) + fmtdata.StepData[i].StepLayoutData.ForeColor = WinColors[tmpcol]; + else + fmtdata.StepData[i].StepLayoutData.ForeColor = "Black"; + tmpcol = (tmpcoli & 0xF); + if (tmpcol > 0 && tmpcol < WinColors.Length) + fmtdata.StepData[i].StepLayoutData.BackColor = WinColors[tmpcol]; + else + fmtdata.StepData[i].StepLayoutData.BackColor = "White"; + } fmtdata.StepData[0].StepLayoutData.ForeColor = "Black"; fmtdata.StepData[0].StepLayoutData.BackColor = "White"; - for (int i = 1; i < MAXSTEPS+1; i++) fmtdata.StepData[i].StepLayoutData.STExtraSpace = (RowToPoints(brFmt.ReadInt16())).ToString(); + for (int i = 1; i < MAXSTEPS + 1; i++) fmtdata.StepData[i].StepLayoutData.STExtraSpace = (RowToPoints(brFmt.ReadInt16())).ToString(); for (int i = 1; i < MAXSTEPS + 1; i++) { Int16 itmp = brFmt.ReadInt16(); - if (fmtdata.StepData[i].Font != null && fmtdata.StepData[i].Font.IsBoxed) fmtdata.StepData[i].StepLayoutData.STBoxindex = (itmp+1).ToString(); + if (fmtdata.StepData[i].Font != null && fmtdata.StepData[i].Font.IsBoxed) fmtdata.StepData[i].StepLayoutData.STBoxindex = (itmp + 1).ToString(); } - // Read the tab indexes into a temporary array. Once the tab strings are read - // in the structure's data will be added. - Tabindx = new Int16[MAXSTEPS]; - for (int i = 0; i < MAXSTEPS; i++) Tabindx[i] = brFmt.ReadInt16(); + // Read the tab indexes into a temporary array. Once the tab strings are read + // in the structure's data will be added. + Tabindx = new Int16[MAXSTEPS]; + for (int i = 0; i < MAXSTEPS; i++) Tabindx[i] = brFmt.ReadInt16(); - for (int i = 1; i < MAXSTEPS+1; i++) - { - fmtdata.StepData[i].StepPrintData = new Print(); - fmtdata.StepData[i].StepPrintData.PosAdjust = ((Int16)(RowToPoints(brFmt.ReadInt16()))).ToString(); - } + for (int i = 1; i < MAXSTEPS + 1; i++) + { + fmtdata.StepData[i].StepPrintData = new Print(); + fmtdata.StepData[i].StepPrintData.PosAdjust = ((Int16)(RowToPoints(brFmt.ReadInt16()))).ToString(); + } - // NOTE a default is added for boxes for the default box for tables, if - // they are boxed. - fmtdata.BoxData = new Box[MAXBOXES+1]; - // convert these to points. Also, each set of data had 24, not 12 box fields, the - // second twelve for RTF. For now, I'm going to just skip these. They can be added in - // later + // NOTE a default is added for boxes for the default box for tables, if + // they are boxed. + fmtdata.BoxData = new Box[MAXBOXES + 1]; + // convert these to points. Also, each set of data had 24, not 12 box fields, the + // second twelve for RTF. For now, I'm going to just skip these. They can be added in + // later // Note that the box start (we think) and the box end locations used ELITE, at 12 characters per inch, // for locating the line draw/box drawing. for (int i = 1; i < MAXBOXES + 1; i++) fmtdata.BoxData[i].Start = ColToPoints(brFmt.ReadInt16(), CvtFont.CvtFont.ELITE); - for (int i = 1; i < MAXBOXES+1; i++) tmpshort = brFmt.ReadInt16(); + for (int i = 1; i < MAXBOXES + 1; i++) tmpshort = brFmt.ReadInt16(); for (int i = 1; i < MAXBOXES + 1; i++) fmtdata.BoxData[i].End = ColToPoints(brFmt.ReadInt16(), CvtFont.CvtFont.ELITE); - for (int i = 1; i < MAXBOXES+1; i++) tmpshort = brFmt.ReadInt16(); + for (int i = 1; i < MAXBOXES + 1; i++) tmpshort = brFmt.ReadInt16(); for (int i = 1; i < MAXBOXES + 1; i++) fmtdata.BoxData[i].TxtStart = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); - for (int i = 1; i < MAXBOXES+1; i++) tmpshort = brFmt.ReadInt16(); + for (int i = 1; i < MAXBOXES + 1; i++) tmpshort = brFmt.ReadInt16(); for (int i = 1; i < MAXBOXES + 1; i++) fmtdata.BoxData[i].TxtWidth = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); - for (int i = 1; i < MAXBOXES+1; i++) tmpshort = brFmt.ReadInt16(); - for (int i = 1; i < MAXBOXES+1; i++) fmtdata.BoxData[i].Height = RowToPoints(brFmt.ReadInt16()); - for (int i = 1; i < MAXBOXES+1; i++) tmpshort = brFmt.ReadInt16(); - for (int i = 1; i < MAXBOXES+1; i++) fmtdata.BoxData[i].TabPos = RowToPoints(brFmt.ReadInt16()); - for (int i = 1; i < MAXBOXES+1; i++) tmpshort = brFmt.ReadInt16(); - tmpshort = brFmt.ReadInt16(); // TransitionCautionOffset - for (int i = 1; i < MAXBOXES+1; i++) fmtdata.BoxData[i].Font = LoadVE_Font(); - int tmpint; - for (int i = 1; i < MAXBOXES+1; i++) tmpint = brFmt.ReadInt32(); - for (int i = 0; i < MAXTABS; i++) - { - VE_Font st = LoadVE_Font(); - if (i == 0) - { - fmtdata.StepData[0].TabData.Font = st == null ? null : st.Copy(); - fmtdata.StepData[0].TabData.Justify = st == null ? "None" : st.FontJustify; + for (int i = 1; i < MAXBOXES + 1; i++) tmpshort = brFmt.ReadInt16(); + for (int i = 1; i < MAXBOXES + 1; i++) fmtdata.BoxData[i].Height = RowToPoints(brFmt.ReadInt16()); + for (int i = 1; i < MAXBOXES + 1; i++) tmpshort = brFmt.ReadInt16(); + for (int i = 1; i < MAXBOXES + 1; i++) fmtdata.BoxData[i].TabPos = RowToPoints(brFmt.ReadInt16()); + for (int i = 1; i < MAXBOXES + 1; i++) tmpshort = brFmt.ReadInt16(); + tmpshort = brFmt.ReadInt16(); // TransitionCautionOffset + for (int i = 1; i < MAXBOXES + 1; i++) fmtdata.BoxData[i].Font = LoadVE_Font(); + int tmpint; + for (int i = 1; i < MAXBOXES + 1; i++) tmpint = brFmt.ReadInt32(); + for (int i = 0; i < MAXTABS; i++) + { + VE_Font st = LoadVE_Font(); + if (i == 0) + { + fmtdata.StepData[0].TabData.Font = st == null ? null : st.Copy(); + fmtdata.StepData[0].TabData.Justify = st == null ? "None" : st.FontJustify; if (st != null && st.FontCheckOff != "None") { - if (fmtdata.StepData[0].TabData.MacroList==null) fmtdata.StepData[0].TabData.MacroList = new COMacro[1]; + if (fmtdata.StepData[0].TabData.MacroList == null) fmtdata.StepData[0].TabData.MacroList = new COMacro[1]; fmtdata.StepData[0].TabData.MacroList[0].Name = "CHECKOFF"; fmtdata.StepData[0].TabData.MacroList[0].Macro = "C22"; - if (rtCheckOffGroups[0]!=0) fmtdata.StepData[0].TabData.MacroList[0].Grouping=rtCheckOffGroups[0].ToString(); + if (rtCheckOffGroups[0] != 0) fmtdata.StepData[0].TabData.MacroList[0].Grouping = rtCheckOffGroups[0].ToString(); } - for (int j = 0; j < MAXSTEPS; j++) - { - if (Tabindx[j] == -1) - { - fmtdata.StepData[j + 1].TabData.UsePreviousStyle = "True"; - fmtdata.StepData[j+1].TabData.Font = st == null ? null : st.Copy(); - fmtdata.StepData[j+1].TabData.Justify = st == null ? "None" : st.FontJustify; + for (int j = 0; j < MAXSTEPS; j++) + { + if (Tabindx[j] == -1) + { + fmtdata.StepData[j + 1].TabData.UsePreviousStyle = "True"; + fmtdata.StepData[j + 1].TabData.Font = st == null ? null : st.Copy(); + fmtdata.StepData[j + 1].TabData.Justify = st == null ? "None" : st.FontJustify; //fmtdata.StepData[j+1].TabData.CheckOff = st == null ? "None" : st.FontCheckOff; - + if (st != null && st.FontCheckOff != "None") { fmtdata.StepData[j + 1].TabData.MacroList = new COMacro[1]; fmtdata.StepData[j + 1].TabData.MacroList[0].Name = "CHECKOFF"; - fmtdata.StepData[j + 1].TabData.MacroList[0].Macro = st.FontCheckOff=="Right" ? "C22":"M20"; + fmtdata.StepData[j + 1].TabData.MacroList[0].Macro = st.FontCheckOff == "Right" ? "C22" : "M20"; if (rtCheckOffGroups[j + 1] != 0) fmtdata.StepData[j + 1].TabData.MacroList[0].Grouping = rtCheckOffGroups[j + 1].ToString(); } - } - } - } - for (int j = 0; j < MAXSTEPS; j++) - { + } + } + } + for (int j = 0; j < MAXSTEPS; j++) + { if (Tabindx[j] == i) { - fmtdata.StepData[j+1].TabData.Font = st == null ? null : st.Copy(); - fmtdata.StepData[j+1].TabData.Justify = st == null ? "None" : st.FontJustify; + fmtdata.StepData[j + 1].TabData.Font = st == null ? null : st.Copy(); + fmtdata.StepData[j + 1].TabData.Justify = st == null ? "None" : st.FontJustify; //fmtdata.StepData[j+1].TabData.CheckOff = st == null ? "None" : st.FontCheckOff; if (st != null && st.FontCheckOff != "None") { @@ -2280,120 +2283,120 @@ namespace fmtxml //if (rtCheckOffGroups[j + 1] != 0) fmtdata.StepData[j + 1].TabData.MacroList[0].Grouping = rtCheckOffGroups[j + 1]; } } - } - } - for (int i = 1; i < MAXSTEPS+1; i++) - { - fmtdata.StepData[i].StepEditData.AcTable = ((E_AccStep)brFmt.ReadInt16()).ToString(); - if (fmtdata.StepData[i].StepEditData.AcTable == "0") - fmtdata.StepData[i].StepEditData.AcTable = null; - } + } + } + for (int i = 1; i < MAXSTEPS + 1; i++) + { + fmtdata.StepData[i].StepEditData.AcTable = ((E_AccStep)brFmt.ReadInt16()).ToString(); + if (fmtdata.StepData[i].StepEditData.AcTable == "0") + fmtdata.StepData[i].StepEditData.AcTable = null; + } for (int i = 1; i < MAXSTEPS + 1; i++) fmtdata.StepData[i].StepLayoutData.EveryNLines = (brFmt.ReadInt16()).ToString(); for (int i = 1; i < MAXSTEPS + 1; i++) fmtdata.StepData[i].StepLayoutData.SpaceBefore = "0"; for (int i = 1; i < MAXSTEPS + 1; i++) fmtdata.StepData[i].StepLayoutData.SpaceAfter = (RowToPoints(1)).ToString(); for (int i = 1; i < MAXSTEPS + 1; i++) fmtdata.StepData[i].StepLayoutData.AlwaysUpperCase = (brFmt.ReadInt16()).ToString(); - fmtdata.SectData.StepSectionData.StpSectLayData = new StepSectionLayout(); - fmtdata.SectData.StepSectionData.StpSectLayData.TopOfPage = new TopOfPg(); - fmtdata.SectData.StepSectionData.StpSectLayData.TopOfPage.Font = LoadVE_Font(); - fmtdata.SectData.StepSectionData.StpSectLayData.TopOfPage.Row = RowToPoints(brFmt.ReadInt16()); + fmtdata.SectData.StepSectionData.StpSectLayData = new StepSectionLayout(); + fmtdata.SectData.StepSectionData.StpSectLayData.TopOfPage = new TopOfPg(); + fmtdata.SectData.StepSectionData.StpSectLayData.TopOfPage.Font = LoadVE_Font(); + fmtdata.SectData.StepSectionData.StpSectLayData.TopOfPage.Row = RowToPoints(brFmt.ReadInt16()); fmtdata.SectData.StepSectionData.StpSectLayData.TopOfPage.Col = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); - fmtdata.SectData.StepSectionData.StpSectPrtData = new StepSectionPrint(); - fmtdata.SectData.StepSectionData.StpSectPrtData.ModifiedTextStyle = LoadVE_Font(); - fmtdata.SectData.StepSectionData.StpSectLayData.Separator = new Separtr(); - fmtdata.SectData.StepSectionData.StpSectLayData.Separator.Font = LoadVE_Font(); - fmtdata.SectData.StepSectionData.StpSectLayData.Separator.SeparatorLocation = brFmt.ReadInt16(); + fmtdata.SectData.StepSectionData.StpSectPrtData = new StepSectionPrint(); + fmtdata.SectData.StepSectionData.StpSectPrtData.ModifiedTextStyle = LoadVE_Font(); + fmtdata.SectData.StepSectionData.StpSectLayData.Separator = new Separtr(); + fmtdata.SectData.StepSectionData.StpSectLayData.Separator.Font = LoadVE_Font(); + fmtdata.SectData.StepSectionData.StpSectLayData.Separator.SeparatorLocation = brFmt.ReadInt16(); for (int i = 1; i < MAXSTEPS + 1; i++) fmtdata.StepData[i].StepLayoutData.PageBreakAtTypeChange = (brFmt.ReadInt16()).ToString(); - fmtdata.SectData.StepSectionData.StpSectLayData.LastLineToStartStep = RowToPoints(brFmt.ReadInt16()); - - /* To do TextTypeValue - not sure how this is used & where to store it, so temporarily read it in */ - //fmtdata.SectData.StepSectionData.TextTypeValue = new Int16[10]; + fmtdata.SectData.StepSectionData.StpSectLayData.LastLineToStartStep = RowToPoints(brFmt.ReadInt16()); + + /* To do TextTypeValue - not sure how this is used & where to store it, so temporarily read it in */ + //fmtdata.SectData.StepSectionData.TextTypeValue = new Int16[10]; //for (int i = 0; i < 10; i++) fmtdata.SectData.StepSectionData.TextTypeValue[i] = brFmt.ReadInt16(); - Int16[]TextTypeValue = new Int16[10]; - for (int i = 0; i < 10; i++) TextTypeValue[i] = brFmt.ReadInt16(); + Int16[] TextTypeValue = new Int16[10]; + for (int i = 0; i < 10; i++) TextTypeValue[i] = brFmt.ReadInt16(); - for (int i = 0; i < 10; i++) tmpint = brFmt.ReadInt32(); // DontPrintInSection - not used. + for (int i = 0; i < 10; i++) tmpint = brFmt.ReadInt32(); // DontPrintInSection - not used. - tmpshort = brFmt.ReadInt16(); // LeftMarginReset - not used. - tmpshort = brFmt.ReadInt16(); // OmitErgEopUsage - not used. + tmpshort = brFmt.ReadInt16(); // LeftMarginReset - not used. + tmpshort = brFmt.ReadInt16(); // OmitErgEopUsage - not used. - fmtdata.SectData.StepSectionData.StpSectLayData.LineDrawingOption = brFmt.ReadInt16(); + fmtdata.SectData.StepSectionData.StpSectLayData.LineDrawingOption = brFmt.ReadInt16(); fmtdata.SectData.StepSectionData.StpSectLayData.ColS = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); - fmtdata.SectData.StepSectionData.StpSectEditData = new StepSectionEdit(); + fmtdata.SectData.StepSectionData.StpSectEditData = new StepSectionEdit(); fmtdata.SectData.StepSectionData.StpSectEditData.ColSScreenAdj = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); fmtdata.SectData.StepSectionData.StpSectEditData.ScrnAdjRNOText = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); - fmtdata.SectData.StepSectionData.StpSectLayData.ColT = ColToPoints(brFmt.ReadInt16(),0); - tmpshort = brFmt.ReadInt16(); // Coltincr - not used - tmpshort = brFmt.ReadInt16(); // ColTab - not used + fmtdata.SectData.StepSectionData.StpSectLayData.ColT = ColToPoints(brFmt.ReadInt16(), 0); + tmpshort = brFmt.ReadInt16(); // Coltincr - not used + tmpshort = brFmt.ReadInt16(); // ColTab - not used fmtdata.SectData.StepSectionData.StpSectLayData.ColAbs = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); fmtdata.SectData.StepSectionData.StpSectLayData.WidT = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); - tmpshort = brFmt.ReadInt16(); // WidTab - not used. - fmtdata.SectData.StepSectionData.StpSectLayData.PMode = brFmt.ReadInt16(); + tmpshort = brFmt.ReadInt16(); // WidTab - not used. + fmtdata.SectData.StepSectionData.StpSectLayData.PMode = brFmt.ReadInt16(); - fmtdata.SectData.StepSectionData.StpSectLayData.MaxRNO = brFmt.ReadInt16(); + fmtdata.SectData.StepSectionData.StpSectLayData.MaxRNO = brFmt.ReadInt16(); - // maxrnotable, colrtable, widstable, and colrscreen all have three values. - for (int i = 0; i < 3; i++) tmpshort3[i] = brFmt.ReadInt16(); - tmpstr = string.Format("{0},{1},{2}", tmpshort3[0], tmpshort3[1], tmpshort3[2]); - fmtdata.SectData.StepSectionData.StpSectLayData.MaxRNOTable = tmpstr; + // maxrnotable, colrtable, widstable, and colrscreen all have three values. + for (int i = 0; i < 3; i++) tmpshort3[i] = brFmt.ReadInt16(); + tmpstr = string.Format("{0},{1},{2}", tmpshort3[0], tmpshort3[1], tmpshort3[2]); + fmtdata.SectData.StepSectionData.StpSectLayData.MaxRNOTable = tmpstr; float[] tmpfloat = new float[3]; for (int i = 0; i < 3; i++) tmpfloat[i] = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); tmpstr = string.Format("{0},{1},{2}", tmpfloat[0], tmpfloat[1], tmpfloat[2]); - fmtdata.SectData.StepSectionData.StpSectLayData.ColRTable = tmpstr; + fmtdata.SectData.StepSectionData.StpSectLayData.ColRTable = tmpstr; float[] tmpfloata = new float[3]; - for (int i = 0; i < 3; i++) - { + for (int i = 0; i < 3; i++) + { tmpfloat[i] = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); tmpfloata[i] = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); - } + } tmpstr = string.Format("{0},{1},{2}", tmpfloat[0], tmpfloat[1], tmpfloat[2]); - fmtdata.SectData.StepSectionData.StpSectLayData.WidSTableEdit = tmpstr; + fmtdata.SectData.StepSectionData.StpSectLayData.WidSTableEdit = tmpstr; tmpstr = string.Format("{0},{1},{2}", tmpfloata[0], tmpfloata[1], tmpfloata[2]); - fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = tmpstr; + fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = tmpstr; for (int i = 0; i < 3; i++) tmpfloat[i] = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); tmpstr = string.Format("{0},{1},{2}", tmpfloat[0], tmpfloat[1], tmpfloat[2]); - fmtdata.SectData.StepSectionData.StpSectEditData.ColRScreen = tmpstr; + fmtdata.SectData.StepSectionData.StpSectEditData.ColRScreen = tmpstr; fmtdata.SectData.StepSectionData.StpSectLayData.AdjRNOCol = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); - ChangeBar cb = new ChangeBar(); - - cb.ChangeBarMessage = ((E_ChangeBarMessage)brFmt.ReadUInt16()).ToString(); + ChangeBar cb = new ChangeBar(); - cb.FixedChangeColumn = brFmt.ReadInt16(); - cb.FixedAERChangeColumn = brFmt.ReadByte(); + cb.ChangeBarMessage = ((E_ChangeBarMessage)brFmt.ReadUInt16()).ToString(); - //read in a number of format items that are not supported... - for (int i = 0; i < 3; i++) tmpshort3[i] = brFmt.ReadInt16(); // BD_PageNumOnCover - not used. + cb.FixedChangeColumn = brFmt.ReadInt16(); + cb.FixedAERChangeColumn = brFmt.ReadByte(); - tmpshort = brFmt.ReadInt16(); // VESearchLeftMargin - not used (same for rest that list varname. - tmpshort = brFmt.ReadInt16(); // VEStdPrtLeftMarE - tmpshort = brFmt.ReadInt16(); // VEStdPrtLeftMarP + //read in a number of format items that are not supported... + for (int i = 0; i < 3; i++) tmpshort3[i] = brFmt.ReadInt16(); // BD_PageNumOnCover - not used. - int tmplong = brFmt.ReadInt32(); // ImperfectSTructureSepStyle - tmpshort = brFmt.ReadInt16(); // FormsLPI - tmplong = brFmt.ReadInt32(); // FormsStyle - tmplong = brFmt.ReadInt32(); // FormsBoxStyle - tmpshort = brFmt.ReadInt16(); // FormsMargin - tmpshort = brFmt.ReadInt16(); // ChangeSummaryLPI + tmpshort = brFmt.ReadInt16(); // VESearchLeftMargin - not used (same for rest that list varname. + tmpshort = brFmt.ReadInt16(); // VEStdPrtLeftMarE + tmpshort = brFmt.ReadInt16(); // VEStdPrtLeftMarP - cb.ChangeSummaryStyle = brFmt.ReadInt32(); // this may be moved into a different struct - cb.ChangeBarStyle = brFmt.ReadInt32(); + int tmplong = brFmt.ReadInt32(); // ImperfectSTructureSepStyle + tmpshort = brFmt.ReadInt16(); // FormsLPI + tmplong = brFmt.ReadInt32(); // FormsStyle + tmplong = brFmt.ReadInt32(); // FormsBoxStyle + tmpshort = brFmt.ReadInt16(); // FormsMargin + tmpshort = brFmt.ReadInt16(); // ChangeSummaryLPI + + cb.ChangeSummaryStyle = brFmt.ReadInt32(); // this may be moved into a different struct + cb.ChangeBarStyle = brFmt.ReadInt32(); fmtdata.ProcData.ChangeBarData = cb; - for (int i = 0; i < 30; i++) tmpshort = brFmt.ReadInt16(); // XPosition + for (int i = 0; i < 30; i++) tmpshort = brFmt.ReadInt16(); // XPosition - fmtdata.ProcData.TitleLength = brFmt.ReadInt16(); - fmtdata.ProcData.CoverTitleLength = brFmt.ReadInt16(); + fmtdata.ProcData.TitleLength = brFmt.ReadInt16(); + fmtdata.ProcData.CoverTitleLength = brFmt.ReadInt16(); - fmtdata.ProcData.CheckOffData = new CheckOffData(); + fmtdata.ProcData.CheckOffData = new CheckOffData(); // for the Base format, set the Default Change bar locations from hardcoded // data in the 16-bit program: (ovrchgbr.c) if (!HasBase) fmtdata.ProcData.ChangeBarData.DefaultCBLoc = "0,85,-85,-3"; @@ -2404,66 +2407,66 @@ namespace fmtxml } int DefaultCheckOffType = (rightCheckOffBox[2] > 0) ? rightCheckOffBox[2] : rightCheckOffBox[3] >> 8; fmtdata.ProcData.CheckOffData.AllowSectEdit = DefaultCheckOffType == 1 || (rightCheckOffBox[0] > 0 || rightCheckOffBox[1] > 0) ? "True" : "False"; - fmtdata.ProcData.CheckOffData.AllowStepEdit = DefaultCheckOffType>=1?"True":"False"; - tmpshort = brFmt.ReadInt16(); // TwoCheckOffs - fmtdata.ProcData.CheckOffData.CheckOffList = new CheckOff[MAXCHECKOFFS]; - for (int i = 0; i < MAXCHECKOFFS; i++) fmtdata.ProcData.CheckOffData.CheckOffList[i].Index = i; - for (int i = 0; i < MAXCHECKOFFS; i++) fmtdata.ProcData.CheckOffData.CheckOffList[i].UIMark = brFmt.ReadByte(); - for (int i = 0; i < MAXCHECKOFFS; i++) fmtdata.ProcData.CheckOffData.CheckOffList[i].CheckOffXtraLines = brFmt.ReadByte(); // CheckOffXtraLines + fmtdata.ProcData.CheckOffData.AllowStepEdit = DefaultCheckOffType >= 1 ? "True" : "False"; + tmpshort = brFmt.ReadInt16(); // TwoCheckOffs + fmtdata.ProcData.CheckOffData.CheckOffList = new CheckOff[MAXCHECKOFFS]; + for (int i = 0; i < MAXCHECKOFFS; i++) fmtdata.ProcData.CheckOffData.CheckOffList[i].Index = i; + for (int i = 0; i < MAXCHECKOFFS; i++) fmtdata.ProcData.CheckOffData.CheckOffList[i].UIMark = brFmt.ReadByte(); + for (int i = 0; i < MAXCHECKOFFS; i++) fmtdata.ProcData.CheckOffData.CheckOffList[i].CheckOffXtraLines = brFmt.ReadByte(); // CheckOffXtraLines for (int i = 0; i < MAXCHECKOFFS; i++) fmtdata.ProcData.CheckOffData.CheckOffList[i].CheckOffWidAdjust = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle); for (int i = 0; i < MAXCHECKOFFS; i++) tmpbyte = brFmt.ReadByte(); // CheckOffFeatures - fmtdata.ProcData.CheckOffData.CheckOffHeaderList = new CheckOffHeader[MAXCHKHEADINGS]; - for (int i = 0; i < MAXCHKHEADINGS; i++) fmtdata.ProcData.CheckOffData.CheckOffHeaderList[i].Index = i; - for (int i = 0; i < MAXCHKHEADINGS; i++) fmtdata.ProcData.CheckOffData.CheckOffHeaderList[i].Font = LoadVE_Font(); - fmtdata.ProcData.CheckOffData.UseCheckOffsIn = brFmt.ReadInt32(); - tmplong = (int)brFmt.ReadUInt32(); + fmtdata.ProcData.CheckOffData.CheckOffHeaderList = new CheckOffHeader[MAXCHKHEADINGS]; + for (int i = 0; i < MAXCHKHEADINGS; i++) fmtdata.ProcData.CheckOffData.CheckOffHeaderList[i].Index = i; + for (int i = 0; i < MAXCHKHEADINGS; i++) fmtdata.ProcData.CheckOffData.CheckOffHeaderList[i].Font = LoadVE_Font(); + fmtdata.ProcData.CheckOffData.UseCheckOffsIn = brFmt.ReadInt32(); + tmplong = (int)brFmt.ReadUInt32(); fmtdata.SectData.StepSectionData.StpSectLayData.EndMessagePos = brFmt.ReadInt16(); - tmpshort = brFmt.ReadInt16(); // CenterTableAdjustment - tmpshort = brFmt.ReadInt16(); // NumberOfLinesForNoteOrCaution + tmpshort = brFmt.ReadInt16(); // CenterTableAdjustment + tmpshort = brFmt.ReadInt16(); // NumberOfLinesForNoteOrCaution - //for (int i = 0; i < MAXSEQ; i++) fmtdata.SectData.StepSectionData.SeqStart[i] = brFmt.ReadByte(); + //for (int i = 0; i < MAXSEQ; i++) fmtdata.SectData.StepSectionData.SeqStart[i] = brFmt.ReadByte(); fmtdata.SectData.StepSectionData.SequentialTabFormat = new SeqTabFmt[MAXSEQ]; for (int i = 0; i < MAXSEQ; i++) { fmtdata.SectData.StepSectionData.SequentialTabFormat[i].TabFormat = ConvertSeqStart(brFmt.ReadByte()); } - //fmtdata.SectData.StepSectionData.HighSeqStart = brFmt.ReadByte(); + //fmtdata.SectData.StepSectionData.HighSeqStart = brFmt.ReadByte(); tmpbyte = brFmt.ReadByte(); // HighSeqStart fmtdata.SectData.StepSectionData.IndentToken = brFmt.ReadByte(); fmtdata.SectData.StepSectionData.StpSectPrtData.ImmStepHdrCol = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); - fmtdata.SectData.StepSectionData.StpSectPrtData.ImmStepHdrStyle = LoadVE_Font(); + fmtdata.SectData.StepSectionData.StpSectPrtData.ImmStepHdrStyle = LoadVE_Font(); - ReplaceStr[] repstr = new ReplaceStr[MAXREPLACE]; - fmtdata.SectData.ReplaceStrData = repstr; - for (int i = 0; i < 60; i++) repstr[i].Flag = ((E_ReplaceStr)brFmt.ReadUInt32()).ToString(); + ReplaceStr[] repstr = new ReplaceStr[MAXREPLACE]; + fmtdata.SectData.ReplaceStrData = repstr; + for (int i = 0; i < 60; i++) repstr[i].Flag = ((E_ReplaceStr)brFmt.ReadUInt32()).ToString(); - for (int i = 0; i < 2; i++) tmpshort3[i] = brFmt.ReadInt16(); - tmpstr = string.Format("{0},{1}", tmpshort3[0], tmpshort3[1]); - fmtdata.SectData.StepSectionData.StpSectLayData.RNOWidthAlt = tmpstr; - fmtdata.SectData.StepSectionData.StpSectLayData.HLSWidthOVRD = brFmt.ReadInt16(); - fmtdata.SectData.StepSectionData.StpSectPrtData.SecColHdrforActPMode = brFmt.ReadInt16(); + for (int i = 0; i < 2; i++) tmpshort3[i] = brFmt.ReadInt16(); + tmpstr = string.Format("{0},{1}", tmpshort3[0], tmpshort3[1]); + fmtdata.SectData.StepSectionData.StpSectLayData.RNOWidthAlt = tmpstr; + fmtdata.SectData.StepSectionData.StpSectLayData.HLSWidthOVRD = brFmt.ReadInt16(); + fmtdata.SectData.StepSectionData.StpSectPrtData.SecColHdrforActPMode = brFmt.ReadInt16(); - for (int i = 0; i < MAXSTEPS+1; i++) fmtdata.StepData[i].Index = i; - for (int i = 1; i < MAXSTEPS+1; i++) fmtdata.StepData[i].StepLayoutData.AlignWithParentTab = (brFmt.ReadByte()).ToString(); + for (int i = 0; i < MAXSTEPS + 1; i++) fmtdata.StepData[i].Index = i; + for (int i = 1; i < MAXSTEPS + 1; i++) fmtdata.StepData[i].StepLayoutData.AlignWithParentTab = (brFmt.ReadByte()).ToString(); - fmtdata.SectData.SectionNumber = new SectionNum(); - fmtdata.SectData.SectionHeader = new SectionHead(); - fmtdata.SectData.SectionNumber.Font = LoadVE_Font(); - fmtdata.SectData.SectionHeader.Font = LoadVE_Font(); + fmtdata.SectData.SectionNumber = new SectionNum(); + fmtdata.SectData.SectionHeader = new SectionHead(); + fmtdata.SectData.SectionNumber.Font = LoadVE_Font(); + fmtdata.SectData.SectionHeader.Font = LoadVE_Font(); fmtdata.SectData.SectionNumber.Pos = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); fmtdata.SectData.SectionNumber.Just = ((E_PageStructMod)brFmt.ReadByte()).ToString(); fmtdata.SectData.SectionHeader.Pos = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle); fmtdata.SectData.SectionHeader.Just = ((E_PageStructMod)brFmt.ReadByte()).ToString(); - for (int i = 0; i < 10; i++) tmpbyte = brFmt.ReadByte(); // SecLevelDelta - fmtdata.SectData.SectionTitleLength = brFmt.ReadInt16(); - tmpshort = brFmt.ReadInt16(); + for (int i = 0; i < 10; i++) tmpbyte = brFmt.ReadByte(); // SecLevelDelta + fmtdata.SectData.SectionTitleLength = brFmt.ReadInt16(); + tmpshort = brFmt.ReadInt16(); - rtCheckOffGroups[0]=0; - for (int i = 1; i < MAXSTEPS+1; i++) rtCheckOffGroups[i] = (brFmt.ReadInt16()); - for (int i = 1; i < MAXSTEPS + 1; i++) + rtCheckOffGroups[0] = 0; + for (int i = 1; i < MAXSTEPS + 1; i++) rtCheckOffGroups[i] = (brFmt.ReadInt16()); + for (int i = 1; i < MAXSTEPS + 1; i++) { // if the grouping is > 0, then use the 'right check off' macro WHEN there // are more than rtCheckOffGroups[i] of the step type. @@ -2478,234 +2481,238 @@ namespace fmtxml fmtdata.StepData[i].TabData.MacroList[0].Grouping = rtCheckOffGroups[i].ToString(); } } - for (int i = 0; i < 100; i++) tmpshort = brFmt.ReadInt16(); // TypeGroups - for (int i = 0; i < 20; i++) tmpshort = brFmt.ReadInt16(); // EnhancedSubTypes; + for (int i = 0; i < 100; i++) tmpshort = brFmt.ReadInt16(); // TypeGroups + for (int i = 0; i < 20; i++) tmpshort = brFmt.ReadInt16(); // EnhancedSubTypes; - fmtdata.SectData.StepSectionData.StpSectLayData.SubPaginationWght = brFmt.ReadInt16(); - fmtdata.SectData.StepSectionData.StpSectLayData.TextTitleAdjustment = brFmt.ReadInt16(); + fmtdata.SectData.StepSectionData.StpSectLayData.SubPaginationWght = brFmt.ReadInt16(); + fmtdata.SectData.StepSectionData.StpSectLayData.TextTitleAdjustment = brFmt.ReadInt16(); - for (int i = 1; i < MAXSTEPS+1; i++) tmpshort = brFmt.ReadInt16(); // STAfterLines + for (int i = 1; i < MAXSTEPS + 1; i++) tmpshort = brFmt.ReadInt16(); // STAfterLines - fmtdata.TransData.TransTypeData = new TransTypes[MAXTRANS]; + fmtdata.TransData.TransTypeData = new TransTypes[MAXTRANS]; for (int i = 0; i < MAXTRANS; i++) { fmtdata.TransData.TransTypeData[i].TransType = brFmt.ReadByte(); if (i < 6 && fmtdata.TransData.TransTypeData[i].TransType == 0) fmtdata.TransData.TransTypeData[i].TransType = (byte)i; } - for (int i = 0; i < MAXTRANS; i++) tmpbyte = brFmt.ReadByte(); // TransMode - for (int i = 0; i < MAXTRANS; i++) tmpbyte = brFmt.ReadByte(); // OutsideTransType + for (int i = 0; i < MAXTRANS; i++) tmpbyte = brFmt.ReadByte(); // TransMode + for (int i = 0; i < MAXTRANS; i++) tmpbyte = brFmt.ReadByte(); // OutsideTransType for (int i = 0; i < MAXSTEPS; i++) fmtdata.StepData[i].StepLayoutData.StepTypeWidthOverride = (ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle)).ToString(); - // auto table of contents data - AccSection accsec = new AccSection(); + // auto table of contents data + AccSection accsec = new AccSection(); - TOC toc = new TOC(); + TOC toc = new TOC(); toc.TofCSecNumPos = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle); toc.TofCSecTitlePos = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle); - tmpbyte = brFmt.ReadByte(); // TofCSecTitlePos2 - toc.TofCSecTitleLen = brFmt.ReadByte(); + tmpbyte = brFmt.ReadByte(); // TofCSecTitlePos2 + toc.TofCSecTitleLen = brFmt.ReadByte(); toc.TofCPageNumPos = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle); - toc.TofCSpaceChar = brFmt.ReadByte(); - toc.TofCLineSpacing = brFmt.ReadByte(); - toc.Font = LoadVE_FontByte(); ; - accsec.TableOfContentsData = toc; - for (int i = 0; i < MAXSTEPS; i++) tmpbyte = brFmt.ReadByte(); + toc.TofCSpaceChar = brFmt.ReadByte(); + toc.TofCLineSpacing = brFmt.ReadByte(); + toc.Font = LoadVE_FontByte(); ; + accsec.TableOfContentsData = toc; + for (int i = 0; i < MAXSTEPS; i++) tmpbyte = brFmt.ReadByte(); - fmtdata.ProcData.CheckOffData.CheckOffAdjustment = brFmt.ReadSByte(); + fmtdata.ProcData.CheckOffData.CheckOffAdjustment = brFmt.ReadSByte(); - tmpshort = brFmt.ReadInt16(); // ColsAdjustInS2 - tmpbyte = brFmt.ReadByte(); // SeriesTitleLength; + tmpshort = brFmt.ReadInt16(); // ColsAdjustInS2 + tmpbyte = brFmt.ReadByte(); // SeriesTitleLength; - for (int i = 1; i < MAXSTEPS+1; i++) - { - sbyte[] vp = new sbyte[15]; - for (int j = 0; j < 15; j++) vp[j] = brFmt.ReadSByte(); - bool hasdata = false; - for (int j = 0; j < 15; j++) - { - if (vp[j] != '\0') - { - hasdata = true; - break; - } - } - if (!hasdata) - fmtdata.StepData[i].VertPos = null; - else + for (int i = 1; i < MAXSTEPS + 1; i++) + { + sbyte[] vp = new sbyte[15]; + for (int j = 0; j < 15; j++) vp[j] = brFmt.ReadSByte(); + bool hasdata = false; + for (int j = 0; j < 15; j++) + { + if (vp[j] != '\0') + { + hasdata = true; + break; + } + } + if (!hasdata) + fmtdata.StepData[i].VertPos = null; + else { fmtdata.StepData[i].VertPos = null; - for (int j = 0; j<15; j++) - fmtdata.StepData[i].VertPos = fmtdata.StepData[i].VertPos + string.Format("{0},",vp[j]); + for (int j = 0; j < 15; j++) + fmtdata.StepData[i].VertPos = fmtdata.StepData[i].VertPos + string.Format("{0},", vp[j]); fmtdata.StepData[i].VertPos = fmtdata.StepData[i].VertPos.Substring(0, fmtdata.StepData[i].VertPos.Length - 1); // remove last "," } - } - fmtdata.SectData.StepSectionData.StpSectLayData.VertStyle = LoadVE_Font(); - + } + fmtdata.SectData.StepSectionData.StpSectLayData.VertStyle = LoadVE_Font(); + sbyte[] tmpbyte3 = new sbyte[3]; for (int i = 0; i < 3; i++) tmpbyte3[i] = brFmt.ReadSByte(); tmpstr = string.Format("{0}, {1}, {2}", tmpbyte3[0], tmpbyte3[1], tmpbyte3[2]); fmtdata.SectData.StepSectionData.StpSectLayData.TableCenterPos = tmpstr; - //short[] tmpint9 = new short[9]; + //short[] tmpint9 = new short[9]; //for (int i = 0; i < 9; i++) tmpint9[i] = brFmt.ReadInt16(); //tmpstr = string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8}", tmpint9[0], tmpint9[1], tmpint9[2], tmpint9[3], tmpint9[4], tmpint9[5], tmpint9[6], tmpint9[7], tmpint9[8]); //fmtdata.SectData.StepSectionData.LeftJustSeqTab = tmpstr; for (int i = 0; i < MAXSEQ; i++) fmtdata.SectData.StepSectionData.SequentialTabFormat[i].Index = i; for (int i = 0; i < MAXSEQ; i++) fmtdata.SectData.StepSectionData.SequentialTabFormat[i].LeftJustify = brFmt.ReadInt16(); - MetaSection[] metsects = new MetaSection[10]; - fmtdata.SectData.MetaSectionData = metsects; - for (int i = 0; i < 10; i++) metsects[i].Index = i; + MetaSection[] metsects = new MetaSection[10]; + fmtdata.SectData.MetaSectionData = metsects; + for (int i = 0; i < 10; i++) metsects[i].Index = i; for (int i = 0; i < 10; i++) metsects[i].SecNumPositionAdj = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle); for (int i = 0; i < 10; i++) metsects[i].SecTitlePositionAdj = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle); for (int i = 0; i < 10; i++) metsects[i].ColSByLevel = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle); for (int i = 0; i < 10; i++) metsects[i].TofCPositionAdj = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle); for (int i = 0; i < 10; i++) metsects[i].WidSAdjByLevel = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle); - fmtdata.SectData.StepSectionData.NumberOfHighLevelSteps = brFmt.ReadByte(); + fmtdata.SectData.StepSectionData.NumberOfHighLevelSteps = brFmt.ReadByte(); - for (int i = 0; i < MAXBOXES+1; i++) fmtdata.BoxData[i].Index = i; - for (int i = 1; i < MAXBOXES+1; i++) fmtdata.BoxData[i].TxtRowAdj = brFmt.ReadSByte(); - for (int i = 1; i < MAXBOXES+1; i++) tmpshort = brFmt.ReadByte(); + for (int i = 0; i < MAXBOXES + 1; i++) fmtdata.BoxData[i].Index = i; + for (int i = 1; i < MAXBOXES + 1; i++) fmtdata.BoxData[i].TxtRowAdj = brFmt.ReadSByte(); + for (int i = 1; i < MAXBOXES + 1; i++) tmpshort = brFmt.ReadByte(); for (int i = 1; i < MAXSTEPS + 1; i++) fmtdata.StepData[i].StepTypeColOverride = (ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle)).ToString(); - fmtdata.SectData.StepSectionData.NumberOfSubStepTypes = brFmt.ReadByte(); + fmtdata.SectData.StepSectionData.NumberOfSubStepTypes = brFmt.ReadByte(); - accsec.AutoContActSumSection = brFmt.ReadInt32(); - fmtdata.SectData.AccSectionData = accsec; - #endregion - #region LoadStrings - long floc = brFmt.BaseStream.Position; - ////////////////// - // STRINGS NOW - ///////////////// + accsec.AutoContActSumSection = brFmt.ReadInt32(); + fmtdata.SectData.AccSectionData = accsec; + #endregion + #region LoadStrings + long floc = brFmt.BaseStream.Position; + ////////////////// + // STRINGS NOW + ///////////////// - brFmt.BaseStream.Seek(tstloc, SeekOrigin.Begin); - short numstr = brFmt.ReadInt16(); - short len = brFmt.ReadInt16(); - byte[] input = GetByteArray(brFmt, len); + brFmt.BaseStream.Seek(tstloc, SeekOrigin.Begin); + short numstr = brFmt.ReadInt16(); + short len = brFmt.ReadInt16(); + byte[] input = GetByteArray(brFmt, len); - // now load in the offset info for data. - // read in the offsets from the begining of tmpstr - // this allows us to conserve on memory because duplicate strings - // will only be held once - // - Int16[] offset = new Int16[numstr]; - int indx; - for (int i = 0; i < numstr; i++) offset[i] = brFmt.ReadInt16(); + // now load in the offset info for data. + // read in the offsets from the begining of tmpstr + // this allows us to conserve on memory because duplicate strings + // will only be held once + // + Int16[] offset = new Int16[numstr]; + int indx; + for (int i = 0; i < numstr; i++) offset[i] = brFmt.ReadInt16(); - // Add the default box characters to be used. - fmtdata.BoxData[0].BXULC = ConvertText("\x0DA"); - fmtdata.BoxData[0].BXHorz = ConvertText("\x0C4"); - fmtdata.BoxData[0].BXURC = ConvertText("\x0BF"); - fmtdata.BoxData[0].BXVert = ConvertText("\x0B3"); - fmtdata.BoxData[0].BXMLS = ConvertText("\x0C3"); - fmtdata.BoxData[0].BXMRS = ConvertText("\x0B4"); - fmtdata.BoxData[0].BXLLC = ConvertText("\x0C0"); - fmtdata.BoxData[0].BXLRC = ConvertText("\x0D9"); - fmtdata.BoxData[0].BXMID = ConvertText("\x0C5"); - fmtdata.BoxData[0].BXUMID = ConvertText("\x0C2"); - fmtdata.BoxData[0].BXLMID = ConvertText("\x0C1"); + // Add the default box characters to be used. + fmtdata.BoxData[0].BXULC = ConvertText("\x0DA"); + fmtdata.BoxData[0].BXHorz = ConvertText("\x0C4"); + fmtdata.BoxData[0].BXURC = ConvertText("\x0BF"); + fmtdata.BoxData[0].BXVert = ConvertText("\x0B3"); + fmtdata.BoxData[0].BXMLS = ConvertText("\x0C3"); + fmtdata.BoxData[0].BXMRS = ConvertText("\x0B4"); + fmtdata.BoxData[0].BXLLC = ConvertText("\x0C0"); + fmtdata.BoxData[0].BXLRC = ConvertText("\x0D9"); + fmtdata.BoxData[0].BXMID = ConvertText("\x0C5"); + fmtdata.BoxData[0].BXUMID = ConvertText("\x0C2"); + fmtdata.BoxData[0].BXLMID = ConvertText("\x0C1"); - // using offsets, get data & put into fields. - int arcnt = 1; // use this to count into offset array for data. - for (int i = 1; i < MAXBOXES+1; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXURC = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXHorz = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXULC = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXVert = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXMLS = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXMRS = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXLRC = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXLLC = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXMID = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXLHorz = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXUMID = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.BoxData[i].BXLMID = GetStringFromByte(input, indx); - } + // using offsets, get data & put into fields. + int arcnt = 1; // use this to count into offset array for data. + for (int i = 1; i < MAXBOXES + 1; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXURC = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXHorz = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXULC = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXVert = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXMLS = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXMRS = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXLRC = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXLLC = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXMID = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXLHorz = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXUMID = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.BoxData[i].BXLMID = GetStringFromByte(input, indx); + } - // increment arcnt by 144 because there were 24 box possibilities in the - // 16bit the second 12 were rtf - arcnt = arcnt + 144; + // increment arcnt by 144 because there were 24 box possibilities in the + // 16bit the second 12 were rtf + arcnt = arcnt + 144; - //tabs - string[,] tabstrings = new string[MAXTABS, 2]; - for (int i = 0; i < MAXTABS; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) tabstrings[i, 0] = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) tabstrings[i, 1] = GetStringFromByte(input, indx); - } - for (int i = 0; i < MAXSTEPS; i++) - { + //tabs + string[,] tabstrings = new string[MAXTABS, 2]; + for (int i = 0; i < MAXTABS; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) tabstrings[i, 0] = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) tabstrings[i, 1] = GetStringFromByte(input, indx); + } + for (int i = 0; i < MAXSTEPS; i++) + { for (int j = 0; j < MAXTABS; j++) { if (Tabindx[i] == j) { - fmtdata.StepData[i+1].TabData.IdentEdit = DoTabs(fmtdata.StepData[i].TabData.Font, fmtdata.PurchaseOptions, i, tabstrings[j, 0], true); - fmtdata.StepData[i+1].TabData.IdentEditWid = CalculateTabWid(tabstrings[j, 0]).ToString(); + fmtdata.StepData[i + 1].TabData.IdentEdit = DoTabs(fmtdata.StepData[i].TabData.Font, fmtdata.PurchaseOptions, i, tabstrings[j, 0], true); + fmtdata.StepData[i + 1].TabData.IdentEditWid = CalculateTabWid(tabstrings[j, 0]).ToString(); fmtdata.StepData[i + 1].TabData.Ident = DoTabs(fmtdata.StepData[i].TabData.Font, fmtdata.PurchaseOptions, i, tabstrings[j, 1], true); - fmtdata.StepData[i+1].TabData.IdentWid = CalculateTabWid(tabstrings[j, 1]).ToString(); + fmtdata.StepData[i + 1].TabData.IdentWid = CalculateTabWid(tabstrings[j, 1]).ToString(); break; } } - } + } - // separators - for (int i = 1; i < MAXSTEPS+1; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.StepData[i].Sep = DoReplaceTokens(GetStringFromByte(input, indx)); - } + // separators + for (int i = 1; i < MAXSTEPS + 1; i++) + { + indx = offset[arcnt]; + arcnt++; + // differentiate between and empty string and null. An empty string is used to put out + // blank lines. A null string means there is not any separator, thus use the string "{Null}" + // so that inheritance tests can show a difference between having a separator and not having one. + if (indx > 0) fmtdata.StepData[i].Sep = DoReplaceTokens(GetStringFromByte(input, indx)); + else fmtdata.StepData[i].Sep = "{Null}"; + } - // Step prefix & suffix - for (int i = 1; i < MAXSTEPS+1; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.StepData[i].Prefix = DoReplaceTokens(GetStringFromByte(input, indx)); - } - for (int i = 1; i < MAXSTEPS+1; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.StepData[i].Suffix = DoReplaceTokens(GetStringFromByte(input, indx)); - } + // Step prefix & suffix + for (int i = 1; i < MAXSTEPS + 1; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.StepData[i].Prefix = DoReplaceTokens(GetStringFromByte(input, indx)); + } + for (int i = 1; i < MAXSTEPS + 1; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.StepData[i].Suffix = DoReplaceTokens(GetStringFromByte(input, indx)); + } - // IdentB & SeqTab - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.IdentB = GetStringFromByte(input, indx); + // IdentB & SeqTab + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.IdentB = GetStringFromByte(input, indx); for (int i = 0; i < MAXSEQ; i++) { indx = offset[arcnt]; @@ -2738,90 +2745,90 @@ namespace fmtxml fmtdata.SectData.StepSectionData.SequentialTabFormat[i].TabFormat = null; //if (indx > 0) fmtdata.SectData.StepSectionData.SequentialTabFormat[i].TabFormat = fmtdata.SectData.StepSectionData.SequentialTabFormat[i].TabFormat + GetStringFromByte(input, indx); } - // replace word strings - for (int i = 0; i < MAXREPLACE; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) repstr[i].ReplaceWord = DoReplaceTokens(GetStringFromByteNoConvert(input, indx)); - } - for (int i = 0; i < MAXREPLACE; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) repstr[i].ReplaceWith = DoReplaceTokens(GetStringFromByte(input, indx)); - } + // replace word strings + for (int i = 0; i < MAXREPLACE; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) repstr[i].ReplaceWord = DoReplaceTokens(GetStringFromByteNoConvert(input, indx)); + } + for (int i = 0; i < MAXREPLACE; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) repstr[i].ReplaceWith = DoReplaceTokens(GetStringFromByte(input, indx)); + } - // various proc matching/data - ProcDescr[] pd = new ProcDescr[10]; - for (int i = 0; i < 10; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) pd[i].MatchProcNumber = GetStringFromByte(input, indx); - } + // various proc matching/data + ProcDescr[] pd = new ProcDescr[10]; + for (int i = 0; i < 10; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) pd[i].MatchProcNumber = GetStringFromByte(input, indx); + } - for (int i = 0; i < 10; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) pd[i].ProcDescr1 = GetStringFromByte(input, indx); - } + for (int i = 0; i < 10; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) pd[i].ProcDescr1 = GetStringFromByte(input, indx); + } - for (int i = 0; i < 10; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) pd[i].ProcDescr2 = GetStringFromByte(input, indx); - } - fmtdata.PrintData.ProcDescrList = pd; + for (int i = 0; i < 10; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) pd[i].ProcDescr2 = GetStringFromByte(input, indx); + } + fmtdata.PrintData.ProcDescrList = pd; - string[] Versid = new string[5]; - for (int i = 0; i < 5; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) Versid[i] = GetStringFromByte(input, indx); - } - fmtdata.PrintData.VersionIdText = Versid; + string[] Versid = new string[5]; + for (int i = 0; i < 5; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) Versid[i] = GetStringFromByte(input, indx); + } + fmtdata.PrintData.VersionIdText = Versid; - // a few transition strings - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.TransData.DelimiterForTransitionTitle = GetStringFromByte(input, indx); + // a few transition strings + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.TransData.DelimiterForTransitionTitle = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.TransData.StepSubstepDelimeter = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.TransData.StepSubstepDelimeter = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; + indx = offset[arcnt]; + arcnt++; // Replace the ò with a blank, one of the formats (cpla - robinson) used this to flag // an underline for step numbers in transitions, but this format is no longer used. if (indx > 0) fmtdata.TransData.ThroughString = GetStringFromByte(input, indx).Replace('ò', ' '); - // procedure suffix data - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.ProcData.ProcedureSuffixFlags = GetStringFromByte(input, indx); + // procedure suffix data + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.ProcData.ProcedureSuffixFlags = GetStringFromByte(input, indx); - fmtdata.ProcData.ProcedureSuffix = new string[10]; - for (int i = 0; i < 10; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.ProcData.ProcedureSuffix[i] = GetStringFromByte(input, indx); - } + fmtdata.ProcData.ProcedureSuffix = new string[10]; + for (int i = 0; i < 10; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.ProcData.ProcedureSuffix[i] = GetStringFromByte(input, indx); + } - // PlantDnLoad not used - skip it. - arcnt++; + // PlantDnLoad not used - skip it. + arcnt++; - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.PrintData.TopOfPageThing = DoReplaceTokens(GetStringFromByte(input, indx)); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.PrintData.TopOfPageThing = DoReplaceTokens(GetStringFromByte(input, indx)); - // not used: xtitle[3][10] - skip 30 - arcnt = arcnt + 30; + // not used: xtitle[3][10] - skip 30 + arcnt = arcnt + 30; for (int i = 0; i < MAXSTEPS + 1; i++) { @@ -2846,7 +2853,7 @@ namespace fmtxml //{ //fmtdata.StepData[i].StepEditData.TypeMenu.RnoInMenu = true.ToString(); fmtdata.StepData[i].StepEditData.TypeMenu.RnoMenuItem = "Without Border"; - + //} //else if (fmtdata.StepData[i].Type == "AERTable" || fmtdata.StepData[i].Type == "BorderlessAERTable" || fmtdata.StepData[i].Type == "AERFigure" || fmtdata.StepData[i].Type == "BorderlessAERFigure") // fmtdata.StepData[i].StepEditData.TypeMenu.RnoInMenu = false.ToString(); @@ -2856,10 +2863,10 @@ namespace fmtxml // Set up the text type fields - these are used to define what types of steps the current step // can be changed to.. _AlternateIndex = null; - int [] tmparray={0,0,0,0,0,0,0,0,0,0}; + int[] tmparray ={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; for (int i = 0; i < 10; i++) { - + indx = offset[arcnt]; arcnt++; if (indx > 0) @@ -2869,8 +2876,8 @@ namespace fmtxml // here for now to see this!. //if (fmtdata.StepData[TextTypeValue[i] + 1].StepEditData.TypeMenu.MenuItem != null && fmtdata.StepData[TextTypeValue[i] + 1].StepEditData.TypeMenu.MenuItem != tmpstring) // Console.WriteLine("different name, " + fmtdata.StepData[TextTypeValue[i] + 1].StepEditData.TypeMenu.MenuItem + ", " + tmpstring); - fmtdata.StepData[TextTypeValue[i]+1].StepEditData.TypeMenu.MenuItem = tmpstring; - + fmtdata.StepData[TextTypeValue[i] + 1].StepEditData.TypeMenu.MenuItem = tmpstring; + _AlternateIndex = (_AlternateIndex == null) ? fmtdata.StepData[TextTypeValue[i] + 1].Type : _AlternateIndex + "," + fmtdata.StepData[TextTypeValue[i] + 1].Type; //fmtdata.SectData.StepSectionData.TextType[i] = GetStringFromByte(input, indx); } @@ -2891,66 +2898,66 @@ namespace fmtxml } } } - // not used, SectionsToPrint - 10; SectionNumberMask - 10; SectionsToPrintTitle - 10; - // DocumentTitleExtensions - 10; DocumentFixFileExtensions - 10; + // not used, SectionsToPrint - 10; SectionNumberMask - 10; SectionsToPrintTitle - 10; + // DocumentTitleExtensions - 10; DocumentFixFileExtensions - 10; - arcnt = arcnt + 50; + arcnt = arcnt + 50; - // some seqtab data. - string [] tmpSeqStrings = new string[MAXSEQ]; - for (int i = 0; i < MAXSEQ; i++) - { - tmpSeqStrings[i] = fmtdata.SectData.StepSectionData.SequentialTabFormat[i].TabFormat; - indx = offset[arcnt]; - arcnt++; - if (indx > 0) // PreSeqTab - Edit - fmtdata.SectData.StepSectionData.SequentialTabFormat[i].TabFormat = GetStringFromByte(input, indx) + tmpSeqStrings[i]; - indx = offset[arcnt]; - arcnt++; - if (indx > 0) // PreSeqTab - Print - fmtdata.SectData.StepSectionData.SequentialTabFormat[i].PrintTabFormat = GetStringFromByte(input, indx).Replace("\x08","{0x08}") + tmpSeqStrings[i]; - else - fmtdata.SectData.StepSectionData.SequentialTabFormat[i].PrintTabFormat = tmpSeqStrings[i]; - //tmpstr = GetStringFromByte(input, indx).Replace("\x08", ""); - } - for (int i = 0; i < MAXSEQ; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) // PostSeqTab - Edit - fmtdata.SectData.StepSectionData.SequentialTabFormat[i].TabFormat += GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) // PostSeqTab - Print - fmtdata.SectData.StepSectionData.SequentialTabFormat[i].PrintTabFormat += GetStringFromByte(input, indx); - } + // some seqtab data. + string[] tmpSeqStrings = new string[MAXSEQ]; + for (int i = 0; i < MAXSEQ; i++) + { + tmpSeqStrings[i] = fmtdata.SectData.StepSectionData.SequentialTabFormat[i].TabFormat; + indx = offset[arcnt]; + arcnt++; + if (indx > 0) // PreSeqTab - Edit + fmtdata.SectData.StepSectionData.SequentialTabFormat[i].TabFormat = GetStringFromByte(input, indx) + tmpSeqStrings[i]; + indx = offset[arcnt]; + arcnt++; + if (indx > 0) // PreSeqTab - Print + fmtdata.SectData.StepSectionData.SequentialTabFormat[i].PrintTabFormat = GetStringFromByte(input, indx).Replace("\x08", "{0x08}") + tmpSeqStrings[i]; + else + fmtdata.SectData.StepSectionData.SequentialTabFormat[i].PrintTabFormat = tmpSeqStrings[i]; + //tmpstr = GetStringFromByte(input, indx).Replace("\x08", ""); + } + for (int i = 0; i < MAXSEQ; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) // PostSeqTab - Edit + fmtdata.SectData.StepSectionData.SequentialTabFormat[i].TabFormat += GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) // PostSeqTab - Print + fmtdata.SectData.StepSectionData.SequentialTabFormat[i].PrintTabFormat += GetStringFromByte(input, indx); + } - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.StpSectPrtData.RNOSepString = DoReplaceTokens(GetStringFromByte(input, indx)); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.StpSectPrtData.RNOSepString = DoReplaceTokens(GetStringFromByte(input, indx)); - fmtdata.SectData.StepSectionData.UnderlineTerminate = new string[10]; - for (int i = 0; i < 10; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.UnderlineTerminate[i] = GetStringFromByte(input, indx); - } + fmtdata.SectData.StepSectionData.UnderlineTerminate = new string[10]; + for (int i = 0; i < 10; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.UnderlineTerminate[i] = GetStringFromByte(input, indx); + } - fmtdata.SectData.StepSectionData.StpSectPrtData.ImmStepHdr = new string[2]; - for (int i = 0; i < 2; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.StpSectPrtData.ImmStepHdr[i] = GetStringFromByte(input, indx); - } - for (int i = 0; i < 5; i++) - { - indx = offset[arcnt]; - arcnt++; + fmtdata.SectData.StepSectionData.StpSectPrtData.ImmStepHdr = new string[2]; + for (int i = 0; i < 2; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.StpSectPrtData.ImmStepHdr[i] = GetStringFromByte(input, indx); + } + for (int i = 0; i < 5; i++) + { + indx = offset[arcnt]; + arcnt++; if (indx > 0) fmtdata.StepData[this.altsteps[i]].StepEditData.TypeMenu.MenuItem = GetStringFromByte(input, indx); //if (indx > 0) fmtdata.StepData[TextTypeValue[i]].StepEditData.TypeMenu.MenuItem = GetStringFromByte(input, indx); - } + } string mytmp = null; for (int i = 0; i < 16; i++) { @@ -2959,56 +2966,56 @@ namespace fmtxml if (indx > 0) fmtdata.StepData[this.altsubsteps[i]].StepEditData.TypeMenu.MenuItem = GetStringFromByte(input, indx); } - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.ProcData.ChangeBarData.SpecialChangeBar = DoReplaceTokens(GetStringFromByte(input, indx)); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.ProcData.ChangeBarData.SpecialChangeBar = DoReplaceTokens(GetStringFromByte(input, indx)); - // not used - ImperfectStructureSeparator - arcnt++; + // not used - ImperfectStructureSeparator + arcnt++; - fmtdata.SectData.StepSectionData.ObserveNCString1 = new string[4]; - fmtdata.SectData.StepSectionData.ObserveNCString2 = new string[4]; - for (int i = 0; i < 4; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.ObserveNCString1[i] = DoReplaceTokens(GetStringFromByteNoConvert(input, indx)); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.ObserveNCString2[i] = DoReplaceTokens(GetStringFromByteNoConvert(input, indx)); - } + fmtdata.SectData.StepSectionData.ObserveNCString1 = new string[4]; + fmtdata.SectData.StepSectionData.ObserveNCString2 = new string[4]; + for (int i = 0; i < 4; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.ObserveNCString1[i] = DoReplaceTokens(GetStringFromByteNoConvert(input, indx)); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.ObserveNCString2[i] = DoReplaceTokens(GetStringFromByteNoConvert(input, indx)); + } - for (int i = 1; i < MAXSTEPS+1; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) + for (int i = 1; i < MAXSTEPS + 1; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.StepData[i].UnderlineTheseChar = GetStringFromByte(input, indx); - } + } - // not used - SubScriptTheseChar - arcnt++; + // not used - SubScriptTheseChar + arcnt++; - bool hasMenuItem=false; - for (int i = 0; i < MAXCHECKOFFS; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) + bool hasMenuItem = false; + for (int i = 0; i < MAXCHECKOFFS; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) { fmtdata.ProcData.CheckOffData.CheckOffList[i].MenuItem = GetStringFromByte(input, indx); hasMenuItem = true; } - } + } if (hasMenuItem) { fmtdata.ProcData.CheckOffData.Menu = "Checkoff"; - for (int i=0; i< MAXCHECKOFFS; i++) - if (i>1) fmtdata.ProcData.CheckOffData.CheckOffList[i].Macro = "C"+i.ToString(); + for (int i = 0; i < MAXCHECKOFFS; i++) + if (i > 1) fmtdata.ProcData.CheckOffData.CheckOffList[i].Macro = "C" + i.ToString(); } // add signoff menuitems which are Endabled/Disabled & also Menu - if (rightCheckOffBox[0] != 0 && rightCheckOffBox[1] != 0) + if (rightCheckOffBox[0] != 0 && rightCheckOffBox[1] != 0) { fmtdata.ProcData.CheckOffData.Menu = "Signoff"; fmtdata.ProcData.CheckOffData.CheckOffList[0].Index = 0; @@ -3016,7 +3023,7 @@ namespace fmtxml fmtdata.ProcData.CheckOffData.CheckOffList[0].Macro = "C1"; fmtdata.ProcData.CheckOffData.CheckOffList[1].Index = 1; fmtdata.ProcData.CheckOffData.CheckOffList[1].MenuItem = "Disabled"; - if (rightCheckOffBox[0]==-2 && rightCheckOffBox[1]==-2) fmtdata.ProcData.CheckOffData.SkipSpaces="true"; + if (rightCheckOffBox[0] == -2 && rightCheckOffBox[1] == -2) fmtdata.ProcData.CheckOffData.SkipSpaces = "true"; else { fmtdata.ProcData.CheckOffData.LayoutList[0].RnoLevel = "0"; @@ -3025,59 +3032,59 @@ namespace fmtxml fmtdata.ProcData.CheckOffData.LayoutList[0].Column = rightCheckOffBox[1]; } } - for (int i = 0; i < MAXCHKHEADINGS; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.ProcData.CheckOffData.CheckOffHeaderList[i].CheckOffHeading = DoReplaceTokens(GetStringFromByte(input, indx)); - } + for (int i = 0; i < MAXCHKHEADINGS; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.ProcData.CheckOffData.CheckOffHeaderList[i].CheckOffHeading = DoReplaceTokens(GetStringFromByte(input, indx)); + } - // not used - WindEditFile - arcnt++; + // not used - WindEditFile + arcnt++; - indx = offset[arcnt]; - arcnt++; - if (indx > 0) tmpstr = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) tmpstr = GetStringFromByte(input, indx); - // not used - RNOPreSeqTab[9][2] - arcnt = arcnt + 18; + // not used - RNOPreSeqTab[9][2] + arcnt = arcnt + 18; - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.StpSectPrtData.HLStpSeparatorString = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.StpSectPrtData.HLStpSeparatorString = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.StpSectPrtData.HLRNOStpSeparatorString = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.StpSectPrtData.HLRNOStpSeparatorString = GetStringFromByte(input, indx); - for (int i = 0; i < MAXTABS; i++) - { - indx = offset[arcnt]; - arcnt++; - if (indx > 0) tabstrings[i, 0] = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) tabstrings[i, 1] = GetStringFromByte(input, indx); - } - for (int i = 0; i < MAXSTEPS; i++) - { + for (int i = 0; i < MAXTABS; i++) + { + indx = offset[arcnt]; + arcnt++; + if (indx > 0) tabstrings[i, 0] = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) tabstrings[i, 1] = GetStringFromByte(input, indx); + } + for (int i = 0; i < MAXSTEPS; i++) + { for (int j = 0; j < MAXTABS; j++) { if (Tabindx[i] == j) { - fmtdata.StepData[i + 1].TabData.RNOIdentEdit = DoTabs(fmtdata.StepData[i].TabData.Font, fmtdata.PurchaseOptions, i, tabstrings[j, 0], fmtdata.StepData[i].StepNumberForHighLevel=="True"); + fmtdata.StepData[i + 1].TabData.RNOIdentEdit = DoTabs(fmtdata.StepData[i].TabData.Font, fmtdata.PurchaseOptions, i, tabstrings[j, 0], fmtdata.StepData[i].StepNumberForHighLevel == "True"); fmtdata.StepData[i + 1].TabData.RNOIdentEditWid = CalculateTabWid(tabstrings[j, 0]).ToString(); fmtdata.StepData[i + 1].TabData.RNOIdent = DoTabs(fmtdata.StepData[i].TabData.Font, fmtdata.PurchaseOptions, i, tabstrings[j, 1], fmtdata.StepData[i].StepNumberForHighLevel == "True"); fmtdata.StepData[i + 1].TabData.RNOIdentWid = CalculateTabWid(tabstrings[j, 1]).ToString(); break; } } - } + } + + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.StpSectLayData.LowerLimitDivisor = GetStringFromByte(input, indx); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.StpSectLayData.LowerLimitDivisor = GetStringFromByte(input, indx); - // If the DoSectionTrans flag is set, use DefaultSectionTransStr for defaults, // otherwise use the DefaultTransStr. The DoSectionTransTypeB flags just // replaces the [5] item in the DefaultSectionTransStr array. I'll reset @@ -3093,10 +3100,10 @@ namespace fmtxml DefaultSectionTransTokenStr[5] = DefaultSectionTransStrTypeBNone; DefaultSectionTransFormatStr[5] = DefaultSectionTransStrTypeBNone; } - + // If the plant uses the TransProcTitleInParen flag, then place parens // around the proc & section titles. - if (XtraFlags.TranProcTitleInParen=="True") + if (XtraFlags.TranProcTitleInParen == "True") { DefaultTransStr[0] = "{Proc Num} ({Proc Title}) Step {First Step}"; DefaultTransStr[3] = "{First Step} thru {Last Step} of {Proc Num} ({Proc Title}) ({Sect Hdr})"; @@ -3147,90 +3154,90 @@ namespace fmtxml } } } - //arcnt = arcnt + MAXTRANS; + //arcnt = arcnt + MAXTRANS; - // not used OutsideTransFmt & OutsideTransMenu - arcnt = arcnt + (MAXTRANS * 2); + // not used OutsideTransFmt & OutsideTransMenu + arcnt = arcnt + (MAXTRANS * 2); - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.StpSectLayData.NonLinkedStepNumber = GetStringFromByte(input, indx); + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.StpSectLayData.NonLinkedStepNumber = GetStringFromByte(input, indx); - //not used BldLstFile - arcnt++; - // AltPrintTBIdent (20 items) - //arcnt += MAXTABS; - for (int j = 0; j < MAXTABS; j++) - { - indx = offset[arcnt]; - arcnt++; - if (indx != 0) - { - string ts = GetStringFromByte(input, indx); - for (int i = 0; i < MAXSTEPS; i++) - { - if (Tabindx[i] == j) - { - fmtdata.StepData[i + 1].TabData.IdentAltPrint = ts; - break; - } - } - } - } - - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.StpSectLayData.NonLinkedCautNoteNumber = GetStringFromByte(input, indx); - - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.PrintData.DuplexBGDirectory = GetStringFromByte(input, indx); - - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.PrintData.DuplexDDDirectory = GetStringFromByte(input, indx); - - indx = offset[arcnt]; - arcnt++; - if (indx > 0) fmtdata.SectData.StepSectionData.StpSectLayData.NonLinkedRNONumber = GetStringFromByte(input, indx); - - #endregion - } - catch (Exception ex) - { - Console.WriteLine("Error on read - format = {0}", fmtdata.Name); - Console.WriteLine(ex.Message); - Console.WriteLine(); - return false; - } - return AdjustFlags(ref fmtdata, ref XtraFlags); - } - - /// - /// Replace invalid characters with a special sequence - /// - /// - /// - private string FixXmlString(string str) - { - // http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char - // http://cse-mjmcl.cse.bris.ac.uk/blog/2007/02/14/1171465494443.html - // The regular expression below find any invalid characters - // by looking for characters that are not valid - MatchCollection matches = Regex.Matches(str,@"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD]"); - int lastIndex = 0; - StringBuilder sb = new StringBuilder(); - int len = str.Length; - foreach (Match match in matches) + //not used BldLstFile + arcnt++; + // AltPrintTBIdent (20 items) + //arcnt += MAXTABS; + for (int j = 0; j < MAXTABS; j++) { - sb.Append(str.Substring(lastIndex, match.Index-lastIndex)); - foreach (char c in match.Value) - sb.Append(string.Format("[({0:X04}])", (int)c)); - lastIndex = match.Index + match.Length; + indx = offset[arcnt]; + arcnt++; + if (indx != 0) + { + string ts = GetStringFromByte(input, indx); + for (int i = 0; i < MAXSTEPS; i++) + { + if (Tabindx[i] == j) + { + fmtdata.StepData[i + 1].TabData.IdentAltPrint = ts; + break; + } + } + } } - sb.Append(str.Substring(lastIndex)); - return sb.ToString(); + + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.StpSectLayData.NonLinkedCautNoteNumber = GetStringFromByte(input, indx); + + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.PrintData.DuplexBGDirectory = GetStringFromByte(input, indx); + + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.PrintData.DuplexDDDirectory = GetStringFromByte(input, indx); + + indx = offset[arcnt]; + arcnt++; + if (indx > 0) fmtdata.SectData.StepSectionData.StpSectLayData.NonLinkedRNONumber = GetStringFromByte(input, indx); + + #endregion } + catch (Exception ex) + { + Console.WriteLine("Error on read - format = {0}", fmtdata.Name); + Console.WriteLine(ex.Message); + Console.WriteLine(); + return false; + } + return AdjustFlags(ref fmtdata, ref XtraFlags); + } + + /// + /// Replace invalid characters with a special sequence + /// + /// + /// + private string FixXmlString(string str) + { + // http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char + // http://cse-mjmcl.cse.bris.ac.uk/blog/2007/02/14/1171465494443.html + // The regular expression below find any invalid characters + // by looking for characters that are not valid + MatchCollection matches = Regex.Matches(str, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD]"); + int lastIndex = 0; + StringBuilder sb = new StringBuilder(); + int len = str.Length; + foreach (Match match in matches) + { + sb.Append(str.Substring(lastIndex, match.Index - lastIndex)); + foreach (char c in match.Value) + sb.Append(string.Format("[({0:X04}])", (int)c)); + lastIndex = match.Index + match.Length; + } + sb.Append(str.Substring(lastIndex)); + return sb.ToString(); + } private bool AdjustFlags(ref FormatData fmtdata, ref XtraFlgs XtraFlags) { @@ -3239,491 +3246,491 @@ namespace fmtxml int step = 0; try { - for (int i = 0; i < MAXSTEPS+1; i++) - { + for (int i = 0; i < MAXSTEPS + 1; i++) + { step = i; - // Do base here - if (i == 0) - { - // All types get this thru inheritance - if (XtraFlags.SeparateBox == "True") fmtdata.StepData[i].SeparateBox = "True"; + // Do base here + if (i == 0) + { + // All types get this thru inheritance + if (XtraFlags.SeparateBox == "True") fmtdata.StepData[i].SeparateBox = "True"; else fmtdata.StepData[i].SeparateBox = "False"; - // All types get this thru inheritance - if (XtraFlags.LJTabs == "True") fmtdata.StepData[i].LJTabs = "True"; + // All types get this thru inheritance + if (XtraFlags.LJTabs == "True") fmtdata.StepData[i].LJTabs = "True"; else fmtdata.StepData[i].LJTabs = "False"; - } - if (i == 1) // Sequential flags - new name will be substeps - { - if (XtraFlags.BoxedSubsteps == "True") fmtdata.StepData[i].Boxed = "True"; - else fmtdata.StepData[i].Boxed = "False"; + } + if (i == 1) // Sequential flags - new name will be substeps + { + if (XtraFlags.BoxedSubsteps == "True") fmtdata.StepData[i].Boxed = "True"; + else fmtdata.StepData[i].Boxed = "False"; - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - if (XtraFlags.TextSubFollowsTextStyle == "True") fmtdata.StepData[i].TextSubFollowsTextStyle = "True"; - else fmtdata.StepData[i].TextSubFollowsTextStyle = "False"; + if (XtraFlags.TextSubFollowsTextStyle == "True") fmtdata.StepData[i].TextSubFollowsTextStyle = "True"; + else fmtdata.StepData[i].TextSubFollowsTextStyle = "False"; - if (XtraFlags.DontStartLineWithDash == "True") fmtdata.StepData[i].StartLineWithDash = "False"; - else fmtdata.StepData[i].StartLineWithDash = "True"; + if (XtraFlags.DontStartLineWithDash == "True") fmtdata.StepData[i].StartLineWithDash = "False"; + else fmtdata.StepData[i].StartLineWithDash = "True"; - if (XtraFlags.NoBlankLineBeforeSubstep == "True") fmtdata.StepData[i].BlankLineBeforeSubStep = "False"; - else fmtdata.StepData[i].BlankLineBeforeSubStep = "True"; - } - else if (i == 2) // High - { - // All High get this thru inheritance - if (XtraFlags.EnhancedStepNumFromPrev == "True") fmtdata.StepData[i].EnhancedStepNumFromPrev = "True"; - else fmtdata.StepData[i].EnhancedStepNumFromPrev = "False"; + if (XtraFlags.NoBlankLineBeforeSubstep == "True") fmtdata.StepData[i].BlankLineBeforeSubStep = "False"; + else fmtdata.StepData[i].BlankLineBeforeSubStep = "True"; + } + else if (i == 2) // High + { + // All High get this thru inheritance + if (XtraFlags.EnhancedStepNumFromPrev == "True") fmtdata.StepData[i].EnhancedStepNumFromPrev = "True"; + else fmtdata.StepData[i].EnhancedStepNumFromPrev = "False"; - // All High get this thru inheritance - if (XtraFlags.UseSmartTemplate == "True") fmtdata.StepData[i].UseSmartTemplate = "True"; - else fmtdata.StepData[i].UseSmartTemplate = "False"; + // All High get this thru inheritance + if (XtraFlags.UseSmartTemplate == "True") fmtdata.StepData[i].UseSmartTemplate = "True"; + else fmtdata.StepData[i].UseSmartTemplate = "False"; - // All High get this thru inheritance - if (XtraFlags.BoxContinousActions == "True") fmtdata.StepData[i].Boxed = "True"; - else fmtdata.StepData[i].Boxed = "False"; + // All High get this thru inheritance + if (XtraFlags.BoxContinousActions == "True") fmtdata.StepData[i].Boxed = "True"; + else fmtdata.StepData[i].Boxed = "False"; - // All High get this thru inheritance - if (XtraFlags.Xlines_StepFix == "True") fmtdata.StepData[i].XLines_StepFix = "True"; - else fmtdata.StepData[i].XLines_StepFix = "False"; + // All High get this thru inheritance + if (XtraFlags.Xlines_StepFix == "True") fmtdata.StepData[i].XLines_StepFix = "True"; + else fmtdata.StepData[i].XLines_StepFix = "False"; - // All High get this thru inheritance - if (XtraFlags.UseAlternateStepBox == "True") fmtdata.StepData[i].UseAlternateStepBox = "True"; - else fmtdata.StepData[i].UseAlternateStepBox = "False"; + // All High get this thru inheritance + if (XtraFlags.UseAlternateStepBox == "True") fmtdata.StepData[i].UseAlternateStepBox = "True"; + else fmtdata.StepData[i].UseAlternateStepBox = "False"; - // All High get this thru inheritance - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + // All High get this thru inheritance + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - // All High get this thru inheritance - if (XtraFlags.PageBreakOnHighLevelStep == "True") fmtdata.StepData[i].PageBreakOnStep = "True"; - else fmtdata.StepData[i].PageBreakOnStep = "False"; + // All High get this thru inheritance + if (XtraFlags.PageBreakOnHighLevelStep == "True") fmtdata.StepData[i].PageBreakOnStep = "True"; + else fmtdata.StepData[i].PageBreakOnStep = "False"; - // All High get this thru inheritance - if (XtraFlags.AlignNullTabWSectHead == "True") fmtdata.StepData[i].AlignNullTabWSectHead = "True"; - else fmtdata.StepData[i].AlignNullTabWSectHead = "False"; + // All High get this thru inheritance + if (XtraFlags.AlignNullTabWSectHead == "True") fmtdata.StepData[i].AlignNullTabWSectHead = "True"; + else fmtdata.StepData[i].AlignNullTabWSectHead = "False"; - // All High get this thru inheritance - if (XtraFlags.HLSTextInPagelist == "True") fmtdata.StepData[i].InPageList = "True"; - else fmtdata.StepData[i].InPageList = "False"; + // All High get this thru inheritance + if (XtraFlags.HLSTextInPagelist == "True") fmtdata.StepData[i].InPageList = "True"; + else fmtdata.StepData[i].InPageList = "False"; - // All High get this thru inheritance - if (XtraFlags.NoStepNumIfOnlyOneStep == "True") fmtdata.StepData[i].StepNumIfOnlyOne = "False"; - else fmtdata.StepData[i].StepNumIfOnlyOne = "True"; + // All High get this thru inheritance + if (XtraFlags.NoStepNumIfOnlyOneStep == "True") fmtdata.StepData[i].StepNumIfOnlyOne = "False"; + else fmtdata.StepData[i].StepNumIfOnlyOne = "True"; - // All High get this thru inheritance - if (XtraFlags.AtLeastTwoDigitsForHLS == "True") fmtdata.StepData[i].AtLeastTwoDigits = "True"; - else fmtdata.StepData[i].AtLeastTwoDigits = "False"; + // All High get this thru inheritance + if (XtraFlags.AtLeastTwoDigitsForHLS == "True") fmtdata.StepData[i].AtLeastTwoDigits = "True"; + else fmtdata.StepData[i].AtLeastTwoDigits = "False"; - // All High get this thru inheritance - if (XtraFlags.DontNumberHighLevelSteps == "True") fmtdata.StepData[i].Number = "False"; - else fmtdata.StepData[i].Number = "True"; - } - else if (i == 3) // Immediate - { - if (XtraFlags.IMMStepSpcHdr == "True") fmtdata.StepData[i].SpcHdr = "True"; - else fmtdata.StepData[i].SpcHdr = "False"; - } - else if (i == 4) // And - { - // All And get this thru inheritance - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + // All High get this thru inheritance + if (XtraFlags.DontNumberHighLevelSteps == "True") fmtdata.StepData[i].Number = "False"; + else fmtdata.StepData[i].Number = "True"; + } + else if (i == 3) // Immediate + { + if (XtraFlags.IMMStepSpcHdr == "True") fmtdata.StepData[i].SpcHdr = "True"; + else fmtdata.StepData[i].SpcHdr = "False"; + } + else if (i == 4) // And + { + // All And get this thru inheritance + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - // All And get this thru inheritance - if (XtraFlags.TreatAndOrAsSequential == "True") fmtdata.StepData[i].TreatAsSequential = "True"; - else fmtdata.StepData[i].TreatAsSequential = "False"; - } - else if (i == 5) // Or - { - // All Or get this thru inheritance - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + // All And get this thru inheritance + if (XtraFlags.TreatAndOrAsSequential == "True") fmtdata.StepData[i].TreatAsSequential = "True"; + else fmtdata.StepData[i].TreatAsSequential = "False"; + } + else if (i == 5) // Or + { + // All Or get this thru inheritance + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - // All Or get this thru inheritance - if (XtraFlags.TreatAndOrAsSequential == "True") fmtdata.StepData[i].TreatAsSequential = "True"; - else fmtdata.StepData[i].TreatAsSequential = "False"; + // All Or get this thru inheritance + if (XtraFlags.TreatAndOrAsSequential == "True") fmtdata.StepData[i].TreatAsSequential = "True"; + else fmtdata.StepData[i].TreatAsSequential = "False"; - } - else if (i == 6) // Caution - { - // All Cautions get this thru inheritance - if (XtraFlags.EnhancedStepNumFromPrev == "True") fmtdata.StepData[i].EnhancedStepNumFromPrev = "True"; - else fmtdata.StepData[i].EnhancedStepNumFromPrev = "False"; + } + else if (i == 6) // Caution + { + // All Cautions get this thru inheritance + if (XtraFlags.EnhancedStepNumFromPrev == "True") fmtdata.StepData[i].EnhancedStepNumFromPrev = "True"; + else fmtdata.StepData[i].EnhancedStepNumFromPrev = "False"; - // All Cautions get this thru inheritance - if (XtraFlags.AlwaysUseExtralines == "True") fmtdata.StepData[i].AlwaysUseExtraLines = "True"; - else fmtdata.StepData[i].AlwaysUseExtraLines = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.AlwaysUseExtralines == "True") fmtdata.StepData[i].AlwaysUseExtraLines = "True"; + else fmtdata.StepData[i].AlwaysUseExtraLines = "False"; - // All Cautions get this thru inheritance - if (XtraFlags.SeparateBoxCautions == "True") fmtdata.StepData[i].SeparateBoxCautions = "True"; - else fmtdata.StepData[i].SeparateBoxCautions = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.SeparateBoxCautions == "True") fmtdata.StepData[i].SeparateBoxCautions = "True"; + else fmtdata.StepData[i].SeparateBoxCautions = "False"; - // All Cautions get this thru inheritance - if (XtraFlags.ReduceLineAfterNoteAndCaut == "True") fmtdata.StepData[i].ReduceLineAfter = "True"; - else fmtdata.StepData[i].ReduceLineAfter = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.ReduceLineAfterNoteAndCaut == "True") fmtdata.StepData[i].ReduceLineAfter = "True"; + else fmtdata.StepData[i].ReduceLineAfter = "False"; - // All Cautions get this thru inheritance - if (XtraFlags.OneLineBeforeNoteCautionTab == "True") fmtdata.StepData[i].OneLineBeforeTab = "True"; - else fmtdata.StepData[i].OneLineBeforeTab = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.OneLineBeforeNoteCautionTab == "True") fmtdata.StepData[i].OneLineBeforeTab = "True"; + else fmtdata.StepData[i].OneLineBeforeTab = "False"; - // All Cautions get this thru inheritance - if (XtraFlags.ReBoxCautNote == "True") fmtdata.StepData[i].Rebox = "True"; - else fmtdata.StepData[i].Rebox = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.ReBoxCautNote == "True") fmtdata.StepData[i].Rebox = "True"; + else fmtdata.StepData[i].Rebox = "False"; - // All Cautions get this thru inheritance - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - // All Cautions get this thru inheritance - if (XtraFlags.NoSpaceInNoteOrCaution == "True") fmtdata.StepData[i].SpaceIn = "False"; - else fmtdata.StepData[i].SpaceIn = "True"; - - // All Cautions get this thru inheritance - if (XtraFlags.PageBreakOnCautions == "True") fmtdata.StepData[i].PageBreakOnStep = "True"; - else fmtdata.StepData[i].PageBreakOnStep = "False"; - - // All Cautions get this thru inheritance - if (XtraFlags.MatchUpRNOCautNote == "True") fmtdata.StepData[i].MatchUpRNO = "True"; - else fmtdata.StepData[i].MatchUpRNO = "False"; - - // All Cautions get this thru inheritance - if (XtraFlags.StpCautNoteTabInPagelist == "True") fmtdata.StepData[i].InPageList = "True"; - else fmtdata.StepData[i].InPageList = "False"; - - // All Cautions get this thru inheritance - if (XtraFlags.CenterOneLineOnly == "True") fmtdata.StepData[i].CenterOneLineOnly = "True"; - else fmtdata.StepData[i].CenterOneLineOnly = "False"; - - // All Cautions get this thru inheritance - if (XtraFlags.RememberCautionsAndNotes == "True") fmtdata.StepData[i].Remember = "True"; - else fmtdata.StepData[i].Remember = "False"; - - // All Cautions get this thru inheritance - if (XtraFlags.CenterOneLineAdjust == "True") fmtdata.StepData[i].CenterOneLineAdjust = "True"; - else fmtdata.StepData[i].CenterOneLineAdjust = "False"; - - // All Cautions get this thru inheritance - if (XtraFlags.DontBreakCautionsOrNotes == "True") fmtdata.StepData[i].Break = "False"; - else fmtdata.StepData[i].Break = "True"; - - // All Cautions get this thru inheritance - if (XtraFlags.CenterTextWithinWidth == "True") fmtdata.StepData[i].CenterTextWithinWidth = "True"; - else fmtdata.StepData[i].CenterTextWithinWidth = "False"; - - // All Cautions get this thru inheritance - if (XtraFlags.DontBreakCautionsNotesOnSubstps == "True") fmtdata.StepData[i].BreakCautionsNotesOnSubstps = "False"; - else fmtdata.StepData[i].BreakCautionsNotesOnSubstps = "True"; - - // All Cautions get this thru inheritance - if (XtraFlags.AlwaysTabCaution == "True") fmtdata.StepData[i].AlwaysTab = "True"; - else fmtdata.StepData[i].AlwaysTab = "False"; - - // All Cautions get this thru inheritance - if (XtraFlags.ThreeBlanksAboveNotesCautions == "True") fmtdata.StepData[i].ThreeBlanksAbove = "True"; - else fmtdata.StepData[i].ThreeBlanksAbove = "False"; - } - else if (i == 7) // Note - { - // All Notes get this thru inheritance - if (XtraFlags.EnhancedStepNumFromPrev == "True") fmtdata.StepData[i].EnhancedStepNumFromPrev = "True"; - else fmtdata.StepData[i].EnhancedStepNumFromPrev = "False"; - - // All Notes get this thru inheritance - if (XtraFlags.AlwaysUseExtralines == "True") fmtdata.StepData[i].AlwaysUseExtraLines = "True"; - else fmtdata.StepData[i].AlwaysUseExtraLines = "False"; - - // All Notes get this thru inheritance - if (XtraFlags.ReduceLineAfterNoteAndCaut == "True") fmtdata.StepData[i].ReduceLineAfter = "True"; - else fmtdata.StepData[i].ReduceLineAfter = "False"; - - // All Notes get this thru inheritance - if (XtraFlags.OneLineBeforeNoteCautionTab == "True") fmtdata.StepData[i].OneLineBeforeTab = "True"; - else fmtdata.StepData[i].OneLineBeforeTab = "False"; - - // All Notes get this thru inheritance - if (XtraFlags.ReBoxCautNote == "True") fmtdata.StepData[i].Rebox = "True"; - else fmtdata.StepData[i].Rebox = "False"; - - // All Notes get this thru inheritance - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - - // All Notes get this thru inheritance - if (XtraFlags.NoSpaceInNoteOrCaution == "True") fmtdata.StepData[i].SpaceIn = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.NoSpaceInNoteOrCaution == "True") fmtdata.StepData[i].SpaceIn = "False"; else fmtdata.StepData[i].SpaceIn = "True"; - // All Notes get this thru inheritance - if (XtraFlags.PageBreakOnNotes == "True") fmtdata.StepData[i].PageBreakOnStep = "True"; - else fmtdata.StepData[i].PageBreakOnStep = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.PageBreakOnCautions == "True") fmtdata.StepData[i].PageBreakOnStep = "True"; + else fmtdata.StepData[i].PageBreakOnStep = "False"; - // All Notes get this thru inheritance - if (XtraFlags.MatchUpRNOCautNote == "True") fmtdata.StepData[i].MatchUpRNO = "True"; - else fmtdata.StepData[i].MatchUpRNO = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.MatchUpRNOCautNote == "True") fmtdata.StepData[i].MatchUpRNO = "True"; + else fmtdata.StepData[i].MatchUpRNO = "False"; - // All Notes get this thru inheritance - if (XtraFlags.StpCautNoteTabInPagelist == "True") fmtdata.StepData[i].InPageList = "True"; - else fmtdata.StepData[i].InPageList = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.StpCautNoteTabInPagelist == "True") fmtdata.StepData[i].InPageList = "True"; + else fmtdata.StepData[i].InPageList = "False"; - // All Notes get this thru inheritance - if (XtraFlags.CenterOneLineOnly == "True") fmtdata.StepData[i].CenterOneLineOnly = "True"; - else fmtdata.StepData[i].CenterOneLineOnly = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.CenterOneLineOnly == "True") fmtdata.StepData[i].CenterOneLineOnly = "True"; + else fmtdata.StepData[i].CenterOneLineOnly = "False"; - // All Notes get this thru inheritance - if (XtraFlags.RememberCautionsAndNotes == "True") fmtdata.StepData[i].Remember = "True"; - else fmtdata.StepData[i].Remember = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.RememberCautionsAndNotes == "True") fmtdata.StepData[i].Remember = "True"; + else fmtdata.StepData[i].Remember = "False"; - // All Notes get this thru inheritance - if (XtraFlags.CenterOneLineAdjust == "True") fmtdata.StepData[i].CenterOneLineAdjust = "True"; - else fmtdata.StepData[i].CenterOneLineAdjust = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.CenterOneLineAdjust == "True") fmtdata.StepData[i].CenterOneLineAdjust = "True"; + else fmtdata.StepData[i].CenterOneLineAdjust = "False"; - // All Notes get this thru inheritance - if (XtraFlags.DontBreakCautionsOrNotes == "True") fmtdata.StepData[i].Break = "False"; - else fmtdata.StepData[i].Break = "True"; + // All Cautions get this thru inheritance + if (XtraFlags.DontBreakCautionsOrNotes == "True") fmtdata.StepData[i].Break = "False"; + else fmtdata.StepData[i].Break = "True"; - // All Notes get this thru inheritance - if (XtraFlags.DontBreakCautionsNotesOnSubstps == "True") fmtdata.StepData[i].BreakCautionsNotesOnSubstps = "False"; - else fmtdata.StepData[i].BreakCautionsNotesOnSubstps = "True"; + // All Cautions get this thru inheritance + if (XtraFlags.CenterTextWithinWidth == "True") fmtdata.StepData[i].CenterTextWithinWidth = "True"; + else fmtdata.StepData[i].CenterTextWithinWidth = "False"; - // All Notes get this thru inheritance - if (XtraFlags.CenterTextWithinWidth == "True") fmtdata.StepData[i].CenterTextWithinWidth = "True"; - else fmtdata.StepData[i].CenterTextWithinWidth = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.DontBreakCautionsNotesOnSubstps == "True") fmtdata.StepData[i].BreakCautionsNotesOnSubstps = "False"; + else fmtdata.StepData[i].BreakCautionsNotesOnSubstps = "True"; - // All Notes get this thru inheritance - if (XtraFlags.AlwaysTabNote == "True") fmtdata.StepData[i].AlwaysTab = "True"; - else fmtdata.StepData[i].AlwaysTab = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.AlwaysTabCaution == "True") fmtdata.StepData[i].AlwaysTab = "True"; + else fmtdata.StepData[i].AlwaysTab = "False"; - // All Notes get this thru inheritance - if (XtraFlags.ThreeBlanksAboveNotesCautions == "True") fmtdata.StepData[i].ThreeBlanksAbove = "True"; - else fmtdata.StepData[i].ThreeBlanksAbove = "False"; - } - else if (i == 8) // Table - { - // All Table get this thru inheritance - if (XtraFlags.SubTableGetSup1Level == "True") fmtdata.StepData[i].SubTableGetsUp1Level = "True"; - else fmtdata.StepData[i].SubTableGetsUp1Level = "False"; - } - else if (i == 9) // Continuous - { - if (XtraFlags.BulletOnContinuous == "True") fmtdata.StepData[i].Bullet = "True"; - else fmtdata.StepData[i].Bullet = "False"; - } - else if (i == 10) // AERTable - { - } - else if (i == 11) // EquipmentList - { - // All EquipmentList get this thru inheritance - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + // All Cautions get this thru inheritance + if (XtraFlags.ThreeBlanksAboveNotesCautions == "True") fmtdata.StepData[i].ThreeBlanksAbove = "True"; + else fmtdata.StepData[i].ThreeBlanksAbove = "False"; + } + else if (i == 7) // Note + { + // All Notes get this thru inheritance + if (XtraFlags.EnhancedStepNumFromPrev == "True") fmtdata.StepData[i].EnhancedStepNumFromPrev = "True"; + else fmtdata.StepData[i].EnhancedStepNumFromPrev = "False"; - // Note that only equipment lists (and wblank) get this - no inherit - must be done in code! - if (XtraFlags.DontBreakEquipmentList == "True") fmtdata.StepData[i].BreakEquipmentList = "False"; - else fmtdata.StepData[i].BreakEquipmentList = "True"; - } - else if (i == 12) // Title - { - // All Title get this thru inheritance - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - } - else if (i == 13) // PageNumber - { - } - else if (i == 14) // EquipmentWBlank - { - } - else if (i == 15) // ProcNumber - { - } - else if (i == 16) // RevNumber - { - } - else if (i == 17) // AccPages - { - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - } - else if (i == 18) // LossOfAC - { - if (XtraFlags.DontBoxAC == "True") fmtdata.StepData[i].BoxIt = "False"; - else fmtdata.StepData[i].BoxIt = "True"; - } - else if (i == 19) // ExplicitAnd - { - } - else if (i == 20) // Caution1 - { - if (XtraFlags.MixCautionsAndNotes == "True") fmtdata.StepData[i].MixCautionsAndNotes = "True"; - else fmtdata.StepData[i].MixCautionsAndNotes = "False"; + // All Notes get this thru inheritance + if (XtraFlags.AlwaysUseExtralines == "True") fmtdata.StepData[i].AlwaysUseExtraLines = "True"; + else fmtdata.StepData[i].AlwaysUseExtraLines = "False"; - if (XtraFlags.Caution1SameRowAsParent == "True") fmtdata.StepData[i].SameRowAsParent = "True"; - else fmtdata.StepData[i].SameRowAsParent = "False"; - } - else if (i == 21) // Caution2 - { - if (XtraFlags.AlwaysTabCaution2 == "True") fmtdata.StepData[i].AlwaysTab = "True"; - else fmtdata.StepData[i].AlwaysTab = "False"; + // All Notes get this thru inheritance + if (XtraFlags.ReduceLineAfterNoteAndCaut == "True") fmtdata.StepData[i].ReduceLineAfter = "True"; + else fmtdata.StepData[i].ReduceLineAfter = "False"; - if (XtraFlags.Caution2SameRowAsParent == "True") fmtdata.StepData[i].SameRowAsParent = "True"; - else fmtdata.StepData[i].SameRowAsParent = "False"; - } - else if (i == 22) // Note1 - { - if (XtraFlags.MixCautionsAndNotes == "True") fmtdata.StepData[i].MixCautionsAndNotes = "True"; - else fmtdata.StepData[i].MixCautionsAndNotes = "False"; - } - else if (i == 23) // Note2 - { - } - else if (i == 24) // Paragraph - { - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - } - else if (i == 25) // Default - { - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - } - else if (i == 26) // Note3 - { - } - else if (i == 27) // Caution3 - { - } - else if (i == 28) // Note4 - { - } - else if (i == 29) // Caution4 - { - } - else if (i == 30) // EquipmentOpt - { - // All EquipmentOpt get this thru inheritance - if (XtraFlags.QuotedSubsteps == "True") fmtdata.StepData[i].Quoted = "True"; - else fmtdata.StepData[i].Quoted = "False"; + // All Notes get this thru inheritance + if (XtraFlags.OneLineBeforeNoteCautionTab == "True") fmtdata.StepData[i].OneLineBeforeTab = "True"; + else fmtdata.StepData[i].OneLineBeforeTab = "False"; - // Note that only opt equipment lists (and wblank) get this - no inherit - must be done in code! - if (XtraFlags.DontBreakOptEquipmentList == "True") - fmtdata.StepData[i].BreakEquipmentList = "False"; - else - fmtdata.StepData[i].BreakEquipmentList = "True"; - } - else if (i == 31) // EquipmentOptWBlank - { - // All EquipmentOptWBlank get this thru inheritance - if (XtraFlags.QuotedSubsteps == "True") fmtdata.StepData[i].Quoted = "True"; - else fmtdata.StepData[i].Quoted = "False"; - } - else if (i == 32) // Note5 - { - } - else if (i == 33) // BorderlessAERTable - { - if (XtraFlags.LJBorderlessTable == "True") fmtdata.StepData[i].LeftJustifyBorderless = "True"; - else fmtdata.StepData[i].LeftJustifyBorderless = "False"; - } - else if (i == 34) // BorderlessTable - { - if (XtraFlags.LJBorderlessTable == "True") fmtdata.StepData[i].LeftJustifyBorderless = "True"; - else fmtdata.StepData[i].LeftJustifyBorderless = "False"; - } - else if (i == 35) // ImplicitOr - { - } - else if (i == 36) // Figure - { - } - else if (i == 37) // AERFigure - { - } - else if (i == 38) // BorderlessFigure - { - if (XtraFlags.LJBorderlessTable == "True") fmtdata.StepData[i].LeftJustifyBorderless = "True"; - else fmtdata.StepData[i].LeftJustifyBorderless = "False"; - } - else if (i == 39) // BorderlessAERFigure - { - if (XtraFlags.LJBorderlessTable == "True") fmtdata.StepData[i].LeftJustifyBorderless = "True"; - else fmtdata.StepData[i].LeftJustifyBorderless = "False"; - } - else if (i == 40) // RNOType - { - if (XtraFlags.DoubleRNOSpace == "True") fmtdata.StepData[i].DoubleSpace = "True"; - else fmtdata.StepData[i].DoubleSpace = "False"; + // All Notes get this thru inheritance + if (XtraFlags.ReBoxCautNote == "True") fmtdata.StepData[i].Rebox = "True"; + else fmtdata.StepData[i].Rebox = "False"; - if (XtraFlags.EnhancedStepNumFromPrev == "True") fmtdata.StepData[i].EnhancedStepNumFromPrev = "True"; - else fmtdata.StepData[i].EnhancedStepNumFromPrev = "False"; + // All Notes get this thru inheritance + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - if (XtraFlags.NoSpaceDoubleRNO == "True") fmtdata.StepData[i].SpaceDouble = "False"; - else fmtdata.StepData[i].SpaceDouble = "True"; + // All Notes get this thru inheritance + if (XtraFlags.NoSpaceInNoteOrCaution == "True") fmtdata.StepData[i].SpaceIn = "False"; + else fmtdata.StepData[i].SpaceIn = "True"; - if (XtraFlags.RNOSameLevel == "True") fmtdata.StepData[i].SameLevel = "True"; - else fmtdata.StepData[i].SameLevel = "False"; + // All Notes get this thru inheritance + if (XtraFlags.PageBreakOnNotes == "True") fmtdata.StepData[i].PageBreakOnStep = "True"; + else fmtdata.StepData[i].PageBreakOnStep = "False"; - if (XtraFlags.BoldHighLevelRNO == "True") fmtdata.StepData[i].BoldHighLevel = "True"; - else fmtdata.StepData[i].BoldHighLevel = "False"; + // All Notes get this thru inheritance + if (XtraFlags.MatchUpRNOCautNote == "True") fmtdata.StepData[i].MatchUpRNO = "True"; + else fmtdata.StepData[i].MatchUpRNO = "False"; - if (XtraFlags.RNOContinueOnly == "True") fmtdata.StepData[i].ContinueOnly = "True"; - else fmtdata.StepData[i].ContinueOnly = "False"; + // All Notes get this thru inheritance + if (XtraFlags.StpCautNoteTabInPagelist == "True") fmtdata.StepData[i].InPageList = "True"; + else fmtdata.StepData[i].InPageList = "False"; - if (XtraFlags.RNOSepAfterAER == "True") fmtdata.StepData[i].SepAfterAER = "True"; - else fmtdata.StepData[i].SepAfterAER = "False"; + // All Notes get this thru inheritance + if (XtraFlags.CenterOneLineOnly == "True") fmtdata.StepData[i].CenterOneLineOnly = "True"; + else fmtdata.StepData[i].CenterOneLineOnly = "False"; - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + // All Notes get this thru inheritance + if (XtraFlags.RememberCautionsAndNotes == "True") fmtdata.StepData[i].Remember = "True"; + else fmtdata.StepData[i].Remember = "False"; - if (XtraFlags.RNOInPagelist == "True") fmtdata.StepData[i].InPageList = "True"; - else fmtdata.StepData[i].InPageList = "False"; + // All Notes get this thru inheritance + if (XtraFlags.CenterOneLineAdjust == "True") fmtdata.StepData[i].CenterOneLineAdjust = "True"; + else fmtdata.StepData[i].CenterOneLineAdjust = "False"; - if (XtraFlags.DontBreakOnRNO == "True") fmtdata.StepData[i].Break = "False"; - else fmtdata.StepData[i].Break = "True"; + // All Notes get this thru inheritance + if (XtraFlags.DontBreakCautionsOrNotes == "True") fmtdata.StepData[i].Break = "False"; + else fmtdata.StepData[i].Break = "True"; - if (XtraFlags.NoNewlineAfterRNO == "True") fmtdata.StepData[i].NewlineAfter = "False"; - else fmtdata.StepData[i].NewlineAfter = "True"; + // All Notes get this thru inheritance + if (XtraFlags.DontBreakCautionsNotesOnSubstps == "True") fmtdata.StepData[i].BreakCautionsNotesOnSubstps = "False"; + else fmtdata.StepData[i].BreakCautionsNotesOnSubstps = "True"; - if (XtraFlags.NumberHighLevelRNO == "True") fmtdata.StepData[i].NumberHighLevel = "True"; - else fmtdata.StepData[i].NumberHighLevel = "False"; + // All Notes get this thru inheritance + if (XtraFlags.CenterTextWithinWidth == "True") fmtdata.StepData[i].CenterTextWithinWidth = "True"; + else fmtdata.StepData[i].CenterTextWithinWidth = "False"; - if (XtraFlags.DontOffsetTab == "True") fmtdata.StepData[i].OffsetTab = "False"; - else fmtdata.StepData[i].OffsetTab = "True"; + // All Notes get this thru inheritance + if (XtraFlags.AlwaysTabNote == "True") fmtdata.StepData[i].AlwaysTab = "True"; + else fmtdata.StepData[i].AlwaysTab = "False"; - if (XtraFlags.DontNumberRNOSubs == "True") fmtdata.StepData[i].NumberSubs = "False"; - else fmtdata.StepData[i].NumberSubs = "True"; + // All Notes get this thru inheritance + if (XtraFlags.ThreeBlanksAboveNotesCautions == "True") fmtdata.StepData[i].ThreeBlanksAbove = "True"; + else fmtdata.StepData[i].ThreeBlanksAbove = "False"; + } + else if (i == 8) // Table + { + // All Table get this thru inheritance + if (XtraFlags.SubTableGetSup1Level == "True") fmtdata.StepData[i].SubTableGetsUp1Level = "True"; + else fmtdata.StepData[i].SubTableGetsUp1Level = "False"; + } + else if (i == 9) // Continuous + { + if (XtraFlags.BulletOnContinuous == "True") fmtdata.StepData[i].Bullet = "True"; + else fmtdata.StepData[i].Bullet = "False"; + } + else if (i == 10) // AERTable + { + } + else if (i == 11) // EquipmentList + { + // All EquipmentList get this thru inheritance + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - if (XtraFlags.NoStepNumberForHighLevelRNO == "True") fmtdata.StepData[i].StepNumberForHighLevel = "False"; - else fmtdata.StepData[i].StepNumberForHighLevel = "True"; + // Note that only equipment lists (and wblank) get this - no inherit - must be done in code! + if (XtraFlags.DontBreakEquipmentList == "True") fmtdata.StepData[i].BreakEquipmentList = "False"; + else fmtdata.StepData[i].BreakEquipmentList = "True"; + } + else if (i == 12) // Title + { + // All Title get this thru inheritance + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + } + else if (i == 13) // PageNumber + { + } + else if (i == 14) // EquipmentWBlank + { + } + else if (i == 15) // ProcNumber + { + } + else if (i == 16) // RevNumber + { + } + else if (i == 17) // AccPages + { + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + } + else if (i == 18) // LossOfAC + { + if (XtraFlags.DontBoxAC == "True") fmtdata.StepData[i].BoxIt = "False"; + else fmtdata.StepData[i].BoxIt = "True"; + } + else if (i == 19) // ExplicitAnd + { + } + else if (i == 20) // Caution1 + { + if (XtraFlags.MixCautionsAndNotes == "True") fmtdata.StepData[i].MixCautionsAndNotes = "True"; + else fmtdata.StepData[i].MixCautionsAndNotes = "False"; - if (XtraFlags.RNOCheckOffSameAsParent == "True") fmtdata.StepData[i].CheckoffSameAsParent = "True"; - else fmtdata.StepData[i].CheckoffSameAsParent = "False"; + if (XtraFlags.Caution1SameRowAsParent == "True") fmtdata.StepData[i].SameRowAsParent = "True"; + else fmtdata.StepData[i].SameRowAsParent = "False"; + } + else if (i == 21) // Caution2 + { + if (XtraFlags.AlwaysTabCaution2 == "True") fmtdata.StepData[i].AlwaysTab = "True"; + else fmtdata.StepData[i].AlwaysTab = "False"; - if (XtraFlags.UseRNOTypeInActable == "True") fmtdata.StepData[i].UseInAcTable = "True"; - else fmtdata.StepData[i].UseInAcTable = "False"; - } - else if (i == 41) // High5 - { - } - else if (i == 42) // TitleWithTextRight - { - } - else if (i == 43) // TitleWithTextBelow - { - } - else if (i == 44) // ContAcSequential - { - if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; - else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; - } - else if (i == 45) // ContAcAnd - { - } - else if (i == 46) // ContAcOr - { - } - else if (i == 47) // ContAcParagraph - { - } + if (XtraFlags.Caution2SameRowAsParent == "True") fmtdata.StepData[i].SameRowAsParent = "True"; + else fmtdata.StepData[i].SameRowAsParent = "False"; + } + else if (i == 22) // Note1 + { + if (XtraFlags.MixCautionsAndNotes == "True") fmtdata.StepData[i].MixCautionsAndNotes = "True"; + else fmtdata.StepData[i].MixCautionsAndNotes = "False"; + } + else if (i == 23) // Note2 + { + } + else if (i == 24) // Paragraph + { + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + } + else if (i == 25) // Default + { + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + } + else if (i == 26) // Note3 + { + } + else if (i == 27) // Caution3 + { + } + else if (i == 28) // Note4 + { + } + else if (i == 29) // Caution4 + { + } + else if (i == 30) // EquipmentOpt + { + // All EquipmentOpt get this thru inheritance + if (XtraFlags.QuotedSubsteps == "True") fmtdata.StepData[i].Quoted = "True"; + else fmtdata.StepData[i].Quoted = "False"; + + // Note that only opt equipment lists (and wblank) get this - no inherit - must be done in code! + if (XtraFlags.DontBreakOptEquipmentList == "True") + fmtdata.StepData[i].BreakEquipmentList = "False"; + else + fmtdata.StepData[i].BreakEquipmentList = "True"; + } + else if (i == 31) // EquipmentOptWBlank + { + // All EquipmentOptWBlank get this thru inheritance + if (XtraFlags.QuotedSubsteps == "True") fmtdata.StepData[i].Quoted = "True"; + else fmtdata.StepData[i].Quoted = "False"; + } + else if (i == 32) // Note5 + { + } + else if (i == 33) // BorderlessAERTable + { + if (XtraFlags.LJBorderlessTable == "True") fmtdata.StepData[i].LeftJustifyBorderless = "True"; + else fmtdata.StepData[i].LeftJustifyBorderless = "False"; + } + else if (i == 34) // BorderlessTable + { + if (XtraFlags.LJBorderlessTable == "True") fmtdata.StepData[i].LeftJustifyBorderless = "True"; + else fmtdata.StepData[i].LeftJustifyBorderless = "False"; + } + else if (i == 35) // ImplicitOr + { + } + else if (i == 36) // Figure + { + } + else if (i == 37) // AERFigure + { + } + else if (i == 38) // BorderlessFigure + { + if (XtraFlags.LJBorderlessTable == "True") fmtdata.StepData[i].LeftJustifyBorderless = "True"; + else fmtdata.StepData[i].LeftJustifyBorderless = "False"; + } + else if (i == 39) // BorderlessAERFigure + { + if (XtraFlags.LJBorderlessTable == "True") fmtdata.StepData[i].LeftJustifyBorderless = "True"; + else fmtdata.StepData[i].LeftJustifyBorderless = "False"; + } + else if (i == 40) // RNOType + { + if (XtraFlags.DoubleRNOSpace == "True") fmtdata.StepData[i].DoubleSpace = "True"; + else fmtdata.StepData[i].DoubleSpace = "False"; + + if (XtraFlags.EnhancedStepNumFromPrev == "True") fmtdata.StepData[i].EnhancedStepNumFromPrev = "True"; + else fmtdata.StepData[i].EnhancedStepNumFromPrev = "False"; + + if (XtraFlags.NoSpaceDoubleRNO == "True") fmtdata.StepData[i].SpaceDouble = "False"; + else fmtdata.StepData[i].SpaceDouble = "True"; + + if (XtraFlags.RNOSameLevel == "True") fmtdata.StepData[i].SameLevel = "True"; + else fmtdata.StepData[i].SameLevel = "False"; + + if (XtraFlags.BoldHighLevelRNO == "True") fmtdata.StepData[i].BoldHighLevel = "True"; + else fmtdata.StepData[i].BoldHighLevel = "False"; + + if (XtraFlags.RNOContinueOnly == "True") fmtdata.StepData[i].ContinueOnly = "True"; + else fmtdata.StepData[i].ContinueOnly = "False"; + + if (XtraFlags.RNOSepAfterAER == "True") fmtdata.StepData[i].SepAfterAER = "True"; + else fmtdata.StepData[i].SepAfterAER = "False"; + + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + + if (XtraFlags.RNOInPagelist == "True") fmtdata.StepData[i].InPageList = "True"; + else fmtdata.StepData[i].InPageList = "False"; + + if (XtraFlags.DontBreakOnRNO == "True") fmtdata.StepData[i].Break = "False"; + else fmtdata.StepData[i].Break = "True"; + + if (XtraFlags.NoNewlineAfterRNO == "True") fmtdata.StepData[i].NewlineAfter = "False"; + else fmtdata.StepData[i].NewlineAfter = "True"; + + if (XtraFlags.NumberHighLevelRNO == "True") fmtdata.StepData[i].NumberHighLevel = "True"; + else fmtdata.StepData[i].NumberHighLevel = "False"; + + if (XtraFlags.DontOffsetTab == "True") fmtdata.StepData[i].OffsetTab = "False"; + else fmtdata.StepData[i].OffsetTab = "True"; + + if (XtraFlags.DontNumberRNOSubs == "True") fmtdata.StepData[i].NumberSubs = "False"; + else fmtdata.StepData[i].NumberSubs = "True"; + + if (XtraFlags.NoStepNumberForHighLevelRNO == "True") fmtdata.StepData[i].StepNumberForHighLevel = "False"; + else fmtdata.StepData[i].StepNumberForHighLevel = "True"; + + if (XtraFlags.RNOCheckOffSameAsParent == "True") fmtdata.StepData[i].CheckoffSameAsParent = "True"; + else fmtdata.StepData[i].CheckoffSameAsParent = "False"; + + if (XtraFlags.UseRNOTypeInActable == "True") fmtdata.StepData[i].UseInAcTable = "True"; + else fmtdata.StepData[i].UseInAcTable = "False"; + } + else if (i == 41) // High5 + { + } + else if (i == 42) // TitleWithTextRight + { + } + else if (i == 43) // TitleWithTextBelow + { + } + else if (i == 44) // ContAcSequential + { + if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True"; + else fmtdata.StepData[i].UnderlineAfterDashSpace = "False"; + } + else if (i == 45) // ContAcAnd + { + } + else if (i == 46) // ContAcOr + { + } + else if (i == 47) // ContAcParagraph + { + } if (fmtdata.StepData[i].TabData.MacroList != null) { if (XtraFlags.NoCheckOffsInRNO == "True") fmtdata.StepData[i].TabData.MacroList[0].NotInRNO = "True"; @@ -3733,255 +3740,255 @@ namespace fmtxml } catch (Exception ex) { - Console.WriteLine("here"); + Console.WriteLine("Error on step data"); } #endregion #region StepStructLayout if (XtraFlags.Dev_Format == "True") fmtdata.SectData.StepSectionData.StpSectLayData.Dev_Format = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.Dev_Format = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.Dev_Format = "False"; if (XtraFlags.EnhancedShortFormDev == "True") fmtdata.SectData.StepSectionData.StpSectLayData.EnhancedShortFormDev = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.EnhancedShortFormDev = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.EnhancedShortFormDev = "False"; if (XtraFlags.SpecialPageBreakFlag == "True") fmtdata.SectData.StepSectionData.StpSectLayData.SpecialPageBreakFlag = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.SpecialPageBreakFlag = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.SpecialPageBreakFlag = "False"; if (XtraFlags.DontPaginateOnFirstSubStep == "True") fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnFirstSubstep = "False"; - else fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnFirstSubstep = "True"; + else fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnFirstSubstep = "True"; if (XtraFlags.DontPaginateOnFirstSubStep2X == "True") fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnFirstSubstep2X = "False"; - else fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnFirstSubstep2X = "True"; + else fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnFirstSubstep2X = "True"; if (XtraFlags.DontUseHalfLines == "True") fmtdata.SectData.StepSectionData.StpSectLayData.UseHalfLines = "False"; - else fmtdata.SectData.StepSectionData.StpSectLayData.UseHalfLines = "True"; + else fmtdata.SectData.StepSectionData.StpSectLayData.UseHalfLines = "True"; if (XtraFlags.DontTryToFillHalfOfPage == "True") fmtdata.SectData.StepSectionData.StpSectLayData.TryToFillHalfOfPage = "False"; - else fmtdata.SectData.StepSectionData.StpSectLayData.TryToFillHalfOfPage = "True"; + else fmtdata.SectData.StepSectionData.StpSectLayData.TryToFillHalfOfPage = "True"; if (XtraFlags.DoNotCompressSteps == "True") fmtdata.SectData.StepSectionData.StpSectLayData.CompressSteps = "False"; else fmtdata.SectData.StepSectionData.StpSectLayData.CompressSteps = "True"; if (XtraFlags.DontDoSTExtraAtTop == "True") fmtdata.SectData.StepSectionData.StpSectLayData.DoSTExtraAtTop = "False"; - else fmtdata.SectData.StepSectionData.StpSectLayData.DoSTExtraAtTop = "True"; + else fmtdata.SectData.StepSectionData.StpSectLayData.DoSTExtraAtTop = "True"; if (XtraFlags.KeepStepsOnPage == "True") fmtdata.SectData.StepSectionData.StpSectLayData.KeepStepsOnPage = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.KeepStepsOnPage = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.KeepStepsOnPage = "False"; if (XtraFlags.DontBreakOnSections == "True") fmtdata.SectData.StepSectionData.StpSectLayData.BreakOnSections = "False"; else fmtdata.SectData.StepSectionData.StpSectLayData.BreakOnSections = "True"; if (XtraFlags.ShowSectionTitles == "True") fmtdata.SectData.StepSectionData.StpSectLayData.ShowSectionTitles = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.ShowSectionTitles = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.ShowSectionTitles = "False"; if (XtraFlags.NoEndForSingle == "True") fmtdata.SectData.StepSectionData.StpSectLayData.EndForSingle = "False"; - else fmtdata.SectData.StepSectionData.StpSectLayData.EndForSingle = "True"; + else fmtdata.SectData.StepSectionData.StpSectLayData.EndForSingle = "True"; if (XtraFlags.DontPaginateOnFirstSubstep3X == "True") fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnFirstSubstep3X = "False"; - else fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnFirstSubstep3X = "True"; + else fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnFirstSubstep3X = "True"; if (XtraFlags.PaginateOnLowerStepLevel == "True") fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnLowerStepLevel = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnLowerStepLevel = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.PaginateOnLowerStepLevel = "False"; if (XtraFlags.CustomSpacing == "True") fmtdata.SectData.StepSectionData.StpSectLayData.CustomSpacing = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.CustomSpacing = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.CustomSpacing = "False"; if (XtraFlags.DontSplitStepInPrntStep == "True") fmtdata.SectData.StepSectionData.StpSectLayData.SplitStepInPrntStep = "False"; else fmtdata.SectData.StepSectionData.StpSectLayData.SplitStepInPrntStep = "True"; if (XtraFlags.LineAboveUnderSection == "True") fmtdata.SectData.StepSectionData.StpSectLayData.LineAboveUnderSection = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.LineAboveUnderSection = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.LineAboveUnderSection = "False"; if (XtraFlags.PicaIgnoreFiveSixths == "True") fmtdata.SectData.StepSectionData.StpSectLayData.PicaIgnoreFiveSixths = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.PicaIgnoreFiveSixths = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.PicaIgnoreFiveSixths = "False"; if (XtraFlags.SpaceFoRNOSecNumb == "True") fmtdata.SectData.StepSectionData.StpSectLayData.SpaceForNoSecNumb = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.SpaceForNoSecNumb = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.SpaceForNoSecNumb = "False"; if (XtraFlags.PageBreakOnFirstBlankLine == "True") fmtdata.SectData.StepSectionData.StpSectLayData.PageBreakOnFirstBlankLine = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.PageBreakOnFirstBlankLine = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.PageBreakOnFirstBlankLine = "False"; if (XtraFlags.PutOnPageByItself == "True") fmtdata.SectData.StepSectionData.StpSectLayData.PutOnPageByItself = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.PutOnPageByItself = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.PutOnPageByItself = "False"; if (XtraFlags.PaginateAtHighestPaginLevel == "True") fmtdata.SectData.StepSectionData.StpSectLayData.PaginateAtHighestPaginLevel = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.PaginateAtHighestPaginLevel = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.PaginateAtHighestPaginLevel = "False"; if (XtraFlags.UseSTExtraRealValue == "True") fmtdata.SectData.StepSectionData.StpSectLayData.UseSTExtraRealValue = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.UseSTExtraRealValue = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.UseSTExtraRealValue = "False"; if (XtraFlags.DoSectionSeparatorLine == "True") fmtdata.SectData.StepSectionData.StpSectLayData.DoSectionSeparatorLine = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.DoSectionSeparatorLine = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.DoSectionSeparatorLine = "False"; if (XtraFlags.TieTabToLevel == "True") fmtdata.SectData.StepSectionData.StpSectLayData.TieTabToLevel = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.TieTabToLevel = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.TieTabToLevel = "False"; if (XtraFlags.HighLevelRNOBeforeAERSubStps == "True") fmtdata.SectData.StepSectionData.StpSectLayData.HighLevelRNOBeforeAERSubsteps = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.HighLevelRNOBeforeAERSubsteps = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.HighLevelRNOBeforeAERSubsteps = "False"; if (XtraFlags.UseStepTypeWidthOverride == "True") fmtdata.SectData.StepSectionData.StpSectLayData.UseStepTypeWidthOverride = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.UseStepTypeWidthOverride = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.UseStepTypeWidthOverride = "False"; if (XtraFlags.UseStepTypeWidthOverrideEditPrint == "True") fmtdata.SectData.StepSectionData.StpSectLayData.UseStepTypeWidthOverrideEditPrint = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.UseStepTypeWidthOverrideEditPrint = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.UseStepTypeWidthOverrideEditPrint = "False"; if (XtraFlags.PartialStepCompression == "True") fmtdata.SectData.StepSectionData.StpSectLayData.PartialStepCompression = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.PartialStepCompression = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.PartialStepCompression = "False"; if (XtraFlags.VirtualDotInHLSTab == "True") fmtdata.SectData.StepSectionData.StpSectLayData.VirtualDotInHLSTab = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.VirtualDotInHLSTab = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.VirtualDotInHLSTab = "False"; if (XtraFlags.OverrideEnhancedTabs == "True") fmtdata.SectData.StepSectionData.StpSectLayData.OverrideEnhancedTabs = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.OverrideEnhancedTabs = "False"; + else fmtdata.SectData.StepSectionData.StpSectLayData.OverrideEnhancedTabs = "False"; if (XtraFlags.NoRNO == "True") fmtdata.SectData.StepSectionData.StpSectLayData.RNO = "False"; - else fmtdata.SectData.StepSectionData.StpSectLayData.RNO = "True"; + else fmtdata.SectData.StepSectionData.StpSectLayData.RNO = "True"; if (XtraFlags.OnlySingleColumn == "True") fmtdata.SectData.StepSectionData.StpSectLayData.OnlySingleColumn = "True"; - else fmtdata.SectData.StepSectionData.StpSectLayData.OnlySingleColumn = "False"; -#endregion + else fmtdata.SectData.StepSectionData.StpSectLayData.OnlySingleColumn = "False"; + #endregion #region StepSection if (XtraFlags.WolfCreekBackgroundFormat == "True") fmtdata.SectData.StepSectionData.WolfCreekBackgroundFormat = "True"; - else fmtdata.SectData.StepSectionData.WolfCreekBackgroundFormat = "False"; + else fmtdata.SectData.StepSectionData.WolfCreekBackgroundFormat = "False"; if (XtraFlags.WolfcreekCKLFormat == "True") fmtdata.SectData.StepSectionData.WolfcreekCKLFormat = "True"; - else fmtdata.SectData.StepSectionData.WolfcreekCKLFormat = "False"; + else fmtdata.SectData.StepSectionData.WolfcreekCKLFormat = "False"; if (XtraFlags.WolfcreekCKLBackgndFormat == "True") fmtdata.SectData.StepSectionData.WolfcreekCKLBackgndFormat = "True"; - else fmtdata.SectData.StepSectionData.WolfcreekCKLBackgndFormat = "False"; + else fmtdata.SectData.StepSectionData.WolfcreekCKLBackgndFormat = "False"; if (XtraFlags.FortranFormatNumbers == "True") fmtdata.SectData.StepSectionData.FortranFormatNumbers = "True"; - else fmtdata.SectData.StepSectionData.FortranFormatNumbers = "False"; + else fmtdata.SectData.StepSectionData.FortranFormatNumbers = "False"; if (XtraFlags.UseTopContinueMessageAtEnd == "True") fmtdata.SectData.StepSectionData.UseTopContinueMessageAtEnd = "True"; - else fmtdata.SectData.StepSectionData.UseTopContinueMessageAtEnd = "False"; + else fmtdata.SectData.StepSectionData.UseTopContinueMessageAtEnd = "False"; if (XtraFlags.FloatingContinueMessage == "True") fmtdata.SectData.StepSectionData.FloatingContinueMessage = "True"; - else fmtdata.SectData.StepSectionData.FloatingContinueMessage = "False"; + else fmtdata.SectData.StepSectionData.FloatingContinueMessage = "False"; if (XtraFlags.WrapSameAsEdit == "True") fmtdata.SectData.StepSectionData.WrapSameAsEdit = "True"; - else fmtdata.SectData.StepSectionData.WrapSameAsEdit = "False"; + else fmtdata.SectData.StepSectionData.WrapSameAsEdit = "False"; if (XtraFlags.ContinueSectionHeader == "True") fmtdata.SectData.StepSectionData.ContinueSectionHeader = "True"; - else fmtdata.SectData.StepSectionData.ContinueSectionHeader = "False"; + else fmtdata.SectData.StepSectionData.ContinueSectionHeader = "False"; if (XtraFlags.CompressHPSub == "True") fmtdata.SectData.StepSectionData.CompressHPSub = "True"; - else fmtdata.SectData.StepSectionData.CompressHPSub = "False"; + else fmtdata.SectData.StepSectionData.CompressHPSub = "False"; if (XtraFlags.CompressHPSuper == "True") fmtdata.SectData.StepSectionData.CompressHPSuper = "True"; - else fmtdata.SectData.StepSectionData.CompressHPSuper = "False"; - if (XtraFlags.UndSpecialStepsFoldout == "True") fmtdata.SectData.StepSectionData.UndSpecialStepsFoldout = "True"; - else fmtdata.SectData.StepSectionData.UndSpecialStepsFoldout = "False"; + else fmtdata.SectData.StepSectionData.CompressHPSuper = "False"; + //if (XtraFlags.UndSpecialStepsFoldout == "True") fmtdata.SectData.StepSectionData.UndSpecialStepsFoldout = "True"; + //else fmtdata.SectData.StepSectionData.UndSpecialStepsFoldout = "False"; if (XtraFlags.UnderlineAllMetaTitles == "True") fmtdata.SectData.StepSectionData.UnderlineAllMetaTitles = "True"; - else fmtdata.SectData.StepSectionData.UnderlineAllMetaTitles = "False"; + else fmtdata.SectData.StepSectionData.UnderlineAllMetaTitles = "False"; if (XtraFlags.BoldOnlySectionZero == "True") fmtdata.SectData.StepSectionData.BoldOnlySectionZero = "True"; - else fmtdata.SectData.StepSectionData.BoldOnlySectionZero = "False"; + else fmtdata.SectData.StepSectionData.BoldOnlySectionZero = "False"; if (XtraFlags.ImperfectStructure == "True") fmtdata.SectData.StepSectionData.ImperfectStructure = "True"; - else fmtdata.SectData.StepSectionData.ImperfectStructure = "False"; + else fmtdata.SectData.StepSectionData.ImperfectStructure = "False"; if (XtraFlags.ImperfectSubstep == "True") fmtdata.SectData.StepSectionData.ImperfectSubstep = "True"; - else fmtdata.SectData.StepSectionData.ImperfectSubstep = "False"; + else fmtdata.SectData.StepSectionData.ImperfectSubstep = "False"; if (XtraFlags.ImperfectStructurePlus4 == "True") fmtdata.SectData.StepSectionData.ImperfectStructurePlus4 = "True"; - else fmtdata.SectData.StepSectionData.ImperfectStructurePlus4 = "False"; + else fmtdata.SectData.StepSectionData.ImperfectStructurePlus4 = "False"; if (XtraFlags.CountAllSubLevels == "True") fmtdata.SectData.StepSectionData.CountAllSubLevels = "True"; - else fmtdata.SectData.StepSectionData.CountAllSubLevels = "False"; + else fmtdata.SectData.StepSectionData.CountAllSubLevels = "False"; if (XtraFlags.UseMultiLineSectionTitle == "True") fmtdata.SectData.StepSectionData.UseMultiLineSectionTitle = "True"; - else fmtdata.SectData.StepSectionData.UseMultiLineSectionTitle = "False"; -#endregion + else fmtdata.SectData.StepSectionData.UseMultiLineSectionTitle = "False"; + #endregion #region ChangeBars if (XtraFlags.CondensedChangeBar == "True") fmtdata.ProcData.ChangeBarData.CondensedChangeBar = "True"; - else fmtdata.ProcData.ChangeBarData.CondensedChangeBar = "False"; + else fmtdata.ProcData.ChangeBarData.CondensedChangeBar = "False"; if (XtraFlags.AbsoluteFixedChangeColumn == "True") fmtdata.ProcData.ChangeBarData.AbsoluteFixedChangeColumn = "True"; - else fmtdata.ProcData.ChangeBarData.AbsoluteFixedChangeColumn = "False"; + else fmtdata.ProcData.ChangeBarData.AbsoluteFixedChangeColumn = "False"; if (XtraFlags.ContinuousChangeBars == "True") fmtdata.ProcData.ChangeBarData.ContinuousChangeBars = "True"; - else fmtdata.ProcData.ChangeBarData.ContinuousChangeBars = "False"; + else fmtdata.ProcData.ChangeBarData.ContinuousChangeBars = "False"; if (XtraFlags.ChgBarMessageFromEdit == "True") fmtdata.ProcData.ChangeBarData.ChgBarMessageFromEdit = "True"; - else fmtdata.ProcData.ChangeBarData.ChgBarMessageFromEdit = "False"; + else fmtdata.ProcData.ChangeBarData.ChgBarMessageFromEdit = "False"; if (XtraFlags.MultipleChangeIds == "True") fmtdata.ProcData.ChangeBarData.MultipleChangeIds = "True"; - else fmtdata.ProcData.ChangeBarData.MultipleChangeIds = "False"; + else fmtdata.ProcData.ChangeBarData.MultipleChangeIds = "False"; if (XtraFlags.ChangeBarToRNOSep == "True") fmtdata.ProcData.ChangeBarData.ChangeBarToRNOSep = "True"; - else fmtdata.ProcData.ChangeBarData.ChangeBarToRNOSep = "False"; + else fmtdata.ProcData.ChangeBarData.ChangeBarToRNOSep = "False"; if (XtraFlags.ChangeBarsOnLinkedText == "True") fmtdata.ProcData.ChangeBarData.ChangeBarsOnLinkedText = "True"; - else fmtdata.ProcData.ChangeBarData.ChangeBarsOnLinkedText = "False"; + else fmtdata.ProcData.ChangeBarData.ChangeBarsOnLinkedText = "False"; #endregion #region GeneralPrint & GeneralEdit if (XtraFlags.DoRevDate == "True") fmtdata.PrintData.DoRevDate = "True"; - else fmtdata.PrintData.DoRevDate = "False"; + else fmtdata.PrintData.DoRevDate = "False"; if (XtraFlags.AlternateFoldoutPages == "True") fmtdata.PrintData.AlternateFoldoutPages = "True"; - else fmtdata.PrintData.AlternateFoldoutPages = "False"; + else fmtdata.PrintData.AlternateFoldoutPages = "False"; if (XtraFlags.AlternateFloatingFoldout == "True") fmtdata.PrintData.AlternateFloatingFoldout = "True"; - else fmtdata.PrintData.AlternateFloatingFoldout = "False"; + else fmtdata.PrintData.AlternateFloatingFoldout = "False"; if (XtraFlags.SectionLevelFoldouts == "True") fmtdata.PrintData.SectionLevelFoldouts = "True"; - else fmtdata.PrintData.SectionLevelFoldouts = "False"; + else fmtdata.PrintData.SectionLevelFoldouts = "False"; if (XtraFlags.RevDateWithForwardSlash == "True") fmtdata.PrintData.RevDateWithForwardSlash = "True"; - else fmtdata.PrintData.RevDateWithForwardSlash = "False"; - if (XtraFlags.SpecialStepsFoldout == "True") fmtdata.PrintData.SpecialStepsFoldout = "True"; - else fmtdata.PrintData.SpecialStepsFoldout = "False"; + else fmtdata.PrintData.RevDateWithForwardSlash = "False"; + //if (XtraFlags.SpecialStepsFoldout == "True") fmtdata.PrintData.SpecialStepsFoldout = "True"; + //else fmtdata.PrintData.SpecialStepsFoldout = "False"; if (XtraFlags.AccessoryDocsInDuplex == "True") fmtdata.PrintData.AccessoryDocsInDuplex = "True"; - else fmtdata.PrintData.AccessoryDocsInDuplex = "False"; + else fmtdata.PrintData.AccessoryDocsInDuplex = "False"; if (XtraFlags.FoldoutsInDuplex == "True") fmtdata.PrintData.FoldoutsInDuplex = "True"; - else fmtdata.PrintData.FoldoutsInDuplex = "False"; + else fmtdata.PrintData.FoldoutsInDuplex = "False"; if (XtraFlags.PagelistChangeIDsWithCommas == "True") fmtdata.PrintData.PagelistChangeIDsWithCommas = "True"; - else fmtdata.PrintData.PagelistChangeIDsWithCommas = "False"; + else fmtdata.PrintData.PagelistChangeIDsWithCommas = "False"; if (XtraFlags.PromptForCautinType == "True") fmtdata.EditData.PromptForCautionType = "True"; - else fmtdata.EditData.PromptForCautionType = "False"; - fmtdata.PrintData.AllowDuplex = _fmtFileName.StartsWith("WPB") || _fmtFileName.StartsWith("WEP2")? "True":"False"; + else fmtdata.EditData.PromptForCautionType = "False"; + fmtdata.PrintData.AllowDuplex = _fmtFileName.StartsWith("WPB") || _fmtFileName.StartsWith("WEP2") ? "True" : "False"; #endregion #region Procedure if (XtraFlags.DontCapitalizeTitle == "True") fmtdata.ProcData.CapitalizeTitle = "False"; - else fmtdata.ProcData.CapitalizeTitle = "True"; + else fmtdata.ProcData.CapitalizeTitle = "True"; if (XtraFlags.ChangeStyleForEverySection == "True") fmtdata.ProcData.ChangeStyleForEverySection = "True"; - else fmtdata.ProcData.ChangeStyleForEverySection = "False"; + else fmtdata.ProcData.ChangeStyleForEverySection = "False"; if (XtraFlags.DontPrintNoTitle == "True") fmtdata.ProcData.PrintNoTitle = "False"; - else fmtdata.ProcData.PrintNoTitle = "True"; + else fmtdata.ProcData.PrintNoTitle = "True"; if (XtraFlags.DontCountFoldoutPages == "True") fmtdata.ProcData.CountFoldoutPages = "False"; - else fmtdata.ProcData.CountFoldoutPages = "True"; + else fmtdata.ProcData.CountFoldoutPages = "True"; #endregion #region Section - if (XtraFlags.CancelSecTitlesOnS1 == "True") fmtdata.SectData.CancelSecTitlesOnS1 = "True"; - else fmtdata.SectData.CancelSecTitlesOnS1 = "False"; - if (XtraFlags.CancelSecTitlesOnS2 == "True") fmtdata.SectData.CancelSecTitlesOnS2 = "True"; - else fmtdata.SectData.CancelSecTitlesOnS2 = "False"; - if (XtraFlags.CancelSecTitlesOnE0 == "True") fmtdata.SectData.CancelSecTitlesOnE0 = "True"; - else fmtdata.SectData.CancelSecTitlesOnE0 = "False"; - if (XtraFlags.CancelSecTitlesOnE2 == "True") fmtdata.SectData.CancelSecTitlesOnE2 = "True"; - else fmtdata.SectData.CancelSecTitlesOnE2 = "False"; + //if (XtraFlags.CancelSecTitlesOnS1 == "True") fmtdata.SectData.CancelSecTitlesOnS1 = "True"; + //else fmtdata.SectData.CancelSecTitlesOnS1 = "False"; + //if (XtraFlags.CancelSecTitlesOnS2 == "True") fmtdata.SectData.CancelSecTitlesOnS2 = "True"; + //else fmtdata.SectData.CancelSecTitlesOnS2 = "False"; + //if (XtraFlags.CancelSecTitlesOnE0 == "True") fmtdata.SectData.CancelSecTitlesOnE0 = "True"; + //else fmtdata.SectData.CancelSecTitlesOnE0 = "False"; + //if (XtraFlags.CancelSecTitlesOnE2 == "True") fmtdata.SectData.CancelSecTitlesOnE2 = "True"; + //else fmtdata.SectData.CancelSecTitlesOnE2 = "False"; if (XtraFlags.MetaSectEndMessage == "True") fmtdata.SectData.MetaSectEndMessage = "True"; - else fmtdata.SectData.MetaSectEndMessage = "False"; + else fmtdata.SectData.MetaSectEndMessage = "False"; if (XtraFlags.ReadOnlyTypeInContMsg == "True") fmtdata.SectData.ReadOnlyTypeInContMsg = "True"; - else fmtdata.SectData.ReadOnlyTypeInContMsg = "False"; + else fmtdata.SectData.ReadOnlyTypeInContMsg = "False"; if (XtraFlags.DontReplaceWordsInROs == "True") fmtdata.SectData.ReplaceWordsInROs = "False"; - else fmtdata.SectData.ReplaceWordsInROs = "True"; + else fmtdata.SectData.ReplaceWordsInROs = "True"; if (XtraFlags.UseMetaSections == "True") fmtdata.SectData.UseMetaSections = "True"; - else fmtdata.SectData.UseMetaSections = "False"; + else fmtdata.SectData.UseMetaSections = "False"; if (XtraFlags.NonEditableSteps == "True") fmtdata.SectData.NonEditableSteps = "True"; - else fmtdata.SectData.NonEditableSteps = "False"; + else fmtdata.SectData.NonEditableSteps = "False"; if (XtraFlags.SearchAllReplaceWords == "True") fmtdata.SectData.SearchAllReplaceWords = "True"; - else fmtdata.SectData.SearchAllReplaceWords = "False"; + else fmtdata.SectData.SearchAllReplaceWords = "False"; if (XtraFlags.SecTitleContinue == "True") fmtdata.SectData.SecTitleContinue = "True"; - else fmtdata.SectData.SecTitleContinue = "False"; + else fmtdata.SectData.SecTitleContinue = "False"; if (XtraFlags.DontConvertCaretToDelta == "True") fmtdata.SectData.ConvertCaretToDelta = "False"; - else fmtdata.SectData.ConvertCaretToDelta = "True"; + else fmtdata.SectData.ConvertCaretToDelta = "True"; #endregion #region StepSectionPrint if (XtraFlags.LowerCaseRevnum == "True") fmtdata.SectData.StepSectionData.StpSectPrtData.LowerCaseRevNum = "True"; - else fmtdata.SectData.StepSectionData.StpSectPrtData.LowerCaseRevNum = "False"; + else fmtdata.SectData.StepSectionData.StpSectPrtData.LowerCaseRevNum = "False"; if (XtraFlags.UseXtraRevNumber == "True") fmtdata.SectData.StepSectionData.StpSectPrtData.UseXtraRevNumber = "True"; - else fmtdata.SectData.StepSectionData.StpSectPrtData.UseXtraRevNumber = "False"; + else fmtdata.SectData.StepSectionData.StpSectPrtData.UseXtraRevNumber = "False"; if (XtraFlags.SpecialLandscapeMode == "True") fmtdata.SectData.StepSectionData.StpSectPrtData.SpecialLandscapeMode = "True"; - else fmtdata.SectData.StepSectionData.StpSectPrtData.SpecialLandscapeMode = "False"; + else fmtdata.SectData.StepSectionData.StpSectPrtData.SpecialLandscapeMode = "False"; #endregion #region CheckOff if (XtraFlags.DropCheckOff == "True") fmtdata.ProcData.CheckOffData.DropCheckOff = "True"; - else fmtdata.ProcData.CheckOffData.DropCheckOff = "False"; + else fmtdata.ProcData.CheckOffData.DropCheckOff = "False"; if (XtraFlags.CheckoffOnHLSOnly == "True") fmtdata.ProcData.CheckOffData.CheckOffOnHLSOnly = "True"; - else fmtdata.ProcData.CheckOffData.CheckOffOnHLSOnly = "False"; + else fmtdata.ProcData.CheckOffData.CheckOffOnHLSOnly = "False"; #endregion #region Trans if (XtraFlags.SpecifiedSubstepsOnly == "True") fmtdata.TransData.SpecifiedSubstepsOnly = "True"; - else fmtdata.TransData.SpecifiedSubstepsOnly = "False"; + else fmtdata.TransData.SpecifiedSubstepsOnly = "False"; if (XtraFlags.CapsTransitions == "True") fmtdata.TransData.CapsTransitions = "True"; - else fmtdata.TransData.CapsTransitions = "False"; + else fmtdata.TransData.CapsTransitions = "False"; if (XtraFlags.CapTranStep == "True") fmtdata.TransData.CapTranStep = "True"; - else fmtdata.TransData.CapTranStep = "False"; + else fmtdata.TransData.CapTranStep = "False"; if (XtraFlags.TSTepNoFlag == "True") fmtdata.TransData.TStepNoFlag = "True"; - else fmtdata.TransData.TStepNoFlag = "False"; + else fmtdata.TransData.TStepNoFlag = "False"; if (XtraFlags.LowerCaseTranNumber == "True") fmtdata.TransData.LowerCaseTranNumber = "True"; - else fmtdata.TransData.LowerCaseTranNumber = "False"; + else fmtdata.TransData.LowerCaseTranNumber = "False"; if (XtraFlags.UpcaseTranAnd == "True") fmtdata.TransData.UpcaseTranAnd = "True"; - else fmtdata.TransData.UpcaseTranAnd = "False"; + else fmtdata.TransData.UpcaseTranAnd = "False"; if (XtraFlags.SuppressAndInTran == "True") fmtdata.TransData.SuppressAndInTran = "True"; - else fmtdata.TransData.SuppressAndInTran = "False"; + else fmtdata.TransData.SuppressAndInTran = "False"; if (XtraFlags.Cap1stCharTrans == "True") fmtdata.TransData.Cap1stCharTrans = "True"; - else fmtdata.TransData.Cap1stCharTrans = "False"; + else fmtdata.TransData.Cap1stCharTrans = "False"; if (XtraFlags.UseTransitionModifier == "True") fmtdata.TransData.UseTransitionModifier = "True"; - else fmtdata.TransData.UseTransitionModifier = "False"; + else fmtdata.TransData.UseTransitionModifier = "False"; if (XtraFlags.DontUseSecTitles == "True") fmtdata.TransData.UseSecTitles = "False"; - else fmtdata.TransData.UseSecTitles = "True"; + else fmtdata.TransData.UseSecTitles = "True"; if (XtraFlags.HardSpTranProcNumb == "True") fmtdata.TransData.HardSpTranProcNumb = "True"; - else fmtdata.TransData.HardSpTranProcNumb = "False"; + else fmtdata.TransData.HardSpTranProcNumb = "False"; if (XtraFlags.XChngTranSpForHard == "True") fmtdata.TransData.XchngTranSpForHard = "True"; - else fmtdata.TransData.XchngTranSpForHard = "False"; + else fmtdata.TransData.XchngTranSpForHard = "False"; if (XtraFlags.AbsoluteTransitionUpdate == "True") fmtdata.TransData.AbsoluteTransitionUpdate = "True"; - else fmtdata.TransData.AbsoluteTransitionUpdate = "False"; + else fmtdata.TransData.AbsoluteTransitionUpdate = "False"; if (XtraFlags.LowerCaseStepInTran == "True") fmtdata.TransData.LowerCaseStepInTran = "True"; - else fmtdata.TransData.LowerCaseStepInTran = "False"; + else fmtdata.TransData.LowerCaseStepInTran = "False"; if (XtraFlags.DoSectionTrans == "True") fmtdata.TransData.DoSectionTransitions = "True"; - else fmtdata.TransData.DoSectionTransitions = "False"; + else fmtdata.TransData.DoSectionTransitions = "False"; #endregion #region RO if (XtraFlags.AllUnits == "True") fmtdata.ROData.AllUnits = "True"; - else fmtdata.ROData.AllUnits = "False"; + else fmtdata.ROData.AllUnits = "False"; if (XtraFlags.UpSetpntAftrDash == "True") fmtdata.ROData.UpRoAftrDash = "True"; - else fmtdata.ROData.UpRoAftrDash = "False"; + else fmtdata.ROData.UpRoAftrDash = "False"; if (XtraFlags.UpcaseAllSetpointUnits == "True") fmtdata.ROData.UpcaseAllRoUnits = "True"; - else fmtdata.ROData.UpcaseAllRoUnits = "False"; + else fmtdata.ROData.UpcaseAllRoUnits = "False"; if (XtraFlags.CapHighSetpnt == "True") fmtdata.ROData.CapHighRo = "True"; - else fmtdata.ROData.CapHighRo = "False"; + else fmtdata.ROData.CapHighRo = "False"; if (XtraFlags.CapsPIFLastLower == "True") fmtdata.ROData.CapRoIfLastLower = "True"; - else fmtdata.ROData.CapRoIfLastLower = "False"; + else fmtdata.ROData.CapRoIfLastLower = "False"; if (XtraFlags.UpSpIfPrevUpper == "True") fmtdata.ROData.UpRoIfPrevUpper = "True"; - else fmtdata.ROData.UpRoIfPrevUpper = "False"; + else fmtdata.ROData.UpRoIfPrevUpper = "False"; if (XtraFlags.UnderlineSetpoints == "True") fmtdata.ROData.UnderlineRo = "True"; - else fmtdata.ROData.UnderlineRo = "False"; + else fmtdata.ROData.UnderlineRo = "False"; if (XtraFlags.CapFirstLetterInHighSP == "True") fmtdata.ROData.CapFirstLetterInHighRO = "True"; - else fmtdata.ROData.CapFirstLetterInHighRO = "False"; + else fmtdata.ROData.CapFirstLetterInHighRO = "False"; #endregion return true; } @@ -4003,7 +4010,7 @@ namespace fmtxml // for procedures, if the menu string contains a 'procedure', then the // selection will come from a menu, otherwise, it defaults to current procedure // and the menu will be disabled. - result |= (xlt & E_TransFormatXlate.Procedure)== E_TransFormatXlate.Procedure ? E_TransitionMenus.ProcMenu : E_TransitionMenus.ProcCur; + result |= (xlt & E_TransFormatXlate.Procedure) == E_TransFormatXlate.Procedure ? E_TransitionMenus.ProcMenu : E_TransitionMenus.ProcCur; // for sections... if ((xlt & E_TransFormatXlate.Section) == E_TransFormatXlate.Section) @@ -4030,7 +4037,7 @@ namespace fmtxml } else result |= E_TransitionMenus.StepFirst; - if (((result & E_TransitionMenus.SectDefault) == E_TransitionMenus.SectDefault) || ((result & E_TransitionMenus.SectMenuAny)==E_TransitionMenus.SectMenuAny)) + if (((result & E_TransitionMenus.SectDefault) == E_TransitionMenus.SectDefault) || ((result & E_TransitionMenus.SectMenuAny) == E_TransitionMenus.SectMenuAny)) result |= E_TransitionMenus.StepAllowNone; return result; @@ -4047,7 +4054,7 @@ namespace fmtxml } private static bool HasProc(string str) { - return str.Contains("{Proc")||str.Contains("{?.Proc"); + return str.Contains("{Proc") || str.Contains("{?.Proc"); } private static bool HasPage(string str) { @@ -4055,7 +4062,7 @@ namespace fmtxml } private static bool HasSection(string str) { - return str.Contains("{Sect")||str.Contains("{?.Sect"); + return str.Contains("{Sect") || str.Contains("{?.Sect"); } private static bool HasRange(string str) { @@ -4073,92 +4080,92 @@ namespace fmtxml else if (p == 0x40) return "{ALPHA}"; else return "{UNKNOWN}"; } - #endregion - private static Dictionary _TransForms= new Dictionary(); - public static XslCompiledTransform getTransform(string path) + #endregion + private static Dictionary _TransForms = new Dictionary(); + public static XslCompiledTransform getTransform(string path) + { + if (!_TransForms.ContainsKey(path)) { - if (!_TransForms.ContainsKey(path)) - { - XslCompiledTransform xsl = new XslCompiledTransform(); - xsl.Load(path); - _TransForms.Add(path, xsl); - } - return _TransForms[path]; + XslCompiledTransform xsl = new XslCompiledTransform(); + xsl.Load(path); + _TransForms.Add(path, xsl); } - public bool WriteOutXmlTmp(FormatData fmtdata, string suffix) + return _TransForms[path]; + } + public bool WriteOutXmlTmp(FormatData fmtdata, string suffix) + { + try { - try - { - XmlSerializer serializer = new XmlSerializer(typeof(FormatData)); - string lfmtname = fmtName; - int findx = fmtName.IndexOf('.'); - // for subformats, make the name FMT_00 where FMT is format name & 00 is number - // from original name. This will allow the data load to know it's a sub. - if (findx > 0) - lfmtname = fmtName.Substring(0, fmtName.Length - 4) + "_" + fmtName.Substring(fmtName.Length - 2, 2); - string destfile = "tmp_fmt_xml\\" + lfmtname + "_" + suffix + ".xml"; - if (File.Exists(destfile)) File.Delete(destfile); - TextWriter writer = new StreamWriter(destfile); - _MyFormatSerializer.Serialize(writer, fmtdata); - writer.Close(); - return true; - } - catch (Exception e) - { - Console.WriteLine("Error writing out xml or xsl - format = {0}", fmtdata.Name); - Console.WriteLine(e.Message); - Console.WriteLine(); - return false; - } - } - #region WriteOutXml - static private XmlSerializer _MyFormatSerializer = new XmlSerializer(typeof(FormatData)); - public bool WriteOutXml(FormatData fmtdata) - { - // First serialize files based on the above - then use xsl to transform - // into prefered xml. - if (!Directory.Exists("fmt_xml")) Directory.CreateDirectory("fmt_xml"); - if (!Directory.Exists("tmp_fmt_xml")) Directory.CreateDirectory("tmp_fmt_xml"); - //XmlSerializer serializer = new XmlSerializer(typeof(FormatData)); - + XmlSerializer serializer = new XmlSerializer(typeof(FormatData)); string lfmtname = fmtName; int findx = fmtName.IndexOf('.'); // for subformats, make the name FMT_00 where FMT is format name & 00 is number // from original name. This will allow the data load to know it's a sub. if (findx > 0) lfmtname = fmtName.Substring(0, fmtName.Length - 4) + "_" + fmtName.Substring(fmtName.Length - 2, 2); - string destfile = "tmp_fmt_xml\\" + lfmtname + "f.xml"; + string destfile = "tmp_fmt_xml\\" + lfmtname + "_" + suffix + ".xml"; if (File.Exists(destfile)) File.Delete(destfile); TextWriter writer = new StreamWriter(destfile); - try - { - _MyFormatSerializer.Serialize(writer, fmtdata); - writer.Close(); - //XslCompiledTransform xsl = new XslCompiledTransform(); - //xsl.Load(Application.StartupPath + "\\TranslateFmt.XSL"); - string sResults = "fmt_xml\\" + lfmtname + "f.xml"; - //xsl.Transform(destfile, sResults); // Perform Transform - XslCompiledTransform xsl = getTransform(Application.StartupPath + "\\TranslateFmt.XSL"); - xsl.Transform(destfile, sResults); // Perform Transform - xsl = getTransform(Application.StartupPath + "\\removeempty.XSL"); - //xsl.Load(Application.StartupPath + "\\removeempty.XSL"); - string sResults2 = "fmt_xml\\" + lfmtname + "xf.xml"; - xsl.Transform(sResults, sResults2); - File.Delete(sResults); - xsl.Transform(sResults2, sResults); - File.Delete(sResults2); - } - - catch (Exception e) - { - Console.WriteLine("Error writing out xml or xsl - format = {0}", fmtdata.Name); - Console.WriteLine(e.Message); - Console.WriteLine(); - return false; - } + _MyFormatSerializer.Serialize(writer, fmtdata); + writer.Close(); return true; } - #endregion + catch (Exception e) + { + Console.WriteLine("Error writing out xml or xsl - format = {0}", fmtdata.Name); + Console.WriteLine(e.Message); + Console.WriteLine(); + return false; + } + } + #region WriteOutXml + static private XmlSerializer _MyFormatSerializer = new XmlSerializer(typeof(FormatData)); + public bool WriteOutXml(FormatData fmtdata) + { + // First serialize files based on the above - then use xsl to transform + // into prefered xml. + if (!Directory.Exists("fmt_xml")) Directory.CreateDirectory("fmt_xml"); + if (!Directory.Exists("tmp_fmt_xml")) Directory.CreateDirectory("tmp_fmt_xml"); + //XmlSerializer serializer = new XmlSerializer(typeof(FormatData)); + + string lfmtname = fmtName; + int findx = fmtName.IndexOf('.'); + // for subformats, make the name FMT_00 where FMT is format name & 00 is number + // from original name. This will allow the data load to know it's a sub. + if (findx > 0) + lfmtname = fmtName.Substring(0, fmtName.Length - 4) + "_" + fmtName.Substring(fmtName.Length - 2, 2); + string destfile = "tmp_fmt_xml\\" + lfmtname + "f.xml"; + if (File.Exists(destfile)) File.Delete(destfile); + TextWriter writer = new StreamWriter(destfile); + try + { + _MyFormatSerializer.Serialize(writer, fmtdata); + writer.Close(); + //XslCompiledTransform xsl = new XslCompiledTransform(); + //xsl.Load(Application.StartupPath + "\\TranslateFmt.XSL"); + string sResults = "fmt_xml\\" + lfmtname + "f.xml"; + //xsl.Transform(destfile, sResults); // Perform Transform + XslCompiledTransform xsl = getTransform(Application.StartupPath + "\\TranslateFmt.XSL"); + xsl.Transform(destfile, sResults); // Perform Transform + xsl = getTransform(Application.StartupPath + "\\removeempty.XSL"); + //xsl.Load(Application.StartupPath + "\\removeempty.XSL"); + string sResults2 = "fmt_xml\\" + lfmtname + "xf.xml"; + xsl.Transform(sResults, sResults2); + File.Delete(sResults); + xsl.Transform(sResults2, sResults); + File.Delete(sResults2); + } + + catch (Exception e) + { + Console.WriteLine("Error writing out xml or xsl - format = {0}", fmtdata.Name); + Console.WriteLine(e.Message); + Console.WriteLine(); + return false; + } + return true; + } + #endregion #region OriginalNoBase //public void LoadFormatFileOrig(string fname) //{ @@ -4203,311 +4210,325 @@ namespace fmtxml // #endregion //} #endregion - #region InheritBase - public void LoadFormatFile(string fname, ref XtraFlgs XtraFlags) - { - FormatData fmtdata = new FormatData(); - - // read in data & put into correct place of structures. - // for test string fnm = "E:\\proms.net\\exe\\fmtxml\\" + fname; - string fnm = MyPath + @"\" + fname; - brFmt = new BinaryReader(File.Open(fnm, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite, FileShare.ReadWrite)); - bool success = ReadInFmtFile(ref fmtdata, ref BaseXtraFlags, fname); - FixInactiveForHigh(ref fmtdata); - FixInactiveForSubStep(ref fmtdata); - FixInactiveForText(ref fmtdata); - //OutputStepFonts(fname, fmtdata); + #region InheritBase + public void LoadFormatFile(string fname, ref XtraFlgs XtraFlags) + { + FormatData fmtdata = new FormatData(); + + // read in data & put into correct place of structures. + // for test string fnm = "E:\\proms.net\\exe\\fmtxml\\" + fname; + string fnm = MyPath + @"\" + fname; + brFmt = new BinaryReader(File.Open(fnm, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite, FileShare.ReadWrite)); + bool success = ReadInFmtFile(ref fmtdata, ref BaseXtraFlags, fname); + FixInactiveForHigh(ref fmtdata); + FixInactiveForSubStep(ref fmtdata); + FixInactiveForText(ref fmtdata); if (!HasBase) InitSymbols(ref fmtdata); else fmtdata.Symbols = null; - if (success) - { - //success = WriteOutXmlTmp(fmtdata, "beforeStep"); - DoStepInheritance(ref fmtdata.StepData); - //success = WriteOutXml(fmtdata); - } - brFmt.Close(); - // Now compare with gen (if !gen). - if (HasBase == false) - success = WriteOutXml(fmtdata); - else + if (success) + { + PushStepLists(fmtdata.StepData); + DoStepInheritance(ref fmtdata.StepData); + } + brFmt.Close(); + + // Now compare with gen (if !gen). + if (HasBase == false) + success = WriteOutXml(fmtdata); + else + { + //success = WriteOutXmlTmp(fmtdata, "beforeParent"); + success = CompareParentSub(BaseFormat, ref fmtdata); + success = WriteOutXml(fmtdata); + + // For each sub-format, load the entire file & compare to parent contents + DirectoryInfo di = new DirectoryInfo(MyPath); + string substr = fname.Substring(0, fname.IndexOf('.')) + ".x*"; + FileInfo[] fis = di.GetFiles(substr); + foreach (FileInfo fi in fis) + { + if (!Form1.Excluded(fi)) + { + //this.listBox1.Items.Add(fi.Name); + fmtName = fi.Name; + fnm = MyPath + @"\" + fi.Name; + brFmt = new BinaryReader(File.Open(fnm, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite, FileShare.ReadWrite)); + FormatData subdata = new FormatData(); + success = ReadInFmtFile(ref subdata, ref SubXtraFlags, fi.Name); + //OutputStepFonts(fi.Name, subdata); + if (success) { - //success = WriteOutXmlTmp(fmtdata, "beforeParent"); - success = CompareParentSub(BaseFormat, ref fmtdata); - success = WriteOutXml(fmtdata); - - // For each sub-format, load the entire file & compare to parent contents - DirectoryInfo di = new DirectoryInfo(MyPath); - string substr = fname.Substring(0, fname.IndexOf('.')) + ".x*"; - FileInfo[] fis = di.GetFiles(substr); - foreach (FileInfo fi in fis) - { - if (!Form1.Excluded(fi)) - { - //this.listBox1.Items.Add(fi.Name); - fmtName = fi.Name; - fnm = MyPath + @"\" + fi.Name; - brFmt = new BinaryReader(File.Open(fnm, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite, FileShare.ReadWrite)); - FormatData subdata = new FormatData(); - success = ReadInFmtFile(ref subdata, ref SubXtraFlags, fi.Name); - //OutputStepFonts(fi.Name, subdata); - if (success) - { - DoStepInheritance(ref subdata.StepData); - } - // Now do entire format inheritance - then write out. - success = CompareParentSub(fmtdata, ref subdata); - success = CompareParentSub(BaseFormat, ref subdata); - success = WriteOutXml(subdata); - } - } - } - MyFormat = fmtdata; - } - - private static void OutputStepFonts1(string fname, FormatData fmtdata) - { - if (fname == "BASE.fmt") - { - Console.Write("'Name','Description'"); - for (int i = 0; i < MAXSTEPS + 1; i++) - { - Console.Write(",'{0}'", fmtdata.StepData[i].Type); + PushStepLists(subdata.StepData); + DoStepInheritance(ref subdata.StepData); + PopStepLists(); + } + // Now do entire format inheritance - then write out. + success = CompareParentSub(fmtdata, ref subdata); + success = CompareParentSub(BaseFormat, ref subdata); + success = WriteOutXml(subdata); } - Console.Write("\r\n"); - Console.Write("'base','Default'"); } - else - Console.Write("'{0}','{1}'", FixName(fname), fmtdata.Name); + } + MyFormat = fmtdata; + if (HasBase) PopStepLists(); // leave the base format on 'stack', i.e. only pop if !base. + } + + private void PushStepLists(Step[] stpdata) + { + Dictionary dicSteps = BuildStepDic(stpdata); + StepList.Insert(0, dicSteps); + Dictionary dicParents = BuildParentDic(stpdata, dicSteps); + StepParentList.Insert(0, dicParents); + } + private void PopStepLists() + { + StepList.RemoveAt(0); + StepParentList.RemoveAt(0); + } + private static void OutputStepFonts1(string fname, FormatData fmtdata) + { + if (fname == "BASE.fmt") + { + Console.Write("'Name','Description'"); for (int i = 0; i < MAXSTEPS + 1; i++) { - if (fmtdata.StepData[i].Font != null) - Console.Write(",'{0} [{1}] - {2}'", fmtdata.StepData[i].Font.FontFamily, fmtdata.StepData[i].Font.FontSize, fmtdata.StepData[i].Font.FontStyle); - else if (i == 1 && fmtdata.StepData[0].Font != null) - Console.Write(",'{0} [{1}] - {2}'", fmtdata.StepData[0].Font.FontFamily, fmtdata.StepData[0].Font.FontSize, fmtdata.StepData[0].Font.FontStyle); - else - Console.Write(",'Prestige Elite Tall [10] - None'"); + Console.Write(",'{0}'", fmtdata.StepData[i].Type); } Console.Write("\r\n"); + Console.Write("'base','Default'"); } - private static void OutputStepFonts(string fname, FormatData fmtdata) + else + Console.Write("'{0}','{1}'", FixName(fname), fmtdata.Name); + for (int i = 0; i < MAXSTEPS + 1; i++) { - if (fname == "BASE.fmt") - { - Console.Write("'Name','Description'"); - for (int i = 0; i < MAXSTEPS + 1; i++) - { - Console.Write(",'{0}'", fmtdata.StepData[i].Type); - } - Console.Write("\r\n"); - Console.Write("'base','Default'"); - } + if (fmtdata.StepData[i].Font != null) + Console.Write(",'{0} [{1}] - {2}'", fmtdata.StepData[i].Font.FontFamily, fmtdata.StepData[i].Font.FontSize, fmtdata.StepData[i].Font.FontStyle); + else if (i == 1 && fmtdata.StepData[0].Font != null) + Console.Write(",'{0} [{1}] - {2}'", fmtdata.StepData[0].Font.FontFamily, fmtdata.StepData[0].Font.FontSize, fmtdata.StepData[0].Font.FontStyle); else - Console.Write("'{0}','{1}'", FixName(fname), fmtdata.Name); + Console.Write(",'Prestige Elite Tall [10] - None'"); + } + Console.Write("\r\n"); + } + private static void OutputStepFonts(string fname, FormatData fmtdata) + { + if (fname == "BASE.fmt") + { + Console.Write("'Name','Description'"); for (int i = 0; i < MAXSTEPS + 1; i++) { - if (fmtdata.StepData[i].TabData.Font != null) - Console.Write(",'{0} [{1}] - {2}'", fmtdata.StepData[i].TabData.Font.FontFamily, fmtdata.StepData[i].TabData.Font.FontSize, fmtdata.StepData[i].TabData.Font.FontStyle); - else if (i == 1 && fmtdata.StepData[0].TabData.Font != null) - Console.Write(",'{0} [{1}] - {2}'", fmtdata.StepData[0].TabData.Font.FontFamily, fmtdata.StepData[0].TabData.Font.FontSize, fmtdata.StepData[0].TabData.Font.FontStyle); - else - Console.Write(",'*'"); + Console.Write(",'{0}'", fmtdata.StepData[i].Type); } Console.Write("\r\n"); + Console.Write("'base','Default'"); } - private static string FixName(string fname) + else + Console.Write("'{0}','{1}'", FixName(fname), fmtdata.Name); + for (int i = 0; i < MAXSTEPS + 1; i++) { - string lfmtname = fname; - int findx = fname.IndexOf('.'); - // for subformats, make the name FMT_00 where FMT is format name & 00 is number - // from original name. This will allow the data load to know it's a sub. - if (findx > 0) - { - if(fname.ToUpper().EndsWith(".FMT")) - lfmtname = fname.Substring(0, fname.Length - 4); - else - lfmtname = fname.Substring(0, fname.Length - 4) + fname.Substring(fname.Length - 2, 2); - } - return lfmtname; + if (fmtdata.StepData[i].TabData.Font != null) + Console.Write(",'{0} [{1}] - {2}'", fmtdata.StepData[i].TabData.Font.FontFamily, fmtdata.StepData[i].TabData.Font.FontSize, fmtdata.StepData[i].TabData.Font.FontStyle); + else if (i == 1 && fmtdata.StepData[0].TabData.Font != null) + Console.Write(",'{0} [{1}] - {2}'", fmtdata.StepData[0].TabData.Font.FontFamily, fmtdata.StepData[0].TabData.Font.FontSize, fmtdata.StepData[0].TabData.Font.FontStyle); + else + Console.Write(",'*'"); } + Console.Write("\r\n"); + } + private static string FixName(string fname) + { + string lfmtname = fname; + int findx = fname.IndexOf('.'); + // for subformats, make the name FMT_00 where FMT is format name & 00 is number + // from original name. This will allow the data load to know it's a sub. + if (findx > 0) + { + if (fname.ToUpper().EndsWith(".FMT")) + lfmtname = fname.Substring(0, fname.Length - 4); + else + lfmtname = fname.Substring(0, fname.Length - 4) + fname.Substring(fname.Length - 2, 2); + } + return lfmtname; + } private void InitSymbols(ref FormatData fmtdata) { fmtdata.Symbols = new Symbol[35]; - fmtdata.Symbols[0].Unicode="176"; - fmtdata.Symbols[0].Desc="degree"; - fmtdata.Symbols[1].Unicode="916"; - fmtdata.Symbols[1].Desc="delta"; - fmtdata.Symbols[2].Unicode="8805"; - fmtdata.Symbols[2].Desc="greater than or equal"; - fmtdata.Symbols[3].Unicode="8804"; - fmtdata.Symbols[3].Desc="less than or equal"; - fmtdata.Symbols[4].Unicode="177"; - fmtdata.Symbols[4].Desc="plus minus"; - fmtdata.Symbols[5].Unicode="931"; - fmtdata.Symbols[5].Desc="sigma"; - fmtdata.Symbols[6].Unicode="947"; + fmtdata.Symbols[0].Unicode = "176"; + fmtdata.Symbols[0].Desc = "degree"; + fmtdata.Symbols[1].Unicode = "916"; + fmtdata.Symbols[1].Desc = "delta"; + fmtdata.Symbols[2].Unicode = "8805"; + fmtdata.Symbols[2].Desc = "greater than or equal"; + fmtdata.Symbols[3].Unicode = "8804"; + fmtdata.Symbols[3].Desc = "less than or equal"; + fmtdata.Symbols[4].Unicode = "177"; + fmtdata.Symbols[4].Desc = "plus minus"; + fmtdata.Symbols[5].Unicode = "931"; + fmtdata.Symbols[5].Desc = "sigma"; + fmtdata.Symbols[6].Unicode = "947"; fmtdata.Symbols[6].Desc = "gamma"; - fmtdata.Symbols[7].Unicode="189"; + fmtdata.Symbols[7].Unicode = "189"; fmtdata.Symbols[7].Desc = "half"; - fmtdata.Symbols[8].Unicode="9604"; + fmtdata.Symbols[8].Unicode = "9604"; fmtdata.Symbols[8].Desc = "accum"; - fmtdata.Symbols[9].Unicode="9679"; + fmtdata.Symbols[9].Unicode = "9679"; fmtdata.Symbols[9].Desc = "bullet"; - fmtdata.Symbols[10].Unicode="8776"; + fmtdata.Symbols[10].Unicode = "8776"; fmtdata.Symbols[10].Desc = "approx eq"; - fmtdata.Symbols[11].Unicode="8773"; + fmtdata.Symbols[11].Unicode = "8773"; fmtdata.Symbols[11].Desc = "similar eq"; - fmtdata.Symbols[12].Unicode="247"; + fmtdata.Symbols[12].Unicode = "247"; fmtdata.Symbols[12].Desc = "division"; - fmtdata.Symbols[13].Unicode="8730"; - fmtdata.Symbols[13].Desc="square root"; - fmtdata.Symbols[14].Unicode="961"; + fmtdata.Symbols[13].Unicode = "8730"; + fmtdata.Symbols[13].Desc = "square root"; + fmtdata.Symbols[14].Unicode = "961"; fmtdata.Symbols[14].Desc = "rho"; - fmtdata.Symbols[15].Unicode="960"; + fmtdata.Symbols[15].Unicode = "960"; fmtdata.Symbols[15].Desc = "pi"; - fmtdata.Symbols[16].Unicode="956"; + fmtdata.Symbols[16].Unicode = "956"; fmtdata.Symbols[16].Desc = "micro"; - fmtdata.Symbols[17].Unicode="948"; + fmtdata.Symbols[17].Unicode = "948"; fmtdata.Symbols[17].Desc = "lower case delta"; - fmtdata.Symbols[18].Unicode="963"; + fmtdata.Symbols[18].Unicode = "963"; fmtdata.Symbols[18].Desc = "lower case sigma"; - fmtdata.Symbols[19].Unicode="188"; + fmtdata.Symbols[19].Unicode = "188"; fmtdata.Symbols[19].Desc = "quarter"; - fmtdata.Symbols[20].Unicode="216"; + fmtdata.Symbols[20].Unicode = "216"; fmtdata.Symbols[20].Desc = "dist zero"; - fmtdata.Symbols[21].Unicode="274"; + fmtdata.Symbols[21].Unicode = "274"; fmtdata.Symbols[21].Desc = "energy"; - fmtdata.Symbols[22].Unicode="236"; + fmtdata.Symbols[22].Unicode = "236"; fmtdata.Symbols[22].Desc = "grave"; - fmtdata.Symbols[23].Unicode="9474"; + fmtdata.Symbols[23].Unicode = "9474"; fmtdata.Symbols[23].Desc = "bar"; - fmtdata.Symbols[24].Unicode="949"; + fmtdata.Symbols[24].Unicode = "949"; fmtdata.Symbols[24].Desc = "epsilon"; - fmtdata.Symbols[25].Unicode="952"; + fmtdata.Symbols[25].Unicode = "952"; fmtdata.Symbols[25].Desc = "theta"; - fmtdata.Symbols[26].Unicode="8857"; + fmtdata.Symbols[26].Unicode = "8857"; fmtdata.Symbols[26].Desc = "dot in oval"; - fmtdata.Symbols[27].Unicode="964"; + fmtdata.Symbols[27].Unicode = "964"; fmtdata.Symbols[27].Desc = "tau"; - fmtdata.Symbols[28].Unicode="9830"; + fmtdata.Symbols[28].Unicode = "9830"; fmtdata.Symbols[28].Desc = "diamond"; - fmtdata.Symbols[29].Unicode="8594"; + fmtdata.Symbols[29].Unicode = "8594"; fmtdata.Symbols[29].Desc = "right arrow"; - fmtdata.Symbols[30].Unicode="8592"; + fmtdata.Symbols[30].Unicode = "8592"; fmtdata.Symbols[30].Desc = "left arrow"; - fmtdata.Symbols[31].Unicode="8593"; + fmtdata.Symbols[31].Unicode = "8593"; fmtdata.Symbols[31].Desc = "up arrow"; - fmtdata.Symbols[32].Unicode="8595"; + fmtdata.Symbols[32].Unicode = "8595"; fmtdata.Symbols[32].Desc = "down arrow"; - fmtdata.Symbols[33].Unicode="8711"; + fmtdata.Symbols[33].Unicode = "8711"; fmtdata.Symbols[33].Desc = "unknown5"; } - #endregion - #region TokenConvert - private string ConvertTransFormat(string p) - { + #endregion + #region TokenConvert + private string ConvertTransFormat(string p) + { // parenflag puts paren around proc title AND sectitle. - p=p.Replace("\xff","\xA0"); - p=p.Replace("\x07","{First Step}"); - p=p.Replace("\x08","{Last Step}"); - p=p.Replace("\x04","{Sect Title}"); - p = p.Replace("\x06", "{Sect Title}"); - p=p.Replace("\x03","{Sect Num}"); - p = p.Replace("\x17", "{Sect Num}"); - p = p.Replace("\x02", "{Proc Title}"); - p = p.Replace("\x01", "{Proc Num}"); + p = p.Replace("\xff", "\xA0"); + p = p.Replace("\x07", "{First Step}"); + p = p.Replace("\x08", "{Last Step}"); + p = p.Replace("\x04", "{Sect Title}"); + p = p.Replace("\x06", "{Sect Title}"); + p = p.Replace("\x03", "{Sect Num}"); + p = p.Replace("\x17", "{Sect Num}"); + p = p.Replace("\x02", "{Proc Title}"); + p = p.Replace("\x01", "{Proc Num}"); p = p.Replace("\xF", "{Page Num}"); p = p.Replace("\x1E", "{Page Num}"); - p = p.Replace("\x1D", "{Step Text}"); - p = p.Replace("\x0D", "Step {First Step}"); + p = p.Replace("\x1D", "{Step Text}"); + p = p.Replace("\x0D", "Step {First Step}"); - // the following are in cpl & she format Not sure what to do so just - // flag them - //if (p.Length==1 && (p.IndexOfAny("\x19\x1A".ToCharArray())>-1)) - //{ - p = p.Replace("\x19", "{TransFmt hex 19}"); - p = p.Replace("\x1A", "{TransFmt hex 1a}"); - //} + // the following are in cpl & she format Not sure what to do so just + // flag them + //if (p.Length==1 && (p.IndexOfAny("\x19\x1A".ToCharArray())>-1)) + //{ + p = p.Replace("\x19", "{TransFmt hex 19}"); + p = p.Replace("\x1A", "{TransFmt hex 1a}"); + //} - p = ConvertText(p); - p = DoReplaceTokens(p); - return p; - } - private string DoReplaceTokens(string p) - { - if (p == null || p == "") return p; - string wkstr = p; - // use regular expressions to do the following... + p = ConvertText(p); + p = DoReplaceTokens(p); + return p; + } + private string DoReplaceTokens(string p) + { + if (p == null || p == "") return p; + string wkstr = p; + // use regular expressions to do the following... - try - { - // replace newline with {par} - wkstr = wkstr.Replace("\n", @"{\par}"); + try + { + // replace newline with {par} + wkstr = wkstr.Replace("\n", @"{\par}"); - // special change bar token (various cpl formats) - wkstr = wkstr.Replace("\x08\x08\x08\x08\x08\x05", "{CHG_BAR with Backspace Token}"); + // special change bar token (various cpl formats) + wkstr = wkstr.Replace("\x08\x08\x08\x08\x08\x05", "{CHG_BAR with Backspace Token}"); - // special change bar token (various gpc formats) - wkstr = wkstr.Replace("\x05", "{CHG_BAR Token}"); + // special change bar token (various gpc formats) + wkstr = wkstr.Replace("\x05", "{CHG_BAR Token}"); - // backspage - just flag for positioning if needed. - wkstr = wkstr.Replace("\x08", "{Backspace}"); + // backspage - just flag for positioning if needed. + wkstr = wkstr.Replace("\x08", "{Backspace}"); - //sub on/off + //sub on/off //sub on/off - stop at EOL, another token or a space. - wkstr = wkstr.Replace("\x19\x19", "\x19"); // replace double sub on with single - wkstr = wkstr.Replace("~~", "\x19"); - wkstr = Regex.Replace(wkstr, @"\x19([^\x19\x18 ]*?)(?:[\x19\x18]|(?= )|\Z)(.*?)", @"\sub $1\nosupersub $2"); + wkstr = wkstr.Replace("\x19\x19", "\x19"); // replace double sub on with single + wkstr = wkstr.Replace("~~", "\x19"); + wkstr = Regex.Replace(wkstr, @"\x19([^\x19\x18 ]*?)(?:[\x19\x18]|(?= )|\Z)(.*?)", @"\sub $1\nosupersub $2"); - //super on/off + //super on/off //super on/off - stop at EOL, another token or a space. - wkstr = Regex.Replace(wkstr, @"\x18([^\x19\x18 ]*?)(?:[\x19\x18]|(?= )|\Z)(.*?)", @"\super $1\nosupersub $2"); + wkstr = Regex.Replace(wkstr, @"\x18([^\x19\x18 ]*?)(?:[\x19\x18]|(?= )|\Z)(.*?)", @"\super $1\nosupersub $2"); //bold on/off - stop at end of line or another token. wkstr = Regex.Replace(wkstr, @"\x01([^\x01]*?)(?:\x01|\Z)", @"\b $1\b0 "); - //OLD CODE (pre-10/2007): wkstr = Regex.Replace(wkstr, @"\x01([^\x01 ]*?)(?:[\x01]|(?= )|\Z)(.*?)", @"\b$1\b0$2"); + //OLD CODE (pre-10/2007): wkstr = Regex.Replace(wkstr, @"\x01([^\x01 ]*?)(?:[\x01]|(?= )|\Z)(.*?)", @"\b$1\b0$2"); //bold on/off - stop at EOL, another token or a space wkstr = Regex.Replace(wkstr, @"\x13([^\x13\xd6 ]*?)(?:[\x13\xd6]|(?= )|\Z)(.*?)", @"\b $1\b0 $2"); - //underline on/off - look for 16 followed by non-sixteen (as many as there are) and followed by 16 or endofline - //OLD CODE (pre-10/2007): wkstr = Regex.Replace(wkstr, @"\x16([^\x16 ]*?)(?:[\x16]|(?= )|\Z)(.*?)", @"\ul$1\ul0$2"); + //underline on/off - look for 16 followed by non-sixteen (as many as there are) and followed by 16 or endofline + //OLD CODE (pre-10/2007): wkstr = Regex.Replace(wkstr, @"\x16([^\x16 ]*?)(?:[\x16]|(?= )|\Z)(.*?)", @"\ul$1\ul0$2"); //underline on/off - stop at end of line or another token. //wkstr = Regex.Replace(wkstr, @"\x16([^\x16]*?)(?:\x16|\Z)", @"\ul $1\ul0 "); wkstr = Regex.Replace(wkstr, @"\x16([^\x16]*?)(?:\x16|\Z)", @"\ul $1\ulnone "); - //narrator - wkstr = Regex.Replace(wkstr, @"\x86([^\x86 ]*?)(?:[\x86]|(?= )|\Z)(.*?)", @"\f{Narrator}$1\f0$2"); + //narrator + wkstr = Regex.Replace(wkstr, @"\x86([^\x86 ]*?)(?:[\x86]|(?= )|\Z)(.*?)", @"\f{Narrator}$1\f0$2"); - // remove hanging indent, vertical tab - wkstr = Regex.Replace(wkstr, @"\x02", @"\NonSupported Hanging Indent (Hex x02)"); - wkstr = Regex.Replace(wkstr, @"\x0B", @"\NonSupported Vertical Tab (Hex x0b"); - - // remove some unknown chars for ano & fpl - these plants are not supported - // as of conversion date. - wkstr = Regex.Replace(wkstr, @"\x95", @"\NonSupported Unknown (Hex x95)"); //ano2vlv - wkstr = Regex.Replace(wkstr, @"\x1bf1", @"\NonSupported Unknown (hex 1b f1)"); //fpl - wkstr = Regex.Replace(wkstr, @"\x1bf0", @"\NonSupported Unknown (hex 1b f0)"); //fpl - wkstr = Regex.Replace(wkstr, @"\x1bM1", @"\NonSupported Unknown (hex 1b M1)"); //fpl - wkstr = Regex.Replace(wkstr, @"\x1bM0", @"\NonSupported Unknown (hex 1b M0)"); //fpl + // remove hanging indent, vertical tab + wkstr = Regex.Replace(wkstr, @"\x02", @"\NonSupported Hanging Indent (Hex x02)"); + wkstr = Regex.Replace(wkstr, @"\x0B", @"\NonSupported Vertical Tab (Hex x0b"); - // replace \xff with \xA0, i.e. hardspace - wkstr = Regex.Replace(wkstr, @"\xFF", @"\xA0"); + // remove some unknown chars for ano & fpl - these plants are not supported + // as of conversion date. + wkstr = Regex.Replace(wkstr, @"\x95", @"\NonSupported Unknown (Hex x95)"); //ano2vlv + wkstr = Regex.Replace(wkstr, @"\x1bf1", @"\NonSupported Unknown (hex 1b f1)"); //fpl + wkstr = Regex.Replace(wkstr, @"\x1bf0", @"\NonSupported Unknown (hex 1b f0)"); //fpl + wkstr = Regex.Replace(wkstr, @"\x1bM1", @"\NonSupported Unknown (hex 1b M1)"); //fpl + wkstr = Regex.Replace(wkstr, @"\x1bM0", @"\NonSupported Unknown (hex 1b M0)"); //fpl - // replace x10 & x11 in various ano tabs - not this needs fixed if ANO comes - // back into the program - wkstr = wkstr.Replace("\x10",""); - wkstr = wkstr.Replace("\x11", ""); + // replace \xff with \xA0, i.e. hardspace + wkstr = Regex.Replace(wkstr, @"\xFF", @"\xA0"); - // replace x15 with {RO} for now. - wkstr = wkstr.Replace("\x15","{RO}"); - } - catch (Exception ex) - { - Console.WriteLine("error replacing token (regex) = {0}", ex.Message); - } + // replace x10 & x11 in various ano tabs - not this needs fixed if ANO comes + // back into the program + wkstr = wkstr.Replace("\x10", ""); + wkstr = wkstr.Replace("\x11", ""); - return wkstr; - } + // replace x15 with {RO} for now. + wkstr = wkstr.Replace("\x15", "{RO}"); + } + catch (Exception ex) + { + Console.WriteLine("error replacing token (regex) = {0}", ex.Message); + } + + return wkstr; + } private float CalculateTabWid(string p) { if (p == null || p.Length == 0) return 0; @@ -4525,21 +4546,21 @@ namespace fmtxml tablen -= 2; // "{}" } if ((tokb = p.IndexOf("\xA1")) > -1) tablen--; // flags circle macro - if ((tokb = p.IndexOf("##-3#"))> -1) tablen -= 5; // positioning + if ((tokb = p.IndexOf("##-3#")) > -1) tablen -= 5; // positioning if ((tokb = p.IndexOf("\xAF")) > -1) tablen--; // indent if ((tokb = p.IndexOf("\n")) > -1) tablen--; // newline - not sure what to do here if ((tokb = p.IndexOf("ê")) > -1) tablen--; // box step flag - for (int i=0; i0) + if (indxColon > 0) wkstr = wkstr.Insert(indxColon, "{numeric}"); - else if (indxPercent>0) - wkstr = wkstr.Insert(indxPercent+1, "{numeric}"); // put numeric after section prefix + else if (indxPercent > 0) + wkstr = wkstr.Insert(indxPercent + 1, "{numeric}"); // put numeric after section prefix else wkstr = wkstr.Insert(1, "{numeric}"); } @@ -4605,7 +4626,7 @@ namespace fmtxml wkstr = Regex.Replace(wkstr, @"{![.*?]}", @"{!$1}"); wkstr = wkstr.Replace("{}", ""); wkstr = wkstr.Replace("ñ", "{!C0}"); - if (vefont != null && vefont.HasCircleString2()) wkstr.Insert(0,"{!C0}"); + if (vefont != null && vefont.HasCircleString2()) wkstr.Insert(0, "{!C0}"); // Symbols // * - simply an asterisk (do nothing here) @@ -4617,181 +4638,88 @@ namespace fmtxml wkstr = ConvertText(wkstr); return wkstr; } - #endregion - #region DoEntireInherit - private bool CompareParentSub(FormatData mainFmt, ref FormatData subFmt) - { - // just compare all fields - clear the subformat if equal. - #region COMPAREACTIVE + #endregion + #region DoEntireInherit + private bool CompareParentSub(FormatData mainFmt, ref FormatData subFmt) + { + // just compare all fields - clear the subformat if equal. + #region COMPAREACTIVE subFmt.FontData = FixInheritedFont(subFmt.FontData, mainFmt.FontData); // Phase 10 - if (mainFmt.PurchaseOptions == subFmt.PurchaseOptions) subFmt.PurchaseOptions = null; + if (mainFmt.PurchaseOptions == subFmt.PurchaseOptions) subFmt.PurchaseOptions = null; if (mainFmt.TPL == subFmt.TPL) subFmt.TPL = null; - if (mainFmt.EditData.EMode == subFmt.EditData.EMode) subFmt.EditData.EMode = null; + if (mainFmt.EditData.EMode == subFmt.EditData.EMode) subFmt.EditData.EMode = null; if (mainFmt.EditData.PromptForCautionType != null && mainFmt.EditData.PromptForCautionType == subFmt.EditData.PromptForCautionType) subFmt.EditData.PromptForCautionType = "null"; - if (mainFmt.SectData.StepSectionData.TopRow == subFmt.SectData.StepSectionData.TopRow) subFmt.SectData.StepSectionData.TopRow = 0; - if (mainFmt.PrintData.DoPrnDrvrAdjusts == subFmt.PrintData.DoPrnDrvrAdjusts) subFmt.PrintData.DoPrnDrvrAdjusts = 0; + if (mainFmt.SectData.StepSectionData.TopRow == subFmt.SectData.StepSectionData.TopRow) subFmt.SectData.StepSectionData.TopRow = 0; + if (mainFmt.PrintData.DoPrnDrvrAdjusts == subFmt.PrintData.DoPrnDrvrAdjusts) subFmt.PrintData.DoPrnDrvrAdjusts = 0; if (mainFmt.PrintData.DoRevDate != null && mainFmt.PrintData.DoRevDate == subFmt.PrintData.DoRevDate) subFmt.PrintData.DoRevDate = "null"; if (mainFmt.PrintData.AlternateFoldoutPages != null && mainFmt.PrintData.AlternateFoldoutPages == subFmt.PrintData.AlternateFoldoutPages) subFmt.PrintData.AlternateFoldoutPages = "null"; if (mainFmt.PrintData.AlternateFloatingFoldout != null && mainFmt.PrintData.AlternateFloatingFoldout == subFmt.PrintData.AlternateFloatingFoldout) subFmt.PrintData.AlternateFloatingFoldout = "null"; if (mainFmt.PrintData.SectionLevelFoldouts != null && mainFmt.PrintData.SectionLevelFoldouts == subFmt.PrintData.SectionLevelFoldouts) subFmt.PrintData.SectionLevelFoldouts = "null"; if (mainFmt.PrintData.RevDateWithForwardSlash != null && mainFmt.PrintData.RevDateWithForwardSlash == subFmt.PrintData.RevDateWithForwardSlash) subFmt.PrintData.RevDateWithForwardSlash = "null"; - if (mainFmt.PrintData.SpecialStepsFoldout != null && mainFmt.PrintData.SpecialStepsFoldout == subFmt.PrintData.SpecialStepsFoldout) subFmt.PrintData.SpecialStepsFoldout = "null"; + //if (mainFmt.PrintData.SpecialStepsFoldout != null && mainFmt.PrintData.SpecialStepsFoldout == subFmt.PrintData.SpecialStepsFoldout) subFmt.PrintData.SpecialStepsFoldout = "null"; if (mainFmt.PrintData.AccessoryDocsInDuplex != null && mainFmt.PrintData.AccessoryDocsInDuplex == subFmt.PrintData.AccessoryDocsInDuplex) subFmt.PrintData.AccessoryDocsInDuplex = "null"; if (mainFmt.PrintData.AllowDuplex != null && mainFmt.PrintData.AllowDuplex == subFmt.PrintData.AllowDuplex) subFmt.PrintData.AllowDuplex = "null"; if (mainFmt.PrintData.FoldoutsInDuplex != null && mainFmt.PrintData.FoldoutsInDuplex == subFmt.PrintData.FoldoutsInDuplex) subFmt.PrintData.FoldoutsInDuplex = "null"; if (mainFmt.PrintData.PagelistChangeIDsWithCommas != null && mainFmt.PrintData.PagelistChangeIDsWithCommas == subFmt.PrintData.PagelistChangeIDsWithCommas) subFmt.PrintData.PagelistChangeIDsWithCommas = "null"; - // compare step data, step index by step index. This assumes that step data between - // the two indices is the same. - for (int i = 0; i < MAXSTEPS; i++) - { - Step mstp = mainFmt.StepData[i]; - Step sstp = subFmt.StepData[i]; - if (mstp.StepLayoutData.ForeColor == sstp.StepLayoutData.ForeColor) subFmt.StepData[i].StepLayoutData.ForeColor = null; - if (mstp.StepLayoutData.BackColor == sstp.StepLayoutData.BackColor) subFmt.StepData[i].StepLayoutData.BackColor = null; - if (mstp.StepLayoutData.STExtraSpace == sstp.StepLayoutData.STExtraSpace) subFmt.StepData[i].StepLayoutData.STExtraSpace = null; - // don't inherit stboxindex because box definition may not be the same. - //if (mstp.StepLayoutData.STBoxindex == sstp.StepLayoutData.STBoxindex) subFmt.StepData[i].StepLayoutData.STBoxindex = null; - if (mstp.StepPrintData.PosAdjust == sstp.StepPrintData.PosAdjust) subFmt.StepData[i].StepPrintData.PosAdjust = null; - if (mstp.StepEditData.AcTable == sstp.StepEditData.AcTable) subFmt.StepData[i].StepEditData.AcTable = null; - if (mstp.StepLayoutData.EveryNLines == sstp.StepLayoutData.EveryNLines) subFmt.StepData[i].StepLayoutData.EveryNLines = null; - if (mstp.StepLayoutData.SpaceBefore == sstp.StepLayoutData.SpaceBefore) subFmt.StepData[i].StepLayoutData.SpaceBefore = null; - if (mstp.StepLayoutData.SpaceAfter == sstp.StepLayoutData.SpaceAfter) subFmt.StepData[i].StepLayoutData.SpaceAfter = null; - if (mstp.StepLayoutData.AlwaysUpperCase == sstp.StepLayoutData.AlwaysUpperCase) subFmt.StepData[i].StepLayoutData.AlwaysUpperCase = null; - if (mstp.StepLayoutData.PageBreakAtTypeChange == sstp.StepLayoutData.PageBreakAtTypeChange) subFmt.StepData[i].StepLayoutData.PageBreakAtTypeChange = null; - if (mstp.StepLayoutData.AlignWithParentTab == sstp.StepLayoutData.AlignWithParentTab) subFmt.StepData[i].StepLayoutData.AlignWithParentTab = null; - if (mstp.StepLayoutData.StepTypeWidthOverride == sstp.StepLayoutData.StepTypeWidthOverride) subFmt.StepData[i].StepLayoutData.StepTypeWidthOverride = null; - if (mstp.VertPos == sstp.VertPos) subFmt.StepData[i].VertPos = null; - if (mstp.DoubleSpace != null && mstp.DoubleSpace == sstp.DoubleSpace) subFmt.StepData[i].DoubleSpace = "null"; - if (mstp.EnhancedStepNumFromPrev != null && mstp.EnhancedStepNumFromPrev == sstp.EnhancedStepNumFromPrev) subFmt.StepData[i].EnhancedStepNumFromPrev = "null"; - if (mstp.UseSmartTemplate != null && mstp.UseSmartTemplate == sstp.UseSmartTemplate) subFmt.StepData[i].UseSmartTemplate = "null"; - if (mstp.AlwaysUseExtraLines != null && mstp.AlwaysUseExtraLines == sstp.AlwaysUseExtraLines) subFmt.StepData[i].AlwaysUseExtraLines = "null"; - if (mstp.SeparateBox != null && mstp.SeparateBox == sstp.SeparateBox) subFmt.StepData[i].SeparateBox = "null"; - if (mstp.SeparateBoxCautions != null && mstp.SeparateBoxCautions == sstp.SeparateBoxCautions) subFmt.StepData[i].SeparateBoxCautions = "null"; - if (mstp.SpaceDouble != null && mstp.SpaceDouble == sstp.SpaceDouble) subFmt.StepData[i].SpaceDouble = "null"; - if (mstp.ReduceLineAfter != null && mstp.ReduceLineAfter == sstp.ReduceLineAfter) subFmt.StepData[i].ReduceLineAfter = "null"; - if (mstp.SameLevel != null && mstp.SameLevel == sstp.SameLevel) subFmt.StepData[i].SameLevel = "null"; - if (mstp.BoldHighLevel != null && mstp.BoldHighLevel == sstp.BoldHighLevel) subFmt.StepData[i].BoldHighLevel = "null"; - if (mstp.OneLineBeforeTab != null && mstp.OneLineBeforeTab == sstp.OneLineBeforeTab) subFmt.StepData[i].OneLineBeforeTab = "null"; - if (mstp.BoxIt != null && mstp.BoxIt == sstp.BoxIt) subFmt.StepData[i].BoxIt = "null"; - if (mstp.Boxed != null && mstp.Boxed == sstp.Boxed) subFmt.StepData[i].Boxed = "null"; - if (mstp.XLines_StepFix != null && mstp.XLines_StepFix == sstp.XLines_StepFix) subFmt.StepData[i].XLines_StepFix = "null"; - if (mstp.Rebox != null && mstp.Rebox == sstp.Rebox) subFmt.StepData[i].Rebox = "null"; - if (mstp.SpcHdr != null && mstp.SpcHdr == sstp.SpcHdr) subFmt.StepData[i].SpcHdr = "null"; - if (mstp.ContinueOnly != null && mstp.ContinueOnly == sstp.ContinueOnly) subFmt.StepData[i].ContinueOnly = "null"; - if (mstp.SepAfterAER != null && mstp.SepAfterAER == sstp.SepAfterAER) subFmt.StepData[i].SepAfterAER = "null"; - if (mstp.UseAlternateStepBox != null && mstp.UseAlternateStepBox == sstp.UseAlternateStepBox) subFmt.StepData[i].UseAlternateStepBox = "null"; - if (mstp.UnderlineAfterDashSpace != null && mstp.UnderlineAfterDashSpace == sstp.UnderlineAfterDashSpace) subFmt.StepData[i].UnderlineAfterDashSpace = "null"; - if (mstp.SpaceIn != null && mstp.SpaceIn == sstp.SpaceIn) subFmt.StepData[i].SpaceIn = "null"; - if (mstp.PageBreakOnStep != null && mstp.PageBreakOnStep == sstp.PageBreakOnStep) subFmt.StepData[i].PageBreakOnStep = "null"; - if (mstp.AlignNullTabWSectHead != null && mstp.AlignNullTabWSectHead == sstp.AlignNullTabWSectHead) subFmt.StepData[i].AlignNullTabWSectHead = "null"; - if (mstp.TextSubFollowsTextStyle != null && mstp.TextSubFollowsTextStyle == sstp.TextSubFollowsTextStyle) subFmt.StepData[i].TextSubFollowsTextStyle = "null"; - if (mstp.TreatAsSequential != null && mstp.TreatAsSequential == sstp.TreatAsSequential) subFmt.StepData[i].TreatAsSequential = "null"; - if (mstp.MatchUpRNO != null && mstp.MatchUpRNO == sstp.MatchUpRNO) subFmt.StepData[i].MatchUpRNO = "null"; - if (mstp.InPageList != null && mstp.InPageList == sstp.InPageList) subFmt.StepData[i].InPageList = "null"; - if (mstp.CenterOneLineOnly != null && mstp.CenterOneLineOnly == sstp.CenterOneLineOnly) subFmt.StepData[i].CenterOneLineOnly = "null"; - if (mstp.SubTableGetsUp1Level != null && mstp.SubTableGetsUp1Level == sstp.SubTableGetsUp1Level) subFmt.StepData[i].SubTableGetsUp1Level = "null"; - if (mstp.Remember != null && mstp.Remember == sstp.Remember) subFmt.StepData[i].Remember = "null"; - if (mstp.CenterOneLineAdjust != null && mstp.CenterOneLineAdjust == sstp.CenterOneLineAdjust) subFmt.StepData[i].CenterOneLineAdjust = "null"; - if (mstp.Break != null && mstp.Break == sstp.Break) subFmt.StepData[i].Break = "null"; - if (mstp.BreakEquipmentList != null && mstp.BreakEquipmentList == sstp.BreakEquipmentList) subFmt.StepData[i].BreakEquipmentList = "null"; - if (mstp.BreakCautionsNotesOnSubstps != null && mstp.BreakCautionsNotesOnSubstps == sstp.BreakCautionsNotesOnSubstps) subFmt.StepData[i].BreakCautionsNotesOnSubstps = "null"; - if (mstp.CenterTextWithinWidth != null && mstp.CenterTextWithinWidth == sstp.CenterTextWithinWidth) subFmt.StepData[i].CenterTextWithinWidth = "null"; - if (mstp.NewlineAfter != null && mstp.NewlineAfter == sstp.NewlineAfter) subFmt.StepData[i].NewlineAfter = "null"; - if (mstp.StartLineWithDash != null && mstp.StartLineWithDash == sstp.StartLineWithDash) subFmt.StepData[i].StartLineWithDash = "null"; - if (mstp.BlankLineBeforeSubStep != null && mstp.BlankLineBeforeSubStep == sstp.BlankLineBeforeSubStep) subFmt.StepData[i].BlankLineBeforeSubStep = "null"; - if (mstp.AlwaysTab != null && mstp.AlwaysTab == sstp.AlwaysTab) subFmt.StepData[i].AlwaysTab = "null"; - if (mstp.MixCautionsAndNotes != null && mstp.MixCautionsAndNotes == sstp.MixCautionsAndNotes) subFmt.StepData[i].MixCautionsAndNotes = "null"; - if (mstp.NumberHighLevel != null && mstp.NumberHighLevel == sstp.NumberHighLevel) subFmt.StepData[i].NumberHighLevel = "null"; - if (mstp.OffsetTab != null && mstp.OffsetTab == sstp.OffsetTab) subFmt.StepData[i].OffsetTab = "null"; - if (mstp.LeftJustifyBorderless != null && mstp.LeftJustifyBorderless == sstp.LeftJustifyBorderless) subFmt.StepData[i].LeftJustifyBorderless = "null"; - if (mstp.StepNumIfOnlyOne != null && mstp.StepNumIfOnlyOne == sstp.StepNumIfOnlyOne) subFmt.StepData[i].StepNumIfOnlyOne = "null"; - if (mstp.LJTabs != null && mstp.LJTabs == sstp.LJTabs) subFmt.StepData[i].LJTabs = "null"; - if (mstp.NumberSubs != null && mstp.NumberSubs == sstp.NumberSubs) subFmt.StepData[i].NumberSubs = "null"; - if (mstp.Bullet != null && mstp.Bullet == sstp.Bullet) subFmt.StepData[i].Bullet = "null"; - if (mstp.StepNumberForHighLevel != null && mstp.StepNumberForHighLevel == sstp.StepNumberForHighLevel) subFmt.StepData[i].StepNumberForHighLevel = "null"; - if (mstp.SameRowAsParent != null && mstp.SameRowAsParent == sstp.SameRowAsParent) subFmt.StepData[i].SameRowAsParent = "null"; - if (mstp.CheckoffSameAsParent != null && mstp.CheckoffSameAsParent == sstp.CheckoffSameAsParent) subFmt.StepData[i].CheckoffSameAsParent = "null"; - if (mstp.AtLeastTwoDigits != null && mstp.AtLeastTwoDigits == sstp.AtLeastTwoDigits) subFmt.StepData[i].AtLeastTwoDigits = "null"; - if (mstp.UseInAcTable != null && mstp.UseInAcTable == sstp.UseInAcTable) subFmt.StepData[i].UseInAcTable = "null"; - if (mstp.Number != null && mstp.Number == sstp.Number) subFmt.StepData[i].Number = "null"; - if (mstp.ThreeBlanksAbove != null && mstp.ThreeBlanksAbove == sstp.ThreeBlanksAbove) subFmt.StepData[i].ThreeBlanksAbove = "null"; - if (mstp.CheckOffs != null && mstp.CheckOffs == sstp.CheckOffs) subFmt.StepData[i].CheckOffs = "null"; - if (mstp.Quoted != null && mstp.Quoted == sstp.Quoted) subFmt.StepData[i].Quoted = "null"; - if (mstp.Sep == sstp.Sep) subFmt.StepData[i].Sep =null; - if (mstp.Prefix == sstp.Prefix) subFmt.StepData[i].Prefix =null; - if (mstp.Suffix == sstp.Suffix) subFmt.StepData[i].Suffix =null; - // KBR TODO if (mstp.AlternateName == sstp.AlternateName) subFmt.StepData[i].AlternateName = null; - if (mstp.UnderlineTheseChar == sstp.UnderlineTheseChar) subFmt.StepData[i].UnderlineTheseChar = null; - //subFmt.StepData[i].TabData.Font = FixInheritedFont(sstp.TabData.Font, mstp.TabData.Font);// Phase 2 - if (mstp.TabData.IdentEdit == sstp.TabData.IdentEdit) subFmt.StepData[i].TabData.IdentEdit = null; - if (mstp.TabData.Ident == sstp.TabData.Ident) subFmt.StepData[i].TabData.Ident = null; - if (mstp.TabData.RNOIdentEdit == sstp.TabData.RNOIdentEdit) subFmt.StepData[i].TabData.RNOIdentEdit = null; - if (mstp.TabData.RNOIdent == sstp.TabData.RNOIdent) subFmt.StepData[i].TabData.RNOIdent = null; - if (mstp.TabData.IdentEditWid == sstp.TabData.IdentEditWid) subFmt.StepData[i].TabData.IdentEditWid = null; - if (mstp.TabData.IdentWid == sstp.TabData.IdentWid) subFmt.StepData[i].TabData.IdentWid = null; - if (mstp.TabData.RNOIdentEditWid == sstp.TabData.RNOIdentEditWid) subFmt.StepData[i].TabData.RNOIdentEditWid = null; - if (mstp.TabData.RNOIdentWid == sstp.TabData.RNOIdentWid) subFmt.StepData[i].TabData.RNOIdentWid = null; - if (mstp.TabData.Justify == sstp.TabData.Justify) subFmt.StepData[i].TabData.Justify = null; - } - // box data... - for (int i=0; i dicSteps = BuildStepDic(stpdata); - Dictionary dicParents = BuildParentDic(stpdata, dicSteps); - for (int i = 1; i < MAXSTEPS; i++) + } + private string StepPartEditTypeInMenu(Step stp) { return stp.StepEditData.TypeMenu.InMenu; } + private string StepPartEditTypeRnoInMenu(Step stp) { return stp.StepEditData.TypeMenu.RnoInMenu; } + private string StepPartEditTypeMenuItem(Step stp) { return stp.StepEditData.TypeMenu.MenuItem; } + private string StepPartEditTypeRnoMenuItem(Step stp) { return stp.StepEditData.TypeMenu.RnoMenuItem; } + private string StepPartEditTypeNoChg_Reason(Step stp) { return stp.StepEditData.TypeMenu.NoChgReason; } + private string StepPartEditTypeAlternateNameList(Step stp) { return stp.StepEditData.TypeMenu.AlternateNameList; } + private void DoStepInheritance(ref Step[] stpdata) + { + Dictionary dicSteps = BuildStepDic(stpdata); + Dictionary dicParents = BuildParentDic(stpdata, dicSteps); + for (int i = 0; i < MAXSTEPS; i++) { FixInheritance(ref stpdata[i], dicParents); } - } - private void FixInheritance(ref Step step, Dictionary dicParents) - { + } + private void FixInheritance(ref Step step, Dictionary dicParents) + { if (CheckInheritedStr(new StepPartStr(StepPartInactive), step, dicParents)) step.Inactive = null; - if (CheckInheritedStr(new StepPartStr(StepPartColOverride), step, dicParents)) step.StepTypeColOverride = null; - if (CheckInheritedStr(new StepPartStr(StepPartSep), step, dicParents)) step.Sep = null; + if (CheckInheritedStr(new StepPartStr(StepPartColOverride), step, dicParents)) step.StepTypeColOverride = null; + if (CheckInheritedStr(new StepPartStr(StepPartSep), step, dicParents)) step.Sep = null; if (CheckInheritedStr(new StepPartStr(StepPartPrefix), step, dicParents)) step.Prefix = null; - if (CheckInheritedStr(new StepPartStr(StepPartSuffix), step, dicParents)) step.Suffix = null; - if (CheckInheritedStr(new StepPartStr(StepPartUnderlineTheseChar), step, dicParents)) step.UnderlineTheseChar = null; - if (CheckInheritedStr(new StepPartStr(StepPartVertPos), step, dicParents)) step.VertPos = null; - // substructures - Font + if (CheckInheritedStr(new StepPartStr(StepPartSuffix), step, dicParents)) step.Suffix = null; + if (CheckInheritedStr(new StepPartStr(StepPartUnderlineTheseChar), step, dicParents)) step.UnderlineTheseChar = null; + if (CheckInheritedStr(new StepPartStr(StepPartVertPos), step, dicParents)) step.VertPos = null; + // substructures - Font if (step.Font != null && CheckInheritedStr(new StepPartStr(StepPartFontFamily), step, dicParents)) step.Font.FontFamily = null; - if (step.Font != null && CheckInheritedStr(new StepPartStr(StepPartFontStyle), step, dicParents)) - step.Font.FontStyle = null; - if (step.Font != null && CheckInheritedStr(new StepPartStr(StepPartFontSize), step, dicParents)) - step.Font.FontSize = null; + if (step.Font != null && CheckInheritedStr(new StepPartStr(StepPartFontStyle), step, dicParents)) + step.Font.FontStyle = null; + if (step.Font != null && CheckInheritedStr(new StepPartStr(StepPartFontSize), step, dicParents)) + step.Font.FontSize = null; if (step.Font != null && CheckInheritedStr(new StepPartStr(StepPartFontCPI), step, dicParents)) step.Font.CPI = null; if (step.Font != null && CheckInheritedStr(new StepPartStr(StepPartFontJustify), step, dicParents)) step.Font.FontJustify = null; if (step.Font != null && CheckInheritedStr(new StepPartStr(StepPartFontCheckOff), step, dicParents)) step.Font.FontCheckOff = null; - if ((step.Font != null) && (step.Font.FontFamily == null) && (step.Font.FontStyle == null) && (step.Font.FontSize == null) && (step.Font.FontJustify == null) && (step.Font.FontCheckOff == null) && (step.Font.CPI == null)) - step.Font = null; - // substructure - StepLayoutData - if (CheckInheritedStr(new StepPartStr(StepPartLayoutForeColor), step, dicParents)) step.StepLayoutData.ForeColor = null; - if (CheckInheritedStr(new StepPartStr(StepPartLayoutBackColor), step, dicParents)) step.StepLayoutData.BackColor = null; - if (CheckInheritedStr(new StepPartStr(StepPartLayoutSTExtraSpace), step, dicParents)) step.StepLayoutData.STExtraSpace = null; - if (CheckInheritedStr(new StepPartStr(StepPartLayoutSTBoxindex), step, dicParents)) step.StepLayoutData.STBoxindex = null; - if (CheckInheritedStr(new StepPartStr(StepPartLayoutEveryNLines), step, dicParents)) step.StepLayoutData.EveryNLines = null; + if ((step.Font != null) && (step.Font.FontFamily == null) && (step.Font.FontStyle == null) && (step.Font.FontSize == null) && (step.Font.FontJustify == null) && (step.Font.FontCheckOff == null) && (step.Font.CPI == null)) + step.Font = null; + // substructure - StepLayoutData + if (CheckInheritedStr(new StepPartStr(StepPartLayoutForeColor), step, dicParents)) step.StepLayoutData.ForeColor = null; + if (CheckInheritedStr(new StepPartStr(StepPartLayoutBackColor), step, dicParents)) step.StepLayoutData.BackColor = null; + if (CheckInheritedStr(new StepPartStr(StepPartLayoutSTExtraSpace), step, dicParents)) step.StepLayoutData.STExtraSpace = null; + if (CheckInheritedStr(new StepPartStr(StepPartLayoutSTBoxindex), step, dicParents)) step.StepLayoutData.STBoxindex = null; + if (CheckInheritedStr(new StepPartStr(StepPartLayoutEveryNLines), step, dicParents)) step.StepLayoutData.EveryNLines = null; if (CheckInheritedStr(new StepPartStr(StepPartLayoutSpaceBefore), step, dicParents)) step.StepLayoutData.SpaceBefore = null; if (CheckInheritedStr(new StepPartStr(StepPartLayoutSpaceAfter), step, dicParents)) step.StepLayoutData.SpaceAfter = null; - if (CheckInheritedStr(new StepPartStr(StepPartLayoutAlwaysUpperCase), step, dicParents)) step.StepLayoutData.AlwaysUpperCase = null; - if (CheckInheritedStr(new StepPartStr(StepPartLayoutPageBreakAtTypeChange), step, dicParents)) step.StepLayoutData.PageBreakAtTypeChange = null; - if (CheckInheritedStr(new StepPartStr(StepPartLayoutAlignWithParentTab), step, dicParents)) step.StepLayoutData.AlignWithParentTab = null; - //if (CheckInheritedStr(new StepPartStr(StepPartLayoutRtCheckOffGroups), step, dicParents)) step.StepLayoutData.RtCheckOffGroups = null; - if (CheckInheritedStr(new StepPartStr(StepPartLayoutStepTypeWidthOverride), step, dicParents)) step.StepLayoutData.StepTypeWidthOverride = null; - // substructure - StepEditData - if (CheckInheritedStr(new StepPartStr(StepPartEditForeColor), step, dicParents)) step.StepEditData.ForeColor = null; - if (CheckInheritedStr(new StepPartStr(StepPartEditBackColor), step, dicParents)) step.StepEditData.BackColor = null; - if (CheckInheritedStr(new StepPartStr(StepPartEditAcTable), step, dicParents)) step.StepEditData.AcTable = null; + if (CheckInheritedStr(new StepPartStr(StepPartLayoutAlwaysUpperCase), step, dicParents)) step.StepLayoutData.AlwaysUpperCase = null; + if (CheckInheritedStr(new StepPartStr(StepPartLayoutPageBreakAtTypeChange), step, dicParents)) step.StepLayoutData.PageBreakAtTypeChange = null; + if (CheckInheritedStr(new StepPartStr(StepPartLayoutAlignWithParentTab), step, dicParents)) step.StepLayoutData.AlignWithParentTab = null; + //if (CheckInheritedStr(new StepPartStr(StepPartLayoutRtCheckOffGroups), step, dicParents)) step.StepLayoutData.RtCheckOffGroups = null; + if (CheckInheritedStr(new StepPartStr(StepPartLayoutStepTypeWidthOverride), step, dicParents)) step.StepLayoutData.StepTypeWidthOverride = null; + // substructure - StepEditData + if (CheckInheritedStr(new StepPartStr(StepPartEditForeColor), step, dicParents)) step.StepEditData.ForeColor = null; + if (CheckInheritedStr(new StepPartStr(StepPartEditBackColor), step, dicParents)) step.StepEditData.BackColor = null; + if (CheckInheritedStr(new StepPartStr(StepPartEditAcTable), step, dicParents)) step.StepEditData.AcTable = null; if (CheckInheritedStr(new StepPartStr(StepPartEditSearchable), step, dicParents)) step.StepEditData.Searchable = null; // substructure - TypeMenu if (CheckInheritedStr(new StepPartStr(StepPartEditTypeInMenu), step, dicParents)) step.StepEditData.TypeMenu.InMenu = null; @@ -5316,15 +5303,17 @@ namespace fmtxml if (CheckInheritedStr(new StepPartStr(StepPartEditTypeRnoMenuItem), step, dicParents)) step.StepEditData.TypeMenu.RnoMenuItem = null; if (CheckInheritedStr(new StepPartStr(StepPartEditTypeNoChg_Reason), step, dicParents)) step.StepEditData.TypeMenu.NoChgReason = null; if (CheckInheritedStr(new StepPartStr(StepPartEditTypeAlternateNameList), step, dicParents)) step.StepEditData.TypeMenu.AlternateNameList = null; - // substructure - StepPrintData - if (CheckInheritedStr(new StepPartStr(StepPartPrintForeColor), step, dicParents)) step.StepPrintData.ForeColor = null; - if (CheckInheritedStr(new StepPartStr(StepPartPrintBackColor), step, dicParents)) step.StepPrintData.BackColor = null; - if (CheckInheritedStr(new StepPartStr(StepPartPrintPosAdjust), step, dicParents)) step.StepPrintData.PosAdjust = null; - // substructure - TabData - if (CheckInheritedStr(new StepPartStr(StepPartTabIdentEdit), step, dicParents)) step.TabData.IdentEdit = null; - if (CheckInheritedStr(new StepPartStr(StepPartTabIdent), step, dicParents)) step.TabData.Ident = null; - if (CheckInheritedStr(new StepPartStr(StepPartTabRNOIdentEdit), step, dicParents)) step.TabData.RNOIdentEdit = null; - if (CheckInheritedStr(new StepPartStr(StepPartTabRNOIdent), step, dicParents)) step.TabData.RNOIdent = null; + // substructure - StepPrintData + if (CheckInheritedStr(new StepPartStr(StepPartPrintForeColor), step, dicParents)) step.StepPrintData.ForeColor = null; + if (CheckInheritedStr(new StepPartStr(StepPartPrintBackColor), step, dicParents)) step.StepPrintData.BackColor = null; + if (CheckInheritedStr(new StepPartStr(StepPartPrintPosAdjust), step, dicParents)) step.StepPrintData.PosAdjust = null; + // substructure - TabData + + //RHM/KBR added this - not sure: if (mstp.TabData.IdentEdit == sstp.TabData.IdentEdit) subFmt.StepData[i].TabData.IdentEdit = null; + if (CheckInheritedStr(new StepPartStr(StepPartTabIdentEdit), step, dicParents)) step.TabData.IdentEdit = null; + if (CheckInheritedStr(new StepPartStr(StepPartTabIdent), step, dicParents)) step.TabData.Ident = null; + if (CheckInheritedStr(new StepPartStr(StepPartTabRNOIdentEdit), step, dicParents)) step.TabData.RNOIdentEdit = null; + if (CheckInheritedStr(new StepPartStr(StepPartTabRNOIdent), step, dicParents)) step.TabData.RNOIdent = null; if (CheckInheritedStr(new StepPartStr(StepPartTabIdentEditWid), step, dicParents)) step.TabData.IdentEditWid = null; if (CheckInheritedStr(new StepPartStr(StepPartTabIdentWid), step, dicParents)) step.TabData.IdentWid = null; if (CheckInheritedStr(new StepPartStr(StepPartTabRNOIdentEditWid), step, dicParents)) step.TabData.RNOIdentEditWid = null; @@ -5334,19 +5323,19 @@ namespace fmtxml // substructures - Tab - Font if (step.TabData.Font != null && CheckInheritedStr(new StepPartStr(StepPartTabFontFamily), step, dicParents)) - step.TabData.Font.FontFamily = null; + step.TabData.Font.FontFamily = null; if (step.TabData.Font != null && CheckInheritedStr(new StepPartStr(StepPartTabFontStyle), step, dicParents)) - step.TabData.Font.FontStyle = null; + step.TabData.Font.FontStyle = null; if (step.TabData.Font != null && CheckInheritedStr(new StepPartStr(StepPartTabFontSize), step, dicParents)) - step.TabData.Font.FontSize = null; + step.TabData.Font.FontSize = null; if (step.TabData.Font != null && CheckInheritedStr(new StepPartStr(StepPartTabFontCPI), step, dicParents)) step.TabData.Font.CPI = null; if (step.TabData.Font != null && CheckInheritedStr(new StepPartStr(StepPartTabJustify), step, dicParents)) - step.TabData.Font.FontJustify = null; + step.TabData.Font.FontJustify = null; if (step.TabData.Font != null) // && CheckInheritedStr(new StepPartStr(StepPartTabCheckOff), step, dicParents)) - step.TabData.Font.FontCheckOff = null; + step.TabData.Font.FontCheckOff = null; if ((step.TabData.Font != null) && (step.TabData.Font.FontFamily == null) && (step.TabData.Font.FontStyle == null) && (step.TabData.Font.FontSize == null) && (step.TabData.Font.FontJustify == null) && (step.TabData.Font.CPI == null)) - step.TabData.Font = null; + step.TabData.Font = null; // All macro list items must be identical from step to inherited parent in order to removeit. if (step.TabData.MacroList != null) @@ -5361,97 +5350,188 @@ namespace fmtxml step.TabData.MacroList[0].NotInRNO = null; } } - } - private bool CheckInheritedStr(StepPartStr stepPartStr, Step step, Dictionary dicParents) - { - Step parent = step; - while ((stepPartStr(parent) == null) || (step.Type == parent.Type)) - { - if (!dicParents.ContainsKey(parent.Type)) return false; - parent = dicParents[parent.Type]; - if (stepPartStr(step) == stepPartStr(parent)) return true; - } - return false; - } - private Dictionary BuildStepDic(Step[] stpdata) - { - Dictionary dicSteps = new Dictionary(); - foreach (Step stp in stpdata) dicSteps[stp.Type] = stp; - return dicSteps; - } - private Dictionary BuildParentDic(Step[] stpdata, Dictionary dicSteps) - { - Dictionary dicParent = new Dictionary(); - foreach (Step stp in stpdata) - if (stp.ParentType != "") dicParent[stp.Type] = dicSteps[stp.ParentType]; - return dicParent; - } - #endregion - private void FixInactiveForHigh(ref FormatData fmtdata) // set all the HighLevelSteps beyond + // flags: + if (CheckInheritedStr(new StepPartStr(StepPartDoubleSpace), step, dicParents)) step.DoubleSpace = null; + if (CheckInheritedStr(new StepPartStr(StepPartEnhancedStepNumFromPrev), step, dicParents)) step.EnhancedStepNumFromPrev = null; + if (CheckInheritedStr(new StepPartStr(StepPartUseSmartTemplate), step, dicParents)) step.UseSmartTemplate = null; + if (CheckInheritedStr(new StepPartStr(StepPartAlwaysUseExtraLines), step, dicParents)) step.AlwaysUseExtraLines = null; + if (CheckInheritedStr(new StepPartStr(StepPartSeparateBox), step, dicParents)) step.SeparateBox = null; + if (CheckInheritedStr(new StepPartStr(StepPartSeparateBoxCautions), step, dicParents)) step.SeparateBoxCautions = null; + if (CheckInheritedStr(new StepPartStr(StepPartSpaceDouble), step, dicParents)) step.SpaceDouble = null; + if (CheckInheritedStr(new StepPartStr(StepPartReduceLineAfter), step, dicParents)) step.ReduceLineAfter = null; + if (CheckInheritedStr(new StepPartStr(StepPartSameLevel), step, dicParents)) step.SameLevel = null; + if (CheckInheritedStr(new StepPartStr(StepPartBoldHighLevel), step, dicParents)) step.BoldHighLevel = null; + if (CheckInheritedStr(new StepPartStr(StepPartOneLineBeforeTab), step, dicParents)) step.OneLineBeforeTab = null; + if (CheckInheritedStr(new StepPartStr(StepPartBoxIt), step, dicParents)) step.BoxIt = null; + if (CheckInheritedStr(new StepPartStr(StepPartBoxed), step, dicParents)) step.Boxed = null; + if (CheckInheritedStr(new StepPartStr(StepPartXLines_StepFix), step, dicParents)) step.XLines_StepFix = null; + if (CheckInheritedStr(new StepPartStr(StepPartRebox), step, dicParents)) step.Rebox = null; + if (CheckInheritedStr(new StepPartStr(StepPartSpcHdr), step, dicParents)) step.SpcHdr = null; + if (CheckInheritedStr(new StepPartStr(StepPartContinueOnly), step, dicParents)) step.ContinueOnly = null; + if (CheckInheritedStr(new StepPartStr(StepPartSepAfterAER), step, dicParents)) step.SepAfterAER = null; + if (CheckInheritedStr(new StepPartStr(StepPartUseAlternateStepBox), step, dicParents)) step.UseAlternateStepBox = null; + if (CheckInheritedStr(new StepPartStr(StepPartUnderlineAfterDashSpace), step, dicParents)) step.UnderlineAfterDashSpace = null; + if (CheckInheritedStr(new StepPartStr(StepPartSpaceIn), step, dicParents)) step.SpaceIn = null; + if (CheckInheritedStr(new StepPartStr(StepPartPageBreakOnStep), step, dicParents)) step.PageBreakOnStep = null; + if (CheckInheritedStr(new StepPartStr(StepPartAlignNullTabWSectHead), step, dicParents)) step.AlignNullTabWSectHead = null; + if (CheckInheritedStr(new StepPartStr(StepPartTextSubFollowsTextStyle), step, dicParents)) step.TextSubFollowsTextStyle = null; + if (CheckInheritedStr(new StepPartStr(StepPartTreatAsSequential), step, dicParents)) step.TreatAsSequential = null; + if (CheckInheritedStr(new StepPartStr(StepPartMatchUpRNO), step, dicParents)) step.MatchUpRNO = null; + if (CheckInheritedStr(new StepPartStr(StepPartInPageList), step, dicParents)) step.InPageList = null; + if (CheckInheritedStr(new StepPartStr(StepPartCenterOneLineOnly), step, dicParents)) step.CenterOneLineOnly = null; + if (CheckInheritedStr(new StepPartStr(StepPartSubTableGetsUp1Level), step, dicParents)) step.SubTableGetsUp1Level = null; + if (CheckInheritedStr(new StepPartStr(StepPartRemember), step, dicParents)) step.Remember = null; + if (CheckInheritedStr(new StepPartStr(StepPartCenterOneLineAdjust), step, dicParents)) step.CenterOneLineAdjust = null; + if (CheckInheritedStr(new StepPartStr(StepPartBreak), step, dicParents)) step.Break = null; + if (CheckInheritedStr(new StepPartStr(StepPartBreakEquipmentList), step, dicParents)) step.BreakEquipmentList = null; + if (CheckInheritedStr(new StepPartStr(StepPartBreakCautionsNotesOnSubstps), step, dicParents)) step.BreakCautionsNotesOnSubstps = null; + if (CheckInheritedStr(new StepPartStr(StepPartCenterTextWithinWidth), step, dicParents)) step.CenterTextWithinWidth = null; + if (CheckInheritedStr(new StepPartStr(StepPartNewlineAfter), step, dicParents)) step.NewlineAfter = null; + if (CheckInheritedStr(new StepPartStr(StepPartStartLineWithDash), step, dicParents)) step.StartLineWithDash = null; + if (CheckInheritedStr(new StepPartStr(StepPartBlankLineBeforeSubStep), step, dicParents)) step.BlankLineBeforeSubStep = null; + if (CheckInheritedStr(new StepPartStr(StepPartAlwaysTab), step, dicParents)) step.AlwaysTab = null; + if (CheckInheritedStr(new StepPartStr(StepPartMixCautionsAndNotes), step, dicParents)) step.MixCautionsAndNotes = null; + if (CheckInheritedStr(new StepPartStr(StepPartNumberHighLevel), step, dicParents)) step.NumberHighLevel = null; + if (CheckInheritedStr(new StepPartStr(StepPartOffsetTab), step, dicParents)) step.OffsetTab = null; + if (CheckInheritedStr(new StepPartStr(StepPartLeftJustifyBorderless), step, dicParents)) step.LeftJustifyBorderless = null; + if (CheckInheritedStr(new StepPartStr(StepPartStepNumIfOnlyOne), step, dicParents)) step.StepNumIfOnlyOne = null; + if (CheckInheritedStr(new StepPartStr(StepPartLJTabs), step, dicParents)) step.LJTabs = null; + if (CheckInheritedStr(new StepPartStr(StepPartNumberSubs), step, dicParents)) step.NumberSubs = null; + if (CheckInheritedStr(new StepPartStr(StepPartBullet), step, dicParents)) step.Bullet = null; + if (CheckInheritedStr(new StepPartStr(StepPartStepNumberForHighLevel), step, dicParents)) step.StepNumberForHighLevel = null; + if (CheckInheritedStr(new StepPartStr(StepPartSameRowAsParent), step, dicParents)) step.SameRowAsParent = null; + if (CheckInheritedStr(new StepPartStr(StepPartCheckoffSameAsParent), step, dicParents)) step.CheckoffSameAsParent = null; + if (CheckInheritedStr(new StepPartStr(StepPartAtLeastTwoDigits), step, dicParents)) step.AtLeastTwoDigits = null; + if (CheckInheritedStr(new StepPartStr(StepPartUseInAcTable), step, dicParents)) step.UseInAcTable = null; + if (CheckInheritedStr(new StepPartStr(StepPartNumber), step, dicParents)) step.Number = null; + if (CheckInheritedStr(new StepPartStr(StepPartThreeBlanksAbove), step, dicParents)) step.ThreeBlanksAbove = null; + if (CheckInheritedStr(new StepPartStr(StepPartCheckOffs), step, dicParents)) step.CheckOffs = null; + if (CheckInheritedStr(new StepPartStr(StepPartQuoted), step, dicParents)) step.Quoted = null; + + } + + private bool CheckInheritedStr(StepPartStr stepPartStr, Step step, Dictionary dicParents) + { + + string inheritedValue = GetStepInherited(stepPartStr, step.Type, 0); + string stepValue = stepPartStr(step); + return inheritedValue == stepValue; + //Step parent = step; + //while ((stepPartStr(parent) == null) || (step.Type == parent.Type)) + //{ + // if (!dicParents.ContainsKey(parent.Type)) + // { + // if (BaseFormat.StepData != null) + // { + // Step mstp = BaseFormat.StepData[step.Index]; + // if (stepPartStr(mstp) == stepPartStr(step)) return true; + // } + // return false;// No non-null parent value found + // } + // parent = dicParents[parent.Type]; + // if (stepPartStr(step) == stepPartStr(parent)) + // return true; // step value same as parent. + //} + //return false; // parent value different from step value + } + + private string GetStepInherited(StepPartStr stepPartStr, string stepType, int level) + { + string typ = stepType; + // spin through the step inheritance looking for a value + while (StepParentList[level].ContainsKey(typ)) { - Step[] stpdata = fmtdata.StepData; - int numHigh = fmtdata.SectData.StepSectionData.NumberOfHighLevelSteps; - if (numHigh == 0) return; - if (numHigh < HighTypeValue.Length) // need to set steps to inactive beyond numHigh + Step parent = StepParentList[level][typ]; + string parentVal = stepPartStr(parent); + if (parentVal != null) return parentVal; + typ = parent.Type; + } + // no more parent formats to look at: + if (level >= (StepParentList.Count - 1)) return null; + Step stp = StepList[level + 1][stepType]; + string stpVal = stepPartStr(stp); + if (stpVal != null) return stpVal; + return GetStepInherited(stepPartStr, stepType, level + 1); + } + private Dictionary BuildStepDic(Step[] stpdata) + { + Dictionary dicSteps = new Dictionary(); + foreach (Step stp in stpdata) dicSteps[stp.Type] = stp; + return dicSteps; + } + private Dictionary BuildParentDic(Step[] stpdata, Dictionary dicSteps) + { + Dictionary dicParent = new Dictionary(); + foreach (Step stp in stpdata) + if (stp.ParentType != "") dicParent[stp.Type] = dicSteps[stp.ParentType]; + return dicParent; + } + #endregion + private void FixInactiveForHigh(ref FormatData fmtdata) // set all the HighLevelSteps beyond + { + Step[] stpdata = fmtdata.StepData; + int numHigh = fmtdata.SectData.StepSectionData.NumberOfHighLevelSteps; + if (numHigh == 0) return; + if (numHigh < HighTypeValue.Length) // need to set steps to inactive beyond numHigh + { + for (int i = numHigh; i < HighTypeValue.Length; i++) { - for (int i = numHigh; i < HighTypeValue.Length; i++) + string inactiveType = HighTypeValue[i]; + for (int j = 0; j < stpdata.Length; j++) { - string inactiveType = HighTypeValue[i]; - for(int j = 0;j < stpdata.Length; j++) - { - if (stpdata[j].Type == inactiveType) - stpdata[j].Inactive = "True"; - } + if (stpdata[j].Type == inactiveType) + stpdata[j].Inactive = "True"; } } } - private void FixInactiveForSubStep(ref FormatData fmtdata) + } + private void FixInactiveForSubStep(ref FormatData fmtdata) + { + Step[] stpdata = fmtdata.StepData; + int numSub = fmtdata.SectData.StepSectionData.NumberOfSubStepTypes; + if (numSub == 0) return; + if (numSub < SubStepValue.Length) // need to set steps to inactive beyond numHigh { - Step[] stpdata = fmtdata.StepData; - int numSub = fmtdata.SectData.StepSectionData.NumberOfSubStepTypes; - if (numSub == 0) return; - if (numSub < SubStepValue.Length) // need to set steps to inactive beyond numHigh + for (int i = numSub; i < SubStepValue.Length; i++) { - for (int i = numSub; i < SubStepValue.Length; i++) + string inactiveType = SubStepValue[i]; + for (int j = 0; j < stpdata.Length; j++) { - string inactiveType = SubStepValue[i]; - for (int j = 0; j < stpdata.Length; j++) - { - if (stpdata[j].Type == inactiveType) - stpdata[j].Inactive = "True"; - } + if (stpdata[j].Type == inactiveType) + stpdata[j].Inactive = "True"; } } } - private void FixInactiveForText(ref FormatData fmtdata) + } + private void FixInactiveForText(ref FormatData fmtdata) + { + Step[] stpdata = fmtdata.StepData; + if ((_AlternateIndex ?? "") == "") return; + string mask = "," + _AlternateIndex + ","; + foreach (string textType in TextTypes) { - Step[] stpdata = fmtdata.StepData; - if ((_AlternateIndex ?? "") == "") return; - string mask = "," + _AlternateIndex + ","; - foreach (string textType in TextTypes) + if (!mask.Contains("," + textType + ",")) { - if (!mask.Contains("," + textType + ",")) + for (int j = 0; j < stpdata.Length; j++) { - for (int j = 0; j < stpdata.Length; j++) - { - if (stpdata[j].Type == textType) - stpdata[j].Inactive = "True"; - } + if (stpdata[j].Type == textType) + stpdata[j].Inactive = "True"; } } } -private string [] HighTypeValue={"High","Continuous","Immediate","LossOfAC","High5"}; -private string [] SubStepValue = {"Substep","And","Or","EquipmentList","EquipmentWBlank", + } + private string[] HighTypeValue ={ "High", "Continuous", "Immediate", "LossOfAC", "High5" }; + private string[] SubStepValue = {"Substep","And","Or","EquipmentList","EquipmentWBlank", "ExplicitAnd","ImplicitOr","Paragraph","EquipmentOpt","EquipmentOptWBlank","ContAcSequential", "ContAcAnd","ContAcOr","ContAcParagraph","TitleWithTextRight","TitleWithTextBelow"}; - private string[] TextTypes = {"Caution","Caution1","Caution2","Caution3","Caution4", + private string[] TextTypes = {"Caution","Caution1","Caution2","Caution3","Caution4", "Note","Note1","Note2","Note3","Note4","Note5"}; - private bool RHMDebugPause(string fname, string lookfor) - { - return lookfor.Contains("." + fname.Substring(0, fname.LastIndexOf(".")).ToLower() + "."); - } - } + private bool RHMDebugPause(string fname, string lookfor) + { + return lookfor.Contains("." + fname.Substring(0, fname.LastIndexOf(".")).ToLower() + "."); + } + } } diff --git a/PROMS/fmtxml/FmtToXml.cs b/PROMS/fmtxml/FmtToXml.cs index 6fa8620c..c44310c6 100644 --- a/PROMS/fmtxml/FmtToXml.cs +++ b/PROMS/fmtxml/FmtToXml.cs @@ -49,7 +49,7 @@ public struct DocStyle public short Index; public short pagestyle; // Index into page style array public VE_Font dstyle; // 'Printer driver styles' for the entire document - public float PTopRow; // First 'document text' row on printed page + public float TopMargin; // First 'document text' row on printed page/ renamed to TopMargin public float FooterLen; // Number of lines required for footer public float LeftMargin; // Size of left margin public float PageLength; @@ -63,6 +63,9 @@ public struct DocStyle public bool UseCheckOffs; // This was originally in fmt. Load fmt to get public int oldtonew; // Bits for converting from old to new // document style + public bool CancelSectTitle; // Was format flags CancelSecTitlesOnS1 & CancelSecTitlesOnS2 + public bool SpecialStepsFoldout; // Was format flag SpecialStepsFoldout - but put on E2 (was in 16bit code) + public bool UndSpecialStepsFoldout; // Was format flag UndSpecialStepsFoldout - but put here on E2 only. public short ContTopHLS; // Flag for including High Level step // as part of top continue message. public float CTMargin; // Margin for top message @@ -481,6 +484,7 @@ namespace fmtxml { MyPath = path; fmtName = nm; + //if (fmtName.ToUpper() != "OHLP" && fmtName.ToUpper() != "BASE" && fmtName.ToUpper() != "WCN2") return; try { // get the default base & plant files to use when figuring out inheritance. @@ -754,6 +758,17 @@ namespace fmtxml // read in title. string fnm = MyPath + @"\" + fname; + // construct format file name from this path.\ + string fmtFileName = fname; + if (fname.Contains(".Y")) + { + // subformat - replace .Y with .X + fmtFileName = MyPath + @"\" + fname.Replace(".Y", ".X"); + } + else + { + fmtFileName = MyPath + @"\" + fname.Substring(0, fname.IndexOf(".")) + ".FMT"; + } if (fname == "CPL.Y01") Console.WriteLine(fname); brFmt = new BinaryReader(File.Open(fnm,System.IO.FileMode.Open,System.IO.FileAccess.ReadWrite,FileShare.ReadWrite)); dcstyles.Name = GetAsciiString(brFmt); @@ -784,7 +799,7 @@ namespace fmtxml dcs[1].dstyle = dcs[0].dstyle.Copy(); dcs[2].dstyle = dcs[0].dstyle.Copy(); dcs[3].dstyle = dcs[0].dstyle.Copy(); - dcs[0].PTopRow = dcs[1].PTopRow = dcs[2].PTopRow = dcs[3].PTopRow = brFmt.ReadInt16(); + dcs[0].TopMargin = dcs[1].TopMargin = dcs[2].TopMargin = dcs[3].TopMargin = brFmt.ReadInt16(); dcs[0].LeftMargin = dcs[1].LeftMargin = dcs[2].LeftMargin = dcs[3].LeftMargin = brFmt.ReadInt16(); dcs[0].PageLength = brFmt.ReadInt16(); dcs[1].PageLength = brFmt.ReadInt16(); @@ -820,13 +835,14 @@ namespace fmtxml dc.pagestyle = brFmt.ReadInt16(); uint tmpstyle = brFmt.ReadUInt32(); dc.dstyle = new VE_Font(tmpstyle); - dc.PTopRow = RowToPoints(brFmt.ReadInt16()); + dc.TopMargin = RowToPoints(brFmt.ReadInt16()); dc.FooterLen = RowToPoints(brFmt.ReadInt16()); dc.LeftMargin = ColToPoints(brFmt.ReadInt16(), tmpstyle); dc.PageLength = RowToPoints(brFmt.ReadInt16()); dc.PageWidth = ColToPoints(brFmt.ReadInt16(), tmpstyle); dc.numberingsequence = brFmt.ReadInt16(); dc.oldtonew = brFmt.ReadInt32(); + SetupDocStyleFromFmtFlags(ref dc, fmtFileName); dc.IsStepSection = ConvertToSectType(dc.oldtonew); dc.ContTopHLS = brFmt.ReadInt16(); dc.CTMargin = RowToPoints(brFmt.ReadInt16()); @@ -849,6 +865,11 @@ namespace fmtxml else dc.ContBottom = null; if (offst[2] != 0) dc.EndString = DoReplaceTokens(GetAsciiStringUntilNull(brFmt)); else dc.EndString = null; + if (dc.EndString == "") + { + dc.EndString = null; + dc.EndFlag = 0; + } if (offst[3] != 0) dc.FinalMsg = DoReplaceTokens(GetAsciiStringUntilNull(brFmt)); else dc.FinalMsg = null; if (dc.ContTop == null && dc.ContBottom == null) dc.ContStyle = null; @@ -921,6 +942,63 @@ namespace fmtxml } return false; } + private void SetupDocStyleFromFmtFlags(ref DocStyle dc, string fmtFileName) + { + int oldToNew = dc.oldtonew; + BinaryReader brFmt = new BinaryReader(File.Open(fmtFileName, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite, FileShare.ReadWrite)); + int[] tmpshort3 = new int[3]; + ArrayList stringoffsets = new ArrayList(); + byte tmpbyte; + Int16 tmpshort; + string tmpstr; + try + { + tmpshort = brFmt.ReadInt16(); + tmpstr = fmtxml.FmtFileToXml.GetStringUntilNull(brFmt); + for (int i = 0; i < 3; i++) + { + tmpshort = brFmt.ReadInt16(); + tmpstr = fmtxml.FmtFileToXml.GetStringUntilNull(brFmt); + } + + short vnum = brFmt.ReadInt16(); // number of ints, etc. + long posatints = brFmt.BaseStream.Position; + long tstloc = vnum + posatints; + tmpbyte = brFmt.ReadByte(); // FirstChar + Int16[] xtraflag = new Int16[19]; + for (int i = 0; i < 19; i++) + { + xtraflag[i] = brFmt.ReadInt16(); + } + dc.CancelSectTitle = CheckSectType(oldToNew, xtraflag); + dc.SpecialStepsFoldout = GetSpecialStepsFoldout(oldToNew, xtraflag); + dc.UndSpecialStepsFoldout = GetUndSpecialStepsFoldout(oldToNew, xtraflag); + } + catch (Exception exception) + { + Console.WriteLine("Didn't process docstyle"); + } + } + + private bool GetUndSpecialStepsFoldout(int oldToNew, Int16[] flg) + { + if (((oldToNew & (int)E_OldToNewSteps.E2) != 0) && ((flg[10] & fmtxml.FmtFileToXml.UNDSPECIALSTEPSFOLDOUT) > 0)) return true; + return false; + } + + private bool GetSpecialStepsFoldout(int oldToNew, Int16[] flg) + { + if (((oldToNew & (int)E_OldToNewSteps.E2) != 0) && ((flg[7] & fmtxml.FmtFileToXml.SPECIALSTEPSFOLDOUT) > 0)) return true; + return false; + } + private bool CheckSectType(int oldToNew, Int16[] flg) + { + if (((oldToNew & (int)E_OldToNewSteps.S2) != 0) && ((flg[6] & fmtxml.FmtFileToXml.CANCELSECTITLESONS2) > 0)) return true; + if (((oldToNew & (int)E_OldToNewSteps.S1) != 0) && ((flg[7] & fmtxml.FmtFileToXml.CANCELSECTITLESONS1) > 0)) return true; + if (((oldToNew & (int)E_OldToNewSteps.E0) != 0) && ((flg[11] & fmtxml.FmtFileToXml.CANCELSECTITLESONE0) > 0)) return true; + if (((oldToNew & (int)E_OldToNewSteps.E2) != 0) && ((flg[11] & fmtxml.FmtFileToXml.CANCELSECTITLESONE2) > 0)) return true; + return false; + } private bool ConvertToSectType(int p) { diff --git a/PROMS/fmtxml/GenXmlToSvg.cs b/PROMS/fmtxml/GenXmlToSvg.cs index 8e207088..1a2205f0 100644 --- a/PROMS/fmtxml/GenXmlToSvg.cs +++ b/PROMS/fmtxml/GenXmlToSvg.cs @@ -169,14 +169,14 @@ namespace fmtxml /* * The following svg group must be added for WCN2 for its box on the cover page: * - - - - - - - - + + + + + + + + */ public GenXmlToSvg(string nm, string resPath) { diff --git a/PROMS/fmtxml/TranslateDoc.XSL b/PROMS/fmtxml/TranslateDoc.XSL index c0402608..cd09a976 100644 --- a/PROMS/fmtxml/TranslateDoc.XSL +++ b/PROMS/fmtxml/TranslateDoc.XSL @@ -19,9 +19,12 @@ - - - + + + + + + @@ -39,6 +42,21 @@ + + + + + + + + + + + + + + + @@ -60,9 +78,9 @@ - + - + diff --git a/PROMS/fmtxml/TranslateFMT.XSL b/PROMS/fmtxml/TranslateFMT.XSL index c34f5be9f4157caec3ade7b9c944278f85a0648a..40db4f5a03651a49d59156fa6b06273523fdc9fc 100644 GIT binary patch delta 371 zcmeCV&AsC+_XfKalMA-1Y-U>7#@<}8eS5)n#ybaC6&Z9Hbf-^bXSAFyP{qW-4B|Dm zFj-DNP{Gv0Zo>eUpWG-X43>FV%api%UnP?UGbbklR1#J5C?|O0_A_z zD@`tl<(oXOQEU2zS&VGc5413GEeA>wFkX+K6PualhE7%pVwwJDEu+o!c~_aZ7(=Jq nuVZwa{@^;8t?0t&K3(r76W4T^TTFb@Z>?jD*`9ZcNlq95971$1 delta 656 zcmZ{f-z!657{}l97-LTBu&rDyt%W4%SW;3_wo7)_q!jY|O2^5M8Jih$BZc00%7wVH z8#PIX66Sj9gez+QgK#6syOY#u+uifNpXd2}pXc(SeCxG5*^!{}Hj`NZs0Gcoz0|BK`R!MVEiAorFstlV@^n!@-3@6~-1b9))aBe)B zg;rIXf%+mUr<|CKL0@*tg7Q4@D1=}fEfJW+^ep>R7Ql|3(=epBsO-se*&f~yE8AgddC{e@y~QW6(t&NSdhi6*wqG%3&