This commit is contained in:
2011-11-21 16:37:30 +00:00
parent 718b4d9dc0
commit 19349d9fcd
7 changed files with 91 additions and 35 deletions

View File

@@ -61,6 +61,7 @@ public struct DocStyle
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 bool UseColSByLevel; // Didn't want a OldToNew Test in new proms, so set this if doc is an E2.
public int oldtonew; // Bits for converting from old to new
// document style
public bool CancelSectTitle; // Was format flags CancelSecTitlesOnS1 & CancelSecTitlesOnS2
@@ -484,7 +485,7 @@ namespace fmtxml
{
MyPath = path;
fmtName = nm;
//if (!fmtName.ToUpper().StartsWith("TP") && fmtName.ToUpper() != "BASE") return;
//if (!fmtName.ToUpper().StartsWith("WCN1") && fmtName.ToUpper() != "BASE") return;
try
{
// get the default base & plant files to use when figuring out inheritance.
@@ -632,7 +633,7 @@ namespace fmtxml
PSItem [] Fpsitms = null;
bool isfirst=true;
int cnt = 0;
uint prevstyleForcheckoff = 0;
while ((vnum = brFmt.ReadInt16()) != 0)
{
long fseek = brFmt.BaseStream.Position;
@@ -651,13 +652,18 @@ namespace fmtxml
if ((etmpjust & E_PageStructMod.PSLeft) == E_PageStructMod.PSLeft) adj = 0;
if ((etmpjust & E_PageStructMod.PSRight) == E_PageStructMod.PSRight) adj *= 2;
uint tmpstyle = brFmt.ReadUInt32();
pi.Style = new VE_Font(tmpstyle);
string tkn = DoReplaceTokens(GetAsciiStringUntilNull(brFmt));
// see if any initial line draw chars are in token (WCN2 and others). If so,
// remove the line draw & its following space. Also adjust the column.
int coladj = 0; // see if any initial draw chars are included and if so remove.
pi.Token = tkn==null||tkn==""?tkn:RemoveInitialLineDraw(tkn, ref coladj);
pi.Col = ColToPoints(lcol + coladj + adj, tmpstyle);
bool isChkOffHeading = false;
if (pi.Token != null && pi.Token.Contains("CHKOFFHEADING")) isChkOffHeading = true;
pi.Col = ColToPoints(lcol + coladj + adj, isChkOffHeading?prevstyleForcheckoff:tmpstyle);
prevstyleForcheckoff = tmpstyle;
//Console.WriteLine("{0}, pi.Col = {1}, style = {2}", pi.Token, pi.Col, tmpstyle);
if (pi.Token != null)
{
// replace the '<' with '{' & '>' with '}'
@@ -860,6 +866,8 @@ namespace fmtxml
dc.EndFlag = brFmt.ReadInt16();
dc.EndStyle = LoadVE_Font();
dc.UseCheckOffs = UseCheckOffsIn(fname.Substring(0, fname.Length - 4), dc.oldtonew);
dc.UseColSByLevel = dc.oldtonew == 5;
// use the string offsets to read in the strings.
int[] offst = new int[strings];
for (int j = 0; j < strings; j++)