This commit is contained in:
2011-05-19 13:18:48 +00:00
parent 6ca33e7e8f
commit f74ce841a5
4 changed files with 241 additions and 130 deletions

View File

@@ -10,7 +10,6 @@ using System.Xml.Xsl;
using System.Xml;
using System.Xml.Serialization;
using System.ComponentModel;
using System.Text.RegularExpressions;
#region StructDefinitions
// top of the format.
@@ -552,7 +551,7 @@ public struct CheckOff
public string MenuItem;
public string ExcludeInSectMenu;
public string Macro;
public int CheckOffWidAdjust;
public float CheckOffWidAdjust;
public int CheckOffXtraLines;
}
[Serializable]
@@ -620,14 +619,14 @@ public struct Section
[Serializable]
public struct SectionNum
{
public Int16 Pos;
public float Pos;
public string Just;
public VE_Font Font;
}
[Serializable]
public struct SectionHead
{
public Int16 Pos;
public float Pos;
public string Just;
public VE_Font Font;
}
@@ -678,10 +677,10 @@ public struct AccSection
[Serializable]
public struct TOC
{
public Int16 TofCSecNumPos;
public Int16 TofCSecTitlePos;
public float TofCSecNumPos;
public float TofCSecTitlePos;
public byte TofCSecTitleLen;
public Int16 TofCPageNumPos;
public float TofCPageNumPos;
public byte TofCSpaceChar;
public byte TofCLineSpacing;
public VE_Font Font;
@@ -690,28 +689,28 @@ public struct TOC
public struct MetaSection
{
public int Index; // do I need this to order them or will SecNumPositionAdj work?
public Int16 SecNumPositionAdj;
public Int16 SecTitlePositionAdj;
public Int16 ColSByLevel;
public Int16 TofCPositionAdj;
public Int16 WidSAdjByLevel;
public float SecNumPositionAdj;
public float SecTitlePositionAdj;
public float ColSByLevel;
public float TofCPositionAdj;
public float WidSAdjByLevel;
}
[Serializable]
public struct StepSectionLayout
{
public int LastLineToStartStep;
public float LastLineToStartStep;
public Int16 LineDrawingOption;
public Int16 ColS;
public Int16 ColT;
public Int16 ColAbs;
public Int16 WidT;
public float ColS;
public float ColT;
public float ColAbs;
public float WidT;
public Int16 PMode;
public Int16 MaxRNO;
public string MaxRNOTable;
public string ColRTable;
public string WidSTableEdit;
public string WidSTablePrint;
public Int16 AdjRNOCol;
public float AdjRNOCol;
public Int16 EndMessagePos;
public string RNOWidthAlt;
public Int16 HLSWidthOVRD;
@@ -765,8 +764,8 @@ public struct StepSectionLayout
[Serializable]
public struct TopOfPg
{
public Int16 Row;
public Int16 Col;
public float Row;
public float Col;
public VE_Font Font;
}
[Serializable]
@@ -778,8 +777,8 @@ public struct Separtr
[Serializable]
public struct StepSectionEdit
{
public Int16 ColSScreenAdj;
public Int16 ScrnAdjRNOText;
public float ColSScreenAdj;
public float ScrnAdjRNOText;
public string ColRScreen;
}
[Serializable]
@@ -793,7 +792,7 @@ public struct SeqTabFmt
[Serializable]
public struct StepSectionPrint
{
public Int16 ImmStepHdrCol;
public float ImmStepHdrCol;
public Int16 SecColHdrforActPMode;
public string RNOSepString;
public string HLStpSeparatorString;
@@ -1011,12 +1010,12 @@ public struct COMacro
public struct Box
{
public int Index;
public Int16 Start;
public int End;
public Int16 TxtStart;
public int TxtWidth;
public Int16 Height;
public Int16 TabPos;
public float Start;
public float End;
public float TxtStart;
public float TxtWidth;
public float Height;
public float TabPos;
public sbyte TxtRowAdj;
public string BXURC; // Upper Right Corner, etc.
public string BXHorz;
@@ -1541,7 +1540,7 @@ namespace fmtxml
BuildDictionaryText();
fmtName = alias;
//if (fmtName.ToUpper() != "CPLS" && fmtName.ToUpper() != "BASE") return;
//if (fmtName.ToUpper() != "HLP" && fmtName.ToUpper() != "BASE") return;
//if (fmtName.ToUpper() != "OHLP" && fmtName.ToUpper() != "BASE" && fmtName.ToUpper() != "WCN2") return;
//if (fmtName.ToUpper() != "AEP" && fmtName.ToUpper() != "BASE") return;
try
{
@@ -2085,17 +2084,18 @@ namespace fmtxml
}
#endregion
#region ReadInFile
private int ColToPoints(int i)
{
return (i * 6); // col_in_points = input * 72/12, col = input * 6
}
private int RowToPoints(int i)
private float RowToPoints(int i)
{
return (i * 12); // row_in_points = input * 72/6, row = input * 12
}
string _AlternateIndex = null;
private float ColToPoints(float f, uint style)
{
return 72 * (f / CvtFont.CvtFont.GetPrintPitch(style));
}
string _AlternateIndex = null;
int[] rtCheckOffGroups = new int[MAXSTEPS + 1];
private string _fmtFileName;
private uint _PlantDefaultFontStyle;
public bool ReadInFmtFile(ref FormatData fmtdata, ref XtraFlgs XtraFlags, string fname)
{
_fmtFileName = fname;
@@ -2158,10 +2158,21 @@ namespace fmtxml
fmtdata.StepData[i].ParentType = ParentTypes[i];
if (i == 1)
{
fmtdata.StepData[0].Font = LoadVE_Font();
_PlantDefaultFontStyle = brFmt.ReadUInt32();
fmtdata.StepData[0].Font = new VE_Font(_PlantDefaultFontStyle);
fmtdata.FontData = fmtdata.StepData[0].Font.Copy();
//fmtdata.StepData[1].Font will inherit the Base Font
}
if (i > 1) fmtdata.StepData[i].Font = LoadVE_Font();
if (i > 1)
{
uint tmpuint = brFmt.ReadUInt32();
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);
}
else
fmtdata.StepData[i].Font = new VE_Font(tmpuint);
}
}
for (int i = 1; i < MAXSTEPS+1; i++)
{
@@ -2203,17 +2214,19 @@ namespace fmtxml
// 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
for (int i = 1; i < MAXBOXES+1; i++) fmtdata.BoxData[i].Start = (Int16)(ColToPoints(brFmt.ReadInt16()));
// 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++) fmtdata.BoxData[i].End = (int)(ColToPoints(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++) fmtdata.BoxData[i].TxtStart = (Int16)(ColToPoints(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++) fmtdata.BoxData[i].TxtWidth = (int)(ColToPoints(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 = (Int16)(RowToPoints(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 = (Int16)(RowToPoints(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();
@@ -2283,8 +2296,8 @@ namespace fmtxml
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 = (Int16)(RowToPoints(brFmt.ReadInt16()));
fmtdata.SectData.StepSectionData.StpSectLayData.TopOfPage.Col = (Int16)(ColToPoints(brFmt.ReadInt16()));
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();
@@ -2308,16 +2321,16 @@ namespace fmtxml
tmpshort = brFmt.ReadInt16(); // OmitErgEopUsage - not used.
fmtdata.SectData.StepSectionData.StpSectLayData.LineDrawingOption = brFmt.ReadInt16();
fmtdata.SectData.StepSectionData.StpSectLayData.ColS = (Int16)(ColToPoints(brFmt.ReadInt16()));
fmtdata.SectData.StepSectionData.StpSectLayData.ColS = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle);
fmtdata.SectData.StepSectionData.StpSectEditData = new StepSectionEdit();
fmtdata.SectData.StepSectionData.StpSectEditData.ColSScreenAdj = (Int16)(ColToPoints(brFmt.ReadInt16()));
fmtdata.SectData.StepSectionData.StpSectEditData.ScrnAdjRNOText = (Int16)(ColToPoints(brFmt.ReadInt16()));
fmtdata.SectData.StepSectionData.StpSectLayData.ColT = (Int16)(ColToPoints(brFmt.ReadInt16()));
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.ColAbs = (Int16)(ColToPoints(brFmt.ReadInt16()));
fmtdata.SectData.StepSectionData.StpSectLayData.WidT = (Int16)(ColToPoints(brFmt.ReadInt16()));
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();
@@ -2328,26 +2341,27 @@ namespace fmtxml
tmpstr = string.Format("{0},{1},{2}", tmpshort3[0], tmpshort3[1], tmpshort3[2]);
fmtdata.SectData.StepSectionData.StpSectLayData.MaxRNOTable = tmpstr;
for (int i = 0; i < 3; i++) tmpshort3[i] = (Int16)(ColToPoints(brFmt.ReadInt16()));
tmpstr = string.Format("{0},{1},{2}", tmpshort3[0], tmpshort3[1], tmpshort3[2]);
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;
Int16[] tmpshort3a = new Int16[3];
float[] tmpfloata = new float[3];
for (int i = 0; i < 3; i++)
{
tmpshort3[i] = (Int16)(ColToPoints(brFmt.ReadInt16()));
tmpshort3a[i] = (Int16)(ColToPoints(brFmt.ReadInt16()));
tmpfloat[i] = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle);
tmpfloata[i] = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle);
}
tmpstr = string.Format("{0},{1},{2}", tmpshort3[0], tmpshort3[1], tmpshort3[2]);
tmpstr = string.Format("{0},{1},{2}", tmpfloat[0], tmpfloat[1], tmpfloat[2]);
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTableEdit = tmpstr;
tmpstr = string.Format("{0},{1},{2}", tmpshort3a[0], tmpshort3a[1], tmpshort3a[2]);
tmpstr = string.Format("{0},{1},{2}", tmpfloata[0], tmpfloata[1], tmpfloata[2]);
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = tmpstr;
for (int i = 0; i < 3; i++) tmpshort3[i] = (Int16)(ColToPoints(brFmt.ReadInt16()));
tmpstr = string.Format("{0},{1},{2}", tmpshort3[0], tmpshort3[1], tmpshort3[2]);
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.StpSectLayData.AdjRNOCol = (Int16)(ColToPoints(brFmt.ReadInt16()));
fmtdata.SectData.StepSectionData.StpSectLayData.AdjRNOCol = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle);
ChangeBar cb = new ChangeBar();
@@ -2396,7 +2410,7 @@ namespace fmtxml
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 = (int)(ColToPoints(brFmt.ReadSByte()));
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;
@@ -2418,7 +2432,7 @@ namespace fmtxml
tmpbyte = brFmt.ReadByte(); // HighSeqStart
fmtdata.SectData.StepSectionData.IndentToken = brFmt.ReadByte();
fmtdata.SectData.StepSectionData.StpSectPrtData.ImmStepHdrCol = (Int16)(ColToPoints(brFmt.ReadInt16()));
fmtdata.SectData.StepSectionData.StpSectPrtData.ImmStepHdrCol = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle);
fmtdata.SectData.StepSectionData.StpSectPrtData.ImmStepHdrStyle = LoadVE_Font();
ReplaceStr[] repstr = new ReplaceStr[MAXREPLACE];
@@ -2438,9 +2452,9 @@ namespace fmtxml
fmtdata.SectData.SectionHeader = new SectionHead();
fmtdata.SectData.SectionNumber.Font = LoadVE_Font();
fmtdata.SectData.SectionHeader.Font = LoadVE_Font();
fmtdata.SectData.SectionNumber.Pos = (Int16)(ColToPoints(brFmt.ReadInt16()));
fmtdata.SectData.SectionNumber.Pos = ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle);
fmtdata.SectData.SectionNumber.Just = ((E_PageStructMod)brFmt.ReadByte()).ToString();
fmtdata.SectData.SectionHeader.Pos = (Int16)(ColToPoints(brFmt.ReadInt16()));
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
@@ -2481,17 +2495,17 @@ namespace fmtxml
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 = ((Int16)(ColToPoints(brFmt.ReadInt16()))).ToString();
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();
TOC toc = new TOC();
toc.TofCSecNumPos = (Int16)(ColToPoints(brFmt.ReadSByte()));
toc.TofCSecTitlePos = (Int16)(ColToPoints(brFmt.ReadSByte()));
toc.TofCSecNumPos = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle);
toc.TofCSecTitlePos = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle);
tmpbyte = brFmt.ReadByte(); // TofCSecTitlePos2
toc.TofCSecTitleLen = brFmt.ReadByte();
toc.TofCPageNumPos = (Int16)(ColToPoints(brFmt.ReadSByte()));
toc.TofCPageNumPos = ColToPoints(brFmt.ReadSByte(), _PlantDefaultFontStyle);
toc.TofCSpaceChar = brFmt.ReadByte();
toc.TofCLineSpacing = brFmt.ReadByte();
toc.Font = LoadVE_FontByte(); ;
@@ -2542,11 +2556,11 @@ namespace fmtxml
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 = (Int16)(ColToPoints(brFmt.ReadSByte()));
for (int i = 0; i < 10; i++) metsects[i].SecTitlePositionAdj = (Int16)(ColToPoints(brFmt.ReadSByte()));
for (int i = 0; i < 10; i++) metsects[i].ColSByLevel = (Int16)(ColToPoints(brFmt.ReadSByte()));
for (int i = 0; i < 10; i++) metsects[i].TofCPositionAdj = (Int16)(ColToPoints(brFmt.ReadSByte()));
for (int i = 0; i < 10; i++) metsects[i].WidSAdjByLevel = (Int16)(ColToPoints(brFmt.ReadSByte()));
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();
@@ -2554,7 +2568,7 @@ namespace fmtxml
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 = ((Int16)(ColToPoints(brFmt.ReadInt16()))).ToString();
for (int i = 1; i < MAXSTEPS + 1; i++) fmtdata.StepData[i].StepTypeColOverride = (ColToPoints(brFmt.ReadInt16(), _PlantDefaultFontStyle)).ToString();
fmtdata.SectData.StepSectionData.NumberOfSubStepTypes = brFmt.ReadByte();
@@ -4494,7 +4508,7 @@ namespace fmtxml
return wkstr;
}
private int CalculateTabWid(string p)
private float CalculateTabWid(string p)
{
if (p == null || p.Length == 0) return 0;
int tablen = p.Length;
@@ -4518,7 +4532,7 @@ namespace fmtxml
for (int i=0; i<p.Length; i++) if (p[i] == 0x08) tablen--; // discount backspaces.
for (int i = 0; i < p.Length; i++) if (p[i] == 0x16) tablen--; // underline toggle tokens
if (tablen < 0) tablen = 0;
return ColToPoints(tablen);
return ColToPoints(tablen,_PlantDefaultFontStyle);
}
private string DoTabs(VE_Font vefont, string po, int i, string p, bool doNumeric)
{
@@ -4609,7 +4623,7 @@ namespace fmtxml
{
// just compare all fields - clear the subformat if equal.
#region COMPAREACTIVE
subFmt.FontData = FixInheritedFont(subFmt.FontData, mainFmt.FontData); // Phase 10
subFmt.FontData = FixInheritedFont(subFmt.FontData, mainFmt.FontData); // Phase 10
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;
@@ -5111,9 +5125,10 @@ namespace fmtxml
if (inhFont.FontStyle == font.FontStyle) font.FontStyle = null;
if (inhFont.FontJustify == font.FontJustify) font.FontJustify = null;
if (inhFont.FontCheckOff == font.FontCheckOff) font.FontCheckOff = null;
if (inhFont.CPI == font.CPI) font.CPI = null;
//if (_LookForChange && !font.CanInherit())
// Console.WriteLine("Change Happened");
if (font.FontFamily == null && font.FontSize == null && font.FontStyle == null && font.FontJustify == null && font.FontCheckOff == null)
if (font.FontFamily == null && font.FontSize == null && font.FontStyle == null && font.FontJustify == null && font.FontCheckOff == null && font.CPI == null)
font = null;
}
return font;
@@ -5140,6 +5155,11 @@ namespace fmtxml
if (stp.Font == null) return null;
return stp.Font.FontSize;
}
private string StepPartFontCPI(Step stp)
{
if (stp.Font == null) return null;
return stp.Font.CPI;
}
private string StepPartFontStyle(Step stp)
{
if (stp.Font == null) return null;
@@ -5197,6 +5217,11 @@ namespace fmtxml
if (stp.TabData.Font == null) return null;
return stp.TabData.Font.FontSize;
}
private string StepPartTabFontCPI(Step stp)
{
if (stp.TabData.Font == null) return null;
return stp.TabData.Font.CPI;
}
private string StepPartTabFontStyle(Step stp)
{
if (stp.TabData.Font == null) return null;
@@ -5252,20 +5277,19 @@ namespace fmtxml
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))
{
//Console.WriteLine("Step[{0}] {1} - {2}", step.Index, step.Type, step.Font.FontFamily);
step.Font.FontFamily = null;
}
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(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))
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;
@@ -5315,11 +5339,13 @@ namespace fmtxml
step.TabData.Font.FontStyle = null;
if (step.TabData.Font != null && CheckInheritedStr(new StepPartStr(StepPartTabFontSize), step, dicParents))
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;
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))
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;
// All macro list items must be identical from step to inherited parent in order to removeit.