diff --git a/PROMS/fmtxml/FmtToXml.cs b/PROMS/fmtxml/FmtToXml.cs index 0428ed43..b831ae6c 100644 --- a/PROMS/fmtxml/FmtToXml.cs +++ b/PROMS/fmtxml/FmtToXml.cs @@ -58,6 +58,8 @@ public struct DocStyle // 1 - included with steps // 2 - within sections ie. document styles // 3 - within each accessory document + public short IndexOtherThanFirstPage; // reference document style for remaining pages (not first), if + // one exists. 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 @@ -1063,6 +1065,10 @@ namespace fmtxml // Inherit fonts. DoDSFontInherit(ref dcstyles); + // Do UseOnFirstPage/UseOnAllbutFirstPage index additions. This was added for 32bit support + // of the document style 'StructureStyle Where = "UseOnFirstPage" or "UseOnAllButFirstPage" + DoUseOnPagesAttribute(ref dcstyles); + // do Plant specific adjustments AddPlantSpecific(fname, ref dcstyles); @@ -1104,6 +1110,24 @@ namespace fmtxml } } + private void DoUseOnPagesAttribute(ref DocStyles docstyles) + { + int indxFirst = -1; + int indxAllButFirst = -1; + for (int i = 0; i < docstyles.DcStyles.Length; i++) + + { + if ((docstyles.DcStyles[i].DocStructStyle.DocStyleUse & E_DocStyleUse.UseOnFirstPage) == E_DocStyleUse.UseOnFirstPage) + indxFirst = docstyles.DcStyles[i].Index; + if ((docstyles.DcStyles[i].DocStructStyle.DocStyleUse & E_DocStyleUse.UseOnAllButFirstPage) == E_DocStyleUse.UseOnAllButFirstPage) + indxAllButFirst = docstyles.DcStyles[i].Index; + } + if (indxFirst != -1 && indxAllButFirst != -1) + { + docstyles.DcStyles[indxFirst].IndexOtherThanFirstPage = (short)indxAllButFirst; + } + } + private DocStyle AddDocStyles(string fname) { DocStyle dc = new DocStyle(); diff --git a/PROMS/fmtxml/TranslateDoc.XSL b/PROMS/fmtxml/TranslateDoc.XSL index 71d9b59f..00677256 100644 --- a/PROMS/fmtxml/TranslateDoc.XSL +++ b/PROMS/fmtxml/TranslateDoc.XSL @@ -16,8 +16,9 @@ - - + + + @@ -31,6 +32,13 @@ + + + + + + +