StreamReader & error handling
CheckOff & ChangeBar changes CheckOff & Gen -> Base
This commit is contained in:
parent
4e3887c611
commit
699b412bcd
@ -41,8 +41,10 @@ namespace DataLoader
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamReader srf = new StreamReader(path);
|
||||
xd = new XmlDocument();
|
||||
xd.Load(path);
|
||||
xd.Load(srf);
|
||||
//xd.Load(path);
|
||||
fmtdata = xd.OuterXml;
|
||||
}
|
||||
catch(Exception ex)
|
||||
@ -61,8 +63,10 @@ namespace DataLoader
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamReader sr = new StreamReader(path);
|
||||
XmlDocument xdg = new XmlDocument();
|
||||
xdg.Load(path);
|
||||
xdg.Load(sr);
|
||||
//xdg.Load(path);
|
||||
genmacdata = xdg.OuterXml;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -89,7 +93,15 @@ namespace DataLoader
|
||||
}
|
||||
// use the format name if base or non sub. If it's a sub, remove the "_".
|
||||
string fname = issub ? format.Replace("_", "") : format;
|
||||
Format rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
|
||||
Format rec = null;
|
||||
try
|
||||
{
|
||||
rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path);
|
||||
}
|
||||
return rec;
|
||||
}
|
||||
public void LoadAllFormats()
|
||||
|
@ -117,7 +117,7 @@ public struct XtraFlgs
|
||||
#region xtraflags3 // from xtra_flag array 3
|
||||
// public string DONTDOLINEAFTERENDMESS // not migrated: used in ano1
|
||||
// public string ENDAFTERBOXEDSTEP // not migrated: used in ano1
|
||||
public string CheckOffOnAllSteps;
|
||||
// public string CheckOffOnAllSteps; // not migrated - NOT USED
|
||||
// public string SPECIALCHANGEBARID // not migrated: used in sce
|
||||
// public string STEPTABBEFORENOTEANDSTEP // not migrated: used in ano1
|
||||
public string DontBoxAC;
|
||||
@ -465,40 +465,55 @@ public struct Procedure
|
||||
[Serializable]
|
||||
public struct CheckOffData
|
||||
{
|
||||
public string Menu;
|
||||
public string AllowSectEdit;
|
||||
public string AllowStepEdit;
|
||||
public int UseCheckOffsIn;
|
||||
public sbyte CheckOffAdjustment;
|
||||
/* Format flags ... */
|
||||
public string DropCheckOff;
|
||||
public string CheckOffOnHLSOnly; //CheckoffOnHLSOnly
|
||||
public string CheckOffOnHLSOnly;
|
||||
public string SkipSpaces;
|
||||
/* end of format flags */
|
||||
public RightCheckOffBx [] RightCheckOffBoxList;
|
||||
//public RightCheckOffBx [] RightCheckOffBoxList;
|
||||
public Absolute [] LayoutList;
|
||||
public CheckOffHeader[] CheckOffHeaderList;
|
||||
public CheckOff [] CheckOffList;
|
||||
}
|
||||
//[Serializable]
|
||||
//public struct RightCheckOffBx
|
||||
//{
|
||||
// public int Index;
|
||||
// public int RightCheckOffBox;
|
||||
//}
|
||||
[Serializable]
|
||||
public struct RightCheckOffBx
|
||||
public struct Absolute
|
||||
{
|
||||
public int Index;
|
||||
public int RightCheckOffBox;
|
||||
public string RnoLevel;
|
||||
public int Column;
|
||||
}
|
||||
[Serializable]
|
||||
public struct CheckOffHeader
|
||||
{
|
||||
public int Index;
|
||||
public VE_Font Font;
|
||||
public string CheckOffHeading;
|
||||
public VE_Font Font;
|
||||
}
|
||||
[Serializable]
|
||||
public struct CheckOff
|
||||
{
|
||||
public int Index;
|
||||
public byte RightCheckOffChars;
|
||||
public byte UIMark;
|
||||
public string MenuItem;
|
||||
public string ExcludeInSectMenu;
|
||||
public string Macro;
|
||||
public int CheckOffWidAdjust;
|
||||
public string RightCheckOffPrompt;
|
||||
public int CheckOffXtraLines;
|
||||
}
|
||||
[Serializable]
|
||||
public struct ChangeBar
|
||||
{
|
||||
public string DefaultCBLoc;
|
||||
public string ChangeBarMessage;
|
||||
public Int16 FixedChangeColumn; // really flags not columns (don't convert to points
|
||||
public Byte FixedAERChangeColumn;
|
||||
@ -518,10 +533,10 @@ public struct ChangeBar
|
||||
[Flags]
|
||||
public enum E_ChangeBarMessage : uint
|
||||
{
|
||||
DateAndUserId = 0,
|
||||
RevNumber = 1,
|
||||
UserId = 2,
|
||||
Nothing = 3
|
||||
DateChgID = 0,
|
||||
RevNum = 1,
|
||||
ChgID = 2,
|
||||
None = 3
|
||||
}
|
||||
[Flags]
|
||||
public enum E_EMode : uint
|
||||
@ -809,7 +824,6 @@ public struct Step
|
||||
public string SameLevel; // RNOSameLevel
|
||||
public string BoldHighLevel; // BoldHighLevelRNO
|
||||
public string OneLineBeforeTab; // OneLineBeforeNoteCautionTab
|
||||
public string CheckOffOnAllSteps;
|
||||
public string BoxIt; // DontBoxAC
|
||||
public string Boxed; // BoxContinuousActions, BoxedSubsteps
|
||||
public string XLines_StepFix;
|
||||
@ -919,7 +933,7 @@ public struct Layout
|
||||
public string AlwaysUpperCase;
|
||||
public string PageBreakAtTypeChange;
|
||||
public string AlignWithParentTab;
|
||||
public string RtCheckOffGroups;
|
||||
//public string RtCheckOffGroups;
|
||||
public string StepTypeWidthOverride;
|
||||
}
|
||||
[Serializable]
|
||||
@ -935,11 +949,20 @@ public struct Tab
|
||||
public string RNOIdentEditWid;
|
||||
public string RNOIdentWid;
|
||||
public string Justify; // from tbstyle - None, CENTER, LEFT, RIGHT
|
||||
public string CheckOff; // from tbstyle - None, LEFT, RIGHT
|
||||
//public string CheckOff; // from tbstyle - None, LEFT, RIGHT
|
||||
public string UsePreviousStyle;
|
||||
public COMacro[] MacroList;
|
||||
public VE_Font Font;
|
||||
}
|
||||
[Serializable]
|
||||
public struct COMacro
|
||||
{
|
||||
public string Name;
|
||||
public string Macro;
|
||||
public string Grouping;
|
||||
public string NotInRNO;
|
||||
}
|
||||
[Serializable]
|
||||
public struct Box
|
||||
{
|
||||
public int Index;
|
||||
@ -1096,7 +1119,7 @@ namespace fmtxml
|
||||
public static int CONTINUOUSCHANGEBARS = 0x8000;
|
||||
|
||||
// XtraFlag[3] from 16-bit...
|
||||
public static int CHECKOFFONALLSTEPS = 0x0004;
|
||||
//public static int CHECKOFFONALLSTEPS = 0x0004;
|
||||
public static int DONTBOXAC = 0x0020;
|
||||
public static int USETOPCONTINUEMESSAGEATEND = 0x0080;
|
||||
public static int UPCASETRANAND = 0x2000;
|
||||
@ -1454,7 +1477,7 @@ namespace fmtxml
|
||||
public bool HasBase;
|
||||
public FormatData MyFormat;
|
||||
public string MyPath;
|
||||
public FmtFileToXml(FmtFileToXml gendata, string nm, string path)
|
||||
public FmtFileToXml(FmtFileToXml gendata, string alias, string nm, string path)
|
||||
{
|
||||
//DateTime tStart = DateTime.Now;
|
||||
MyPath = path;
|
||||
@ -1466,10 +1489,10 @@ namespace fmtxml
|
||||
BaseFormat = gendata.MyFormat;
|
||||
}
|
||||
BuildDictionaryText();
|
||||
fmtName = nm;
|
||||
fmtName = alias;
|
||||
//if (fmtName.ToUpper() != "CPLS" && fmtName.ToUpper() != "BASE") return;
|
||||
//if (fmtName.ToUpper() != "OHLP" && fmtName.ToUpper() != "BASE") return;
|
||||
//if (fmtName.ToUpper() != "HLP" && fmtName.ToUpper() != "BASE") return;
|
||||
//if (fmtName.ToUpper() != "AEP" && fmtName.ToUpper() != "BASE") return;
|
||||
try
|
||||
{
|
||||
LoadFormatFile(nm + ".fmt", ref SubXtraFlags);
|
||||
@ -1808,7 +1831,6 @@ namespace fmtxml
|
||||
}
|
||||
else if (i == 3)
|
||||
{
|
||||
if ((flg & CHECKOFFONALLSTEPS) > 0) XtraFlags.CheckOffOnAllSteps = true.ToString();
|
||||
if ((flg & DONTBOXAC) > 0) XtraFlags.DontBoxAC = true.ToString();
|
||||
if ((flg & USETOPCONTINUEMESSAGEATEND) > 0) XtraFlags.UseTopContinueMessageAtEnd = true.ToString();
|
||||
if ((flg & UPCASETRANAND) > 0) XtraFlags.UpcaseTranAnd = true.ToString();
|
||||
@ -2020,7 +2042,7 @@ namespace fmtxml
|
||||
return (i * 12); // row_in_points = input * 72/6, row = input * 12
|
||||
}
|
||||
string _AlternateIndex = null;
|
||||
|
||||
int[] rtCheckOffGroups = new int[MAXSTEPS + 1];
|
||||
public bool ReadInFmtFile(ref FormatData fmtdata, ref XtraFlgs XtraFlags, string fname)
|
||||
{
|
||||
int[] tmpshort3 = new int[3];
|
||||
@ -2152,7 +2174,13 @@ namespace fmtxml
|
||||
{
|
||||
fmtdata.StepData[0].TabData.Font = st == null ? null : st.Copy();
|
||||
fmtdata.StepData[0].TabData.Justify = st == null ? "None" : st.FontJustify;
|
||||
fmtdata.StepData[0].TabData.CheckOff = st == null ? "None" : st.FontCheckOff;
|
||||
if (st != null && st.FontCheckOff != "None")
|
||||
{
|
||||
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();
|
||||
}
|
||||
for (int j = 0; j < MAXSTEPS; j++)
|
||||
{
|
||||
if (Tabindx[j] == -1)
|
||||
@ -2160,7 +2188,15 @@ namespace fmtxml
|
||||
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;
|
||||
//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";
|
||||
if (rtCheckOffGroups[j + 1] != 0) fmtdata.StepData[j + 1].TabData.MacroList[0].Grouping = rtCheckOffGroups[j + 1].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2170,7 +2206,14 @@ namespace fmtxml
|
||||
{
|
||||
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;
|
||||
//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";
|
||||
//if (rtCheckOffGroups[j + 1] != 0) fmtdata.StepData[j + 1].TabData.MacroList[0].Grouping = rtCheckOffGroups[j + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2285,18 +2328,22 @@ namespace fmtxml
|
||||
fmtdata.ProcData.CoverTitleLength = brFmt.ReadInt16();
|
||||
|
||||
fmtdata.ProcData.CheckOffData = new CheckOffData();
|
||||
|
||||
fmtdata.ProcData.CheckOffData.RightCheckOffBoxList = new RightCheckOffBx[4];
|
||||
// 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";
|
||||
int[] rightCheckOffBox = new int[4];
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
fmtdata.ProcData.CheckOffData.RightCheckOffBoxList[i].Index = i;
|
||||
fmtdata.ProcData.CheckOffData.RightCheckOffBoxList[i].RightCheckOffBox = brFmt.ReadInt16();
|
||||
rightCheckOffBox[i] = brFmt.ReadInt16();
|
||||
}
|
||||
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].RightCheckOffChars = brFmt.ReadByte();
|
||||
for (int i = 0; i < MAXCHECKOFFS; i++) tmpbyte = brFmt.ReadByte(); // CheckOffXtraLines
|
||||
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 = (int)(ColToPoints(brFmt.ReadSByte()));
|
||||
for (int i = 0; i < MAXCHECKOFFS; i++) tmpbyte = brFmt.ReadByte(); // CheckOffFeatures
|
||||
fmtdata.ProcData.CheckOffData.CheckOffHeaderList = new CheckOffHeader[MAXCHKHEADINGS];
|
||||
@ -2348,8 +2395,23 @@ namespace fmtxml
|
||||
fmtdata.SectData.SectionTitleLength = brFmt.ReadInt16();
|
||||
tmpshort = brFmt.ReadInt16();
|
||||
|
||||
for (int i = 1; i < MAXSTEPS+1; i++) fmtdata.StepData[i].StepLayoutData.RtCheckOffGroups = (brFmt.ReadInt16()).ToString();
|
||||
|
||||
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.
|
||||
if (rtCheckOffGroups[i] != 0)
|
||||
{
|
||||
if (fmtdata.StepData[i].TabData.MacroList == null)
|
||||
{
|
||||
fmtdata.StepData[i].TabData.MacroList = new COMacro[1];
|
||||
fmtdata.StepData[i].TabData.MacroList[0].Name = "CHECKOFF";
|
||||
fmtdata.StepData[i].TabData.MacroList[0].Macro = "C22";
|
||||
}
|
||||
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;
|
||||
|
||||
@ -2856,13 +2918,42 @@ namespace fmtxml
|
||||
// not used - SubScriptTheseChar
|
||||
arcnt++;
|
||||
|
||||
bool hasMenuItem=false;
|
||||
for (int i = 0; i < MAXCHECKOFFS; i++)
|
||||
{
|
||||
indx = offset[arcnt];
|
||||
arcnt++;
|
||||
if (indx > 0) fmtdata.ProcData.CheckOffData.CheckOffList[i].RightCheckOffPrompt = GetStringFromByte(input, indx);
|
||||
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();
|
||||
}
|
||||
// add signoff menuitems which are Endabled/Disabled & also Menu
|
||||
if (rightCheckOffBox[0] != 0 && rightCheckOffBox[1] != 0)
|
||||
{
|
||||
fmtdata.ProcData.CheckOffData.Menu = "Signoff";
|
||||
fmtdata.ProcData.CheckOffData.CheckOffList[0].Index = 0;
|
||||
fmtdata.ProcData.CheckOffData.CheckOffList[0].MenuItem = "Enabled";
|
||||
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";
|
||||
else
|
||||
{
|
||||
fmtdata.ProcData.CheckOffData.LayoutList[0].RnoLevel = "0";
|
||||
fmtdata.ProcData.CheckOffData.LayoutList[0].Column = rightCheckOffBox[0];
|
||||
fmtdata.ProcData.CheckOffData.LayoutList[0].RnoLevel = "1";
|
||||
fmtdata.ProcData.CheckOffData.LayoutList[0].Column = rightCheckOffBox[1];
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < MAXCHKHEADINGS; i++)
|
||||
{
|
||||
indx = offset[arcnt];
|
||||
@ -3074,9 +3165,12 @@ namespace fmtxml
|
||||
{
|
||||
// do format flags here - this will get yucky!!!
|
||||
#region StepFlags
|
||||
int step = 0;
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < MAXSTEPS+1; i++)
|
||||
{
|
||||
|
||||
step = i;
|
||||
// Do base here
|
||||
if (i == 0)
|
||||
{
|
||||
@ -3114,10 +3208,6 @@ namespace fmtxml
|
||||
if (XtraFlags.UseSmartTemplate == "True") fmtdata.StepData[i].UseSmartTemplate = "True";
|
||||
else fmtdata.StepData[i].UseSmartTemplate = "False";
|
||||
|
||||
// All High get this thru inheritance
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
// All High get this thru inheritance
|
||||
if (XtraFlags.BoxContinousActions == "True") fmtdata.StepData[i].Boxed = "True";
|
||||
else fmtdata.StepData[i].Boxed = "False";
|
||||
@ -3165,11 +3255,6 @@ namespace fmtxml
|
||||
}
|
||||
else if (i == 4) // And
|
||||
{
|
||||
|
||||
// All And get this thru inheritance
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
// All And get this thru inheritance
|
||||
if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True";
|
||||
else fmtdata.StepData[i].UnderlineAfterDashSpace = "False";
|
||||
@ -3180,11 +3265,6 @@ namespace fmtxml
|
||||
}
|
||||
else if (i == 5) // Or
|
||||
{
|
||||
|
||||
// All Or get this thru inheritance
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
// All Or get this thru inheritance
|
||||
if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True";
|
||||
else fmtdata.StepData[i].UnderlineAfterDashSpace = "False";
|
||||
@ -3216,10 +3296,6 @@ namespace fmtxml
|
||||
if (XtraFlags.OneLineBeforeNoteCautionTab == "True") fmtdata.StepData[i].OneLineBeforeTab = "True";
|
||||
else fmtdata.StepData[i].OneLineBeforeTab = "False";
|
||||
|
||||
// All Cautions get this thru inheritance
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
// All Cautions get this thru inheritance
|
||||
if (XtraFlags.ReBoxCautNote == "True") fmtdata.StepData[i].Rebox = "True";
|
||||
else fmtdata.StepData[i].Rebox = "False";
|
||||
@ -3294,10 +3370,6 @@ namespace fmtxml
|
||||
if (XtraFlags.OneLineBeforeNoteCautionTab == "True") fmtdata.StepData[i].OneLineBeforeTab = "True";
|
||||
else fmtdata.StepData[i].OneLineBeforeTab = "False";
|
||||
|
||||
// All Notes get this thru inheritance
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
// All Notes get this thru inheritance
|
||||
if (XtraFlags.ReBoxCautNote == "True") fmtdata.StepData[i].Rebox = "True";
|
||||
else fmtdata.StepData[i].Rebox = "False";
|
||||
@ -3356,10 +3428,6 @@ namespace fmtxml
|
||||
}
|
||||
else if (i == 8) // Table
|
||||
{
|
||||
// All Table get this thru inheritance
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
// All Table get this thru inheritance
|
||||
if (XtraFlags.SubTableGetSup1Level == "True") fmtdata.StepData[i].SubTableGetsUp1Level = "True";
|
||||
else fmtdata.StepData[i].SubTableGetsUp1Level = "False";
|
||||
@ -3374,11 +3442,6 @@ namespace fmtxml
|
||||
}
|
||||
else if (i == 11) // EquipmentList
|
||||
{
|
||||
|
||||
// All EquipmentList get this thru inheritance
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
// All EquipmentList get this thru inheritance
|
||||
if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True";
|
||||
else fmtdata.StepData[i].UnderlineAfterDashSpace = "False";
|
||||
@ -3389,10 +3452,6 @@ namespace fmtxml
|
||||
}
|
||||
else if (i == 12) // Title
|
||||
{
|
||||
// All Title get this thru inheritance
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
// All Title get this thru inheritance
|
||||
if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True";
|
||||
else fmtdata.StepData[i].UnderlineAfterDashSpace = "False";
|
||||
@ -3411,9 +3470,6 @@ namespace fmtxml
|
||||
}
|
||||
else if (i == 17) // AccPages
|
||||
{
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True";
|
||||
else fmtdata.StepData[i].UnderlineAfterDashSpace = "False";
|
||||
}
|
||||
@ -3456,9 +3512,6 @@ namespace fmtxml
|
||||
}
|
||||
else if (i == 25) // Default
|
||||
{
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True";
|
||||
else fmtdata.StepData[i].UnderlineAfterDashSpace = "False";
|
||||
}
|
||||
@ -3570,9 +3623,6 @@ namespace fmtxml
|
||||
|
||||
if (XtraFlags.UseRNOTypeInActable == "True") fmtdata.StepData[i].UseInAcTable = "True";
|
||||
else fmtdata.StepData[i].UseInAcTable = "False";
|
||||
|
||||
if (XtraFlags.NoCheckOffsInRNO == "True") fmtdata.StepData[i].CheckOffs = "False";
|
||||
else fmtdata.StepData[i].CheckOffs = "True";
|
||||
}
|
||||
else if (i == 41) // High5
|
||||
{
|
||||
@ -3585,9 +3635,6 @@ namespace fmtxml
|
||||
}
|
||||
else if (i == 44) // ContAcSequential
|
||||
{
|
||||
if (XtraFlags.CheckOffOnAllSteps == "True") fmtdata.StepData[i].CheckOffOnAllSteps = "True";
|
||||
else fmtdata.StepData[i].CheckOffOnAllSteps = "False";
|
||||
|
||||
if (XtraFlags.UnderlineAfterDashSpace == "True") fmtdata.StepData[i].UnderlineAfterDashSpace = "True";
|
||||
else fmtdata.StepData[i].UnderlineAfterDashSpace = "False";
|
||||
}
|
||||
@ -3600,6 +3647,16 @@ namespace fmtxml
|
||||
else if (i == 47) // ContAcParagraph
|
||||
{
|
||||
}
|
||||
if (fmtdata.StepData[i].TabData.MacroList != null)
|
||||
{
|
||||
if (XtraFlags.NoCheckOffsInRNO == "True") fmtdata.StepData[i].TabData.MacroList[0].NotInRNO = "True";
|
||||
else fmtdata.StepData[i].TabData.MacroList[0].NotInRNO = "False";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("here");
|
||||
}
|
||||
#endregion
|
||||
#region StepStructLayout
|
||||
@ -4105,21 +4162,24 @@ namespace fmtxml
|
||||
FileInfo[] fis = di.GetFiles(substr);
|
||||
foreach (FileInfo fi in fis)
|
||||
{
|
||||
//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);
|
||||
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);
|
||||
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;
|
||||
@ -4503,16 +4563,9 @@ namespace fmtxml
|
||||
// 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++)
|
||||
//for (int i = 0; i > 0; i++)
|
||||
{
|
||||
Step mstp = mainFmt.StepData[i];
|
||||
Step sstp = subFmt.StepData[i];
|
||||
//if (i > 0) // Don't inherit base font
|
||||
//{
|
||||
// _LookForChange = true;
|
||||
// subFmt.StepData[i].Font = FixInheritedFont(sstp.Font, mstp.Font);// Phase 1
|
||||
// _LookForChange = false;
|
||||
//}
|
||||
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;
|
||||
@ -4526,7 +4579,6 @@ namespace fmtxml
|
||||
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.RtCheckOffGroups == sstp.StepLayoutData.RtCheckOffGroups) subFmt.StepData[i].StepLayoutData.RtCheckOffGroups = 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";
|
||||
@ -4540,7 +4592,6 @@ namespace fmtxml
|
||||
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.CheckOffOnAllSteps != null && mstp.CheckOffOnAllSteps == sstp.DoubleSpace) subFmt.StepData[i].CheckOffOnAllSteps = "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";
|
||||
@ -4601,7 +4652,6 @@ namespace fmtxml
|
||||
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;
|
||||
if (mstp.TabData.CheckOff == sstp.TabData.CheckOff) subFmt.StepData[i].TabData.CheckOff = null;
|
||||
}
|
||||
// box data...
|
||||
for (int i=0; i<MAXBOXES+1; i++)
|
||||
@ -4681,30 +4731,33 @@ namespace fmtxml
|
||||
// checkoff
|
||||
CheckOffData mco = mainFmt.ProcData.CheckOffData;
|
||||
CheckOffData sco = subFmt.ProcData.CheckOffData;
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (mco.RightCheckOffBoxList[i].RightCheckOffBox == sco.RightCheckOffBoxList[i].RightCheckOffBox)
|
||||
{
|
||||
subFmt.ProcData.CheckOffData.RightCheckOffBoxList[i].Index = 0;
|
||||
subFmt.ProcData.CheckOffData.RightCheckOffBoxList[i].RightCheckOffBox = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i < MAXCHECKOFFS; i++)
|
||||
{
|
||||
if (mco.CheckOffList[i].RightCheckOffChars == sco.CheckOffList[i].RightCheckOffChars) subFmt.ProcData.CheckOffData.CheckOffList[i].RightCheckOffChars = 0;
|
||||
if (mco.CheckOffList[i].CheckOffWidAdjust == sco.CheckOffList[i].CheckOffWidAdjust) subFmt.ProcData.CheckOffData.CheckOffList[i].CheckOffWidAdjust = 0;
|
||||
|
||||
}
|
||||
for (int i = 0; i < MAXCHKHEADINGS; i++)
|
||||
{
|
||||
if (mco.CheckOffHeaderList[i].CheckOffHeading == sco.CheckOffHeaderList[i].CheckOffHeading) subFmt.ProcData.CheckOffData.CheckOffHeaderList[i].CheckOffHeading = null;
|
||||
sco.CheckOffHeaderList[i].Font = FixInheritedFont(sco.CheckOffHeaderList[i].Font, mco.CheckOffHeaderList[i].Font); // Phase 6
|
||||
}
|
||||
if (mco.Menu == sco.Menu) subFmt.ProcData.CheckOffData.Menu = "null";
|
||||
if (mco.AllowSectEdit == sco.AllowSectEdit) subFmt.ProcData.CheckOffData.AllowSectEdit = "null";
|
||||
if (mco.AllowStepEdit == sco.AllowStepEdit) subFmt.ProcData.CheckOffData.AllowStepEdit = "null";
|
||||
if (mco.UseCheckOffsIn == sco.UseCheckOffsIn) subFmt.ProcData.CheckOffData.UseCheckOffsIn = 0;
|
||||
if (mco.CheckOffAdjustment == sco.CheckOffAdjustment) subFmt.ProcData.CheckOffData.CheckOffAdjustment = 0;
|
||||
if (mco.DropCheckOff != null && mco.DropCheckOff == sco.DropCheckOff) subFmt.ProcData.CheckOffData.DropCheckOff = "null";
|
||||
if (mco.CheckOffOnHLSOnly != null && mco.CheckOffOnHLSOnly == sco.CheckOffOnHLSOnly) subFmt.ProcData.CheckOffData.CheckOffOnHLSOnly = "null";
|
||||
if (mco.SkipSpaces != null && mco.SkipSpaces == sco.SkipSpaces) subFmt.ProcData.CheckOffData.SkipSpaces = "null";
|
||||
|
||||
if (mco.LayoutList != null && sco.LayoutList != null)
|
||||
{
|
||||
int mLayoutCount = mco.LayoutList.Length;
|
||||
int sLayoutCount = sco.LayoutList.Length;
|
||||
if (sLayoutCount == mLayoutCount)
|
||||
{
|
||||
for (int i = 0; i < sLayoutCount; i++)
|
||||
{
|
||||
if (mco.LayoutList[i].RnoLevel == sco.LayoutList[i].RnoLevel) subFmt.ProcData.CheckOffData.LayoutList[i].RnoLevel = "null";
|
||||
if (mco.LayoutList[i].Column == sco.LayoutList[i].Column) subFmt.ProcData.CheckOffData.LayoutList[i].Column = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (msctlay.EndMessagePos == ssctlay.EndMessagePos) subFmt.SectData.StepSectionData.StpSectLayData.EndMessagePos = 0;
|
||||
|
||||
@ -4908,7 +4961,14 @@ namespace fmtxml
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAXCHECKOFFS; i++)
|
||||
if (mco.CheckOffList[i].RightCheckOffPrompt == sco.CheckOffList[i].RightCheckOffPrompt) subFmt.ProcData.CheckOffData.CheckOffList[i].RightCheckOffPrompt = null;
|
||||
{
|
||||
if (mco.CheckOffList[i].UIMark == sco.CheckOffList[i].UIMark) subFmt.ProcData.CheckOffData.CheckOffList[i].UIMark = 0;
|
||||
if (mco.CheckOffList[i].MenuItem == sco.CheckOffList[i].MenuItem) subFmt.ProcData.CheckOffData.CheckOffList[i].MenuItem = null;
|
||||
if (mco.CheckOffList[i].ExcludeInSectMenu == sco.CheckOffList[i].ExcludeInSectMenu) subFmt.ProcData.CheckOffData.CheckOffList[i].ExcludeInSectMenu = null;
|
||||
if (mco.CheckOffList[i].Macro == sco.CheckOffList[i].Macro) subFmt.ProcData.CheckOffData.CheckOffList[i].Macro = null;
|
||||
if (mco.CheckOffList[i].CheckOffXtraLines == sco.CheckOffList[i].CheckOffXtraLines) subFmt.ProcData.CheckOffData.CheckOffList[i].CheckOffXtraLines = 0;
|
||||
if (mco.CheckOffList[i].CheckOffWidAdjust == sco.CheckOffList[i].CheckOffWidAdjust) subFmt.ProcData.CheckOffData.CheckOffList[i].CheckOffWidAdjust = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAXCHKHEADINGS; i++)
|
||||
if (mco.CheckOffHeaderList[i].CheckOffHeading == sco.CheckOffHeaderList[i].CheckOffHeading) subFmt.ProcData.CheckOffData.CheckOffHeaderList[i].CheckOffHeading = null;
|
||||
@ -4927,7 +4987,6 @@ namespace fmtxml
|
||||
if (mainFmt.TransData.TransTypeData[i].TransFormat == subFmt.TransData.TransTypeData[i].TransFormat) subFmt.TransData.TransTypeData[i].TransFormat = null;
|
||||
if (mainFmt.TransData.TransTypeData[i].TransMenu == subFmt.TransData.TransTypeData[i].TransMenu) subFmt.TransData.TransTypeData[i].TransMenu = null;
|
||||
if (mainFmt.TransData.TransTypeData[i].TransUI == subFmt.TransData.TransTypeData[i].TransUI) subFmt.TransData.TransTypeData[i].TransUI = null;
|
||||
|
||||
}
|
||||
|
||||
if (msctlay.NonLinkedStepNumber == ssctlay.NonLinkedStepNumber) subFmt.SectData.StepSectionData.StpSectLayData.NonLinkedStepNumber = null;
|
||||
@ -5039,7 +5098,7 @@ namespace fmtxml
|
||||
private string StepPartLayoutAlwaysUpperCase(Step stp) { return stp.StepLayoutData.AlwaysUpperCase; }
|
||||
private string StepPartLayoutPageBreakAtTypeChange(Step stp) { return stp.StepLayoutData.PageBreakAtTypeChange; }
|
||||
private string StepPartLayoutAlignWithParentTab(Step stp) { return stp.StepLayoutData.AlignWithParentTab; }
|
||||
private string StepPartLayoutRtCheckOffGroups(Step stp) { return stp.StepLayoutData.RtCheckOffGroups; }
|
||||
//private string StepPartLayoutRtCheckOffGroups(Step stp) { return stp.StepLayoutData.RtCheckOffGroups; }
|
||||
private string StepPartLayoutStepTypeWidthOverride(Step stp) { return stp.StepLayoutData.StepTypeWidthOverride; }
|
||||
|
||||
private string StepPartEditForeColor(Step stp) { return stp.StepEditData.ForeColor; }
|
||||
@ -5060,8 +5119,7 @@ namespace fmtxml
|
||||
private string StepPartTabRNOIdentEditWid(Step stp) { return stp.TabData.RNOIdentEditWid; }
|
||||
private string StepPartTabRNOIdentWid(Step stp) { return stp.TabData.RNOIdentWid; }
|
||||
private string StepPartTabJustify(Step stp) { return stp.TabData.Justify; }
|
||||
private string StepPartTabCheckOff(Step stp) { return stp.TabData.CheckOff; }
|
||||
|
||||
//private string StepPartTabCheckOff(Step stp) { return stp.TabData.CheckOff; }
|
||||
private string StepPartTabFontFamily(Step stp)
|
||||
{
|
||||
if (stp.TabData.Font == null) return null;
|
||||
@ -5082,10 +5140,25 @@ namespace fmtxml
|
||||
if (stp.TabData.Font == null) return null;
|
||||
return stp.TabData.Font.FontJustify;
|
||||
}
|
||||
private string StepPartTabFontCheckOff(Step stp)
|
||||
private string StepPartTabMacroListName(Step stp)
|
||||
{
|
||||
if (stp.TabData.Font == null) return null;
|
||||
return stp.TabData.Font.FontCheckOff;
|
||||
if (stp.TabData.MacroList == null || stp.TabData.MacroList[0].Name==null) return null;
|
||||
return stp.TabData.MacroList[0].Name;
|
||||
}
|
||||
private string StepPartTabMacroListMacro(Step stp)
|
||||
{
|
||||
if (stp.TabData.MacroList == null || stp.TabData.MacroList[0].Macro == null) return null;
|
||||
return stp.TabData.MacroList[0].Macro;
|
||||
}
|
||||
private string StepPartTabMacroListGrouping(Step stp)
|
||||
{
|
||||
if (stp.TabData.MacroList == null || stp.TabData.MacroList[0].Grouping == null) return null;
|
||||
return stp.TabData.MacroList[0].Grouping;
|
||||
}
|
||||
private string StepPartTabMacroListNotInRNO(Step stp)
|
||||
{
|
||||
if (stp.TabData.MacroList == null || stp.TabData.MacroList[0].NotInRNO == null) return null;
|
||||
return stp.TabData.MacroList[0].NotInRNO;
|
||||
}
|
||||
private string StepPartEditTypeInMenu(Step stp){return stp.StepEditData.TypeMenu.InMenu;}
|
||||
private string StepPartEditTypeRnoInMenu(Step stp){return stp.StepEditData.TypeMenu.RnoInMenu;}
|
||||
@ -5138,7 +5211,7 @@ namespace fmtxml
|
||||
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(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;
|
||||
@ -5166,7 +5239,7 @@ namespace fmtxml
|
||||
if (CheckInheritedStr(new StepPartStr(StepPartTabRNOIdentEditWid), step, dicParents)) step.TabData.RNOIdentEditWid = null;
|
||||
if (CheckInheritedStr(new StepPartStr(StepPartTabRNOIdentWid), step, dicParents)) step.TabData.RNOIdentWid = null;
|
||||
if (CheckInheritedStr(new StepPartStr(StepPartTabJustify), step, dicParents)) step.TabData.Justify = null;
|
||||
if (CheckInheritedStr(new StepPartStr(StepPartTabCheckOff), step, dicParents)) step.TabData.CheckOff = null;
|
||||
//if (CheckInheritedStr(new StepPartStr(StepPartTabCheckOff), step, dicParents)) step.TabData.CheckOff = null;
|
||||
|
||||
// substructures - Tab - Font
|
||||
if (step.TabData.Font != null && CheckInheritedStr(new StepPartStr(StepPartTabFontFamily), step, dicParents))
|
||||
@ -5177,10 +5250,24 @@ namespace fmtxml
|
||||
step.TabData.Font.FontSize = null;
|
||||
if (step.TabData.Font != null && CheckInheritedStr(new StepPartStr(StepPartTabJustify), step, dicParents))
|
||||
step.TabData.Font.FontJustify = null;
|
||||
if (step.TabData.Font != null && CheckInheritedStr(new StepPartStr(StepPartTabCheckOff), step, dicParents))
|
||||
if (step.TabData.Font != null) // && CheckInheritedStr(new StepPartStr(StepPartTabCheckOff), step, dicParents))
|
||||
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.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 = null;
|
||||
|
||||
// All macro list items must be identical from step to inherited parent in order to removeit.
|
||||
if (step.TabData.MacroList != null)
|
||||
{
|
||||
if (CheckInheritedStr(new StepPartStr(StepPartTabMacroListName), step, dicParents) &&
|
||||
CheckInheritedStr(new StepPartStr(StepPartTabMacroListMacro), step, dicParents) &&
|
||||
CheckInheritedStr(new StepPartStr(StepPartTabMacroListGrouping), step, dicParents) &&
|
||||
CheckInheritedStr(new StepPartStr(StepPartTabMacroListNotInRNO), step, dicParents))
|
||||
{
|
||||
step.TabData.MacroList[0].Macro = null;
|
||||
step.TabData.MacroList[0].Grouping = null;
|
||||
step.TabData.MacroList[0].NotInRNO = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckInheritedStr(StepPartStr stepPartStr, Step step, Dictionary<string, Step> dicParents)
|
||||
|
@ -60,6 +60,7 @@ public struct DocStyle
|
||||
// 3 - within each accessory document
|
||||
public bool IsStepSection; // using oldtonew, determine whether is step
|
||||
// section or word doc section (new to 32-bit)
|
||||
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 short ContTopHLS; // Flag for including High Level step
|
||||
@ -669,6 +670,8 @@ namespace fmtxml
|
||||
XslCompiledTransform xsl = FmtFileToXml.getTransform(Application.StartupPath + "\\TranslatePag.XSL");
|
||||
string sResults = "fmt_xml\\" + lfmtname + "p.xml";
|
||||
xsl.Transform(destfile, sResults); // Perform Transform
|
||||
if (lfmtname == "GEN")
|
||||
File.Copy(sResults, "fmt_xml\\BASEp.xml"); // Create BASE from GEN format
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -770,7 +773,7 @@ namespace fmtxml
|
||||
dc.ContStyle = LoadVE_Font();
|
||||
dc.EndFlag = brFmt.ReadInt16();
|
||||
dc.EndStyle = LoadVE_Font();
|
||||
|
||||
dc.UseCheckOffs = UseCheckOffsIn(fname.Substring(0, fname.Length - 4), dc.oldtonew);
|
||||
// use the string offsets to read in the strings.
|
||||
int[] offst = new int[strings];
|
||||
for (int j = 0; j < strings; j++)
|
||||
@ -820,7 +823,16 @@ namespace fmtxml
|
||||
XslCompiledTransform xsl = FmtFileToXml.getTransform(Application.StartupPath + "\\TranslateDoc.XSL");
|
||||
string sResults = "fmt_xml\\" + lfmtname + "d.xml";
|
||||
xsl.Transform(destfile, sResults); // Perform Transform
|
||||
}
|
||||
xsl = FmtFileToXml.getTransform(Application.StartupPath + "\\removeFmtUseCO.XSL");
|
||||
//xsl.Load(Application.StartupPath + "\\removeempty.XSL");
|
||||
string sFormatResults = "fmt_xml\\" + lfmtname + "f.xml";
|
||||
string sResults2 = "fmt_xml\\" + lfmtname + "xf.xml";
|
||||
xsl.Transform(sFormatResults, sResults2);
|
||||
File.Delete(sFormatResults);
|
||||
File.Move(sResults2, sFormatResults);
|
||||
if (lfmtname == "GEN")
|
||||
File.Copy(sResults, "fmt_xml\\BASEd.xml"); // Create BASE from GEN format
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
@ -828,6 +840,26 @@ namespace fmtxml
|
||||
}
|
||||
}
|
||||
|
||||
private bool UseCheckOffsIn(string p, int p_2)
|
||||
{
|
||||
try
|
||||
{
|
||||
XmlDocument xdoc = new XmlDocument();
|
||||
string path = "fmt_xml\\" + p + "f.xml";
|
||||
if (!File.Exists(path)) return false;
|
||||
xdoc.Load("fmt_xml\\" + p + "f.xml");
|
||||
XmlNode useCO = xdoc.SelectSingleNode("FormatData/ProcData/CheckOffData/@UseCheckOffsIn");
|
||||
if (useCO == null) return false;
|
||||
int iDoc = System.Convert.ToInt32(useCO.Value);
|
||||
if ((p_2 & iDoc)>0) return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("here");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool ConvertToSectType(int p)
|
||||
{
|
||||
if (((p & (int)E_OldToNewSteps.S0) != 0) || ((p & (int)E_OldToNewSteps.S1) != 0) || ((p & (int)E_OldToNewSteps.S2) != 0) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user