diff --git a/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs index a018279d..3fff8b3d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs @@ -80,6 +80,17 @@ namespace VEPROMS.CSLA.Library // RHM 2008-12-15 - Added logic to keep looking if a blank attribute is found while (xn == null || (xn is XmlAttribute && (xn as XmlAttribute).Value == ""))//Walk-up the format tree to find a font node { + // if the font is not specified in the PageStyle (PageList), then see if oneis set in the DocStyle (default for that section) + // + if (xmlNode.Name == "PageStyle") + { + string psIdx = (xmlNode.Attributes.GetNamedItem("Index") as XmlAttribute).Value; + XmlNode docStyle = xmlNode.OwnerDocument.SelectSingleNode(string.Format("//DocStyle[@PageStyle='{0}']",psIdx)); + xn = docStyle.SelectSingleNode(path); + if (xn != null) return xn; + // could not find a font in the DocStyle, so use the format default + return LookupSingleNode(tmpNode.OwnerDocument.DocumentElement, "/PlantFormat/FormatData/" + path); + } if (xmlNode.NodeType == XmlNodeType.Document) { //if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleFontNode {0},{1}", tmpNode.Name == "Step" ? "Step." + tmpNode.Attributes["Type"].Value : tmpNode.Name, path);