Use GetJustRoDb to reduce unnecessary data loading
Added flag to allow the section to have optional content. Optional Content flag eliminates message "No Section Content" Handle RO_Lookup Page Token
This commit is contained in:
		@@ -229,7 +229,7 @@ namespace VEPROMS.CSLA.Library
 | 
			
		||||
			byte[] ab = r.ReadBytes((int)fsIn.Length);
 | 
			
		||||
			fsIn.Close();
 | 
			
		||||
 | 
			
		||||
			using (RODb rodb = RODb.Get(rdi.RODbID))
 | 
			
		||||
			using (RODb rodb = RODb.GetJustRoDb(rdi.RODbID))
 | 
			
		||||
			{
 | 
			
		||||
				using (ROImageInfoList myROImages = ROImageInfoList.GetByRODbID(rdi.RODbID))
 | 
			
		||||
				{
 | 
			
		||||
 
 | 
			
		||||
@@ -154,6 +154,18 @@ namespace VEPROMS.CSLA.Library
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		#endregion
 | 
			
		||||
		#region OptionalSectionContent
 | 
			
		||||
		[Category("Miscellaneous")]
 | 
			
		||||
		[Description("Section Optional Content")]
 | 
			
		||||
		private LazyLoad<bool> _OptionalSectionContent;
 | 
			
		||||
		public bool OptionalSectionContent
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return LazyLoad(ref _OptionalSectionContent, "@OptionalSectionContent");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		#endregion
 | 
			
		||||
		#region SpecialStepsFoldout
 | 
			
		||||
		[Category("Miscellaneous")]
 | 
			
		||||
		[Description("Section Special Steps Foldout")]
 | 
			
		||||
 
 | 
			
		||||
@@ -733,7 +733,7 @@ namespace Volian.Print.Library
 | 
			
		||||
			float yPageStart = yTopMargin;
 | 
			
		||||
			if (myItemInfo.HasChildren)
 | 
			
		||||
				localYPageStart = myParagraph.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
 | 
			
		||||
			else
 | 
			
		||||
			else if(!myItemInfo.MyDocStyle.OptionalSectionContent)
 | 
			
		||||
				PrintTextMessage(cb, "No Section Content", _TextLayer);
 | 
			
		||||
			SectionConfig.SectionPagination sp = SectionConfig.SectionPagination.Separate;  // always the default
 | 
			
		||||
			if ( section.NextItemCount > 0)
 | 
			
		||||
 
 | 
			
		||||
@@ -746,7 +746,12 @@ namespace Volian.Print.Library
 | 
			
		||||
							else
 | 
			
		||||
								ProcessPaglistToken(section, svgGroup, pageItem, ref useFontForCheckOffHeader, ref plstr, token);
 | 
			
		||||
						} // end foreach matches
 | 
			
		||||
						
 | 
			
		||||
						if (plstr.StartsWith("RO_Lookup("))
 | 
			
		||||
						{
 | 
			
		||||
							string parms = plstr.Substring(10,plstr.Length-11);
 | 
			
		||||
							string[] parts = parms.Split(",".ToCharArray());
 | 
			
		||||
							plstr = ROLookup(parts[0], parts[1], parts[2]);
 | 
			
		||||
						}
 | 
			
		||||
						if (plstr != "")
 | 
			
		||||
						{
 | 
			
		||||
							if (useFontForCheckOffHeader != null)
 | 
			
		||||
@@ -768,7 +773,18 @@ namespace Volian.Print.Library
 | 
			
		||||
			}
 | 
			
		||||
			if (svgGroup.Count>0) mySvg.Add(svgGroup);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		private string ROLookup(string accpageid, string multiid, string deflt)
 | 
			
		||||
		{
 | 
			
		||||
			ROFSTLookup myLookup = MySection.MyDocVersion.DocVersionAssociations[0].MyROFst.ROFSTLookup;
 | 
			
		||||
			string val = myLookup.GetROValueByAccPagID("<" + accpageid + "." + multiid + ">", MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix);
 | 
			
		||||
			if (val != null)
 | 
			
		||||
			{
 | 
			
		||||
				if (deflt.StartsWith("[") && !val.StartsWith("[")) val = "[" + val + "]";
 | 
			
		||||
				if (deflt.EndsWith("*")) val = val + "*";
 | 
			
		||||
				return val;
 | 
			
		||||
			}
 | 
			
		||||
			return deflt;
 | 
			
		||||
		}
 | 
			
		||||
		private void ProcessPaglistToken(VEPROMS.CSLA.Library.SectionInfo section, SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, ref VE_Font useFontForCheckOffHeader, ref string plstr, string token)
 | 
			
		||||
		{
 | 
			
		||||
			// Paglist token inside a PS= conditional are surrounded by square brackets instead of curley
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user