Merge pull request 'F2024-020' (#254) from F2024-020 into Development

Merging into Development.  No code review needed since formats are under development.
This commit is contained in:
Chris Glavan 2024-02-29 10:43:51 -05:00
commit e0faa6403f
10 changed files with 967 additions and 1079 deletions

Binary file not shown.

Binary file not shown.

View File

@ -59,10 +59,8 @@ namespace VEPROMS
get { return _Automatic; }
set { _Automatic = value; }
}
// C2024-003 parameter contains parent section, child section, issubsection flag.
// C2024-003 values needed to print section.
private int[] _prtSectID = new int[] { -1, -1, 0 };
public int[] PrtSectID
private int _prtSectID = -1;
public int PrtSectID
{
get { return _prtSectID; }
set { _prtSectID = value; }
@ -145,8 +143,7 @@ namespace VEPROMS
}
public string PDFPath
{
get
{// B2018-069 Revert to Temporary for Baseline testing
get {// B2018-069 Revert to Temporary for Baseline testing
if (PromsPrinter.BaselineTesting)
return VlnSettings.TemporaryFolder;
return txbPDFLocation.Text;
@ -312,7 +309,7 @@ namespace VEPROMS
{
base.OnActivated(e);
if (Owner != null)
Location = new Point(Owner.Left + Owner.Width / 2 - Width / 2, Owner.Top + Owner.Height / 2 - Height / 2);
Location = new Point(Owner.Left + Owner.Width / 2 - Width / 2, Owner.Top + Owner.Height/2 - Height/2);
}
private void HandleDocVersionSettings()
{
@ -413,7 +410,7 @@ namespace VEPROMS
private Timer _MyTimer;
public void SetupForProcedure() // RHM20150506 Multiline ItemID TextBox
{
if (_DocVersionInfo == null) this.Text = "Create PDF for " + ProcNum;
if(_DocVersionInfo == null)this.Text = "Create PDF for " + ProcNum;
// get list of previous pdf files
// if no previous pdf file, then get path from frmVersionProperties
// dlgSelectFile.InitialDirectory = pdf path from frmVersionProperties
@ -422,7 +419,7 @@ namespace VEPROMS
//txbPDFLocation.Text = _PDFPath;
BuildPDFFileName();
ProcedureConfig pc = _MyProcedure.MyConfig as ProcedureConfig;
if (SelectedSlave > 0) pc.SelectedSlave = SelectedSlave;
if(SelectedSlave > 0) pc.SelectedSlave = SelectedSlave;
if (pc != null)
{
//C2021-062 use the save rev number for all procedures if set, or just use the rev number in the current procedure config
@ -637,7 +634,7 @@ namespace VEPROMS
if (!Directory.Exists(PDFPath))
{
string msg = string.Format("'{0}' does not exist. \n\nCreate it?", PDFPath);
DialogResult dr = MessageBox.Show(msg, "Folder Not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
DialogResult dr= MessageBox.Show(msg, "Folder Not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr == DialogResult.Yes)
{
try
@ -874,7 +871,7 @@ namespace VEPROMS
}
}
pbPDFsStatus.Visible = false;
if (!Automatic)
if(!Automatic)
ShowDebugFiles();
ProfileTimer.Pop(profileDepth);
ProfileTimer.ShowTimerTable();
@ -980,7 +977,7 @@ namespace VEPROMS
Volian.Print.Library.Rtf2Pdf.PdfDebug = cbxDebug.Checked;
// B2019-044 don't print the watermark if the watermark switch on the print dialog is turned off
cbxWaterMark.Visible = true;
string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None"; // B2018-124 use text of watermark form drop down list instead of enum value
string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None" ; // B2018-124 use text of watermark form drop down list instead of enum value
string watermarkColor = "Blue"; // this is the default watermark color
frmPDFStatusForm.SetUnitWatermark(MyProcedure, ref waterMarkText, ref watermarkColor); //C2022-004 Unit Designator Watermark
ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig;
@ -1202,7 +1199,7 @@ namespace VEPROMS
grpDateSelector.Text = "Select Revision Date";
grpDateSelector.Visible = calDateSelector.Visible = true;
//C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date
DateTime initSelDate = (txbDate.Text != null && txbDate.Text.Length != 0) ? Convert.ToDateTime(txbDate.Text) : DateTime.Today;
DateTime initSelDate =(txbDate.Text != null && txbDate.Text.Length != 0)? Convert.ToDateTime(txbDate.Text) : DateTime.Today;
calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate;
}
@ -1305,7 +1302,7 @@ namespace VEPROMS
if (expPrnSetting.Expanded)
//this.Size = new Size(this.Size.Width+(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
//else
this.Size = new Size(this.Size.Width - (expPrnSetting.Size.Width - expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
this.Size = new Size(this.Size.Width-(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
//Refresh();
}
@ -1341,7 +1338,7 @@ namespace VEPROMS
DoCreatePDF(); // create indivitual pdfs
if (_MergedPdfPath != null && _MergedPdfPath != PDFPath) PDFPath = _MergedPfd.Folder = _MergedPdfPath;
// C2021-063 pass in whether to generate Alarm Point List text when a merge is done
if (!_MergedPfd.DoTheMerge(PromsPrinter.MergedLandscapePages, cbxAlmPtTxt.Checked)) return; // merge them together.
if (!_MergedPfd.DoTheMerge(PromsPrinter.MergedLandscapePages,cbxAlmPtTxt.Checked)) return; // merge them together.
// if the property to show the file after printing is set (on the version dialog), display it. Otherwise do a dialog to let user know it's done
if (_DocVersionConfig.Print_MergedPdfsViewAfter)
{

View File

@ -91,15 +91,13 @@ namespace VEPROMS
get { return _DidAll; }
set { _DidAll = value; }
}
// C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag.
// C2024-003 values needed to print section.
private int[] _prtSectID = new int[] { -1, -1, 0 };
public int[] PrtSectID
private int _prtSectID = -1;
public int PrtSectID
{
get { return _prtSectID; }
set { _prtSectID = value; }
}
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd, string pdfFile, Point newLocation, bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, int removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll, string blankPageText, MergedPdf mergedPdf, string watermarkColor, int[] PrtSectID = null)
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd, string pdfFile, Point newLocation, bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, int removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll, string blankPageText, MergedPdf mergedPdf, string watermarkColor, int PrtSectID = -1)
{
// B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic
ProcedureInfo MyProcedure = myItem as ProcedureInfo;
@ -131,7 +129,7 @@ namespace VEPROMS
// if the version number of PROMS is 1.0, then we are running a Demo version.
// When running a Demo version, force a "Sample" watermark when printing.
// B2020-022 append a ".pdf" extension if the file name does on have one.
MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF")) ? pdfFile : pdfFile + ".pdf", insertBlankPages, allOrAuto, Prefix, saveLinks, removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor);
MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF"))?pdfFile:pdfFile+".pdf", insertBlankPages, allOrAuto,Prefix,saveLinks,removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor);
MyPromsPrinter.PromsVersion = (showPROMSVer) ? AboutVEPROMS.PROMSVersion : ""; //C2018-009 print PROMS version
@ -334,8 +332,8 @@ namespace VEPROMS
if (UserInfo.CanEdit(frmVEPROMS.SMyUserInfo, MyPromsPrinter.MyItem.MyDocVersion))
{
// C2023-018: Clarify message on temporary/permanent removal of returns/spaces & page breaks
if (FlexibleMessageBox.Show(this, "The procedure PDF file was created by temporarily removing certain hard returns,\r\ntrailing spaces, and/or manual page breaks that could affect the pagination\r\n" +
"of the procedure.\r\n\r\nAfter reviewing the PDF file, do you want to permanently remove the deleted hard returns, \r\nspaces and/or manual page breaks?\r\n\r\n" +
if (FlexibleMessageBox.Show(this, "The procedure PDF file was created by temporarily removing certain hard returns,\r\ntrailing spaces, and/or manual page breaks that could affect the pagination\r\n"+
"of the procedure.\r\n\r\nAfter reviewing the PDF file, do you want to permanently remove the deleted hard returns, \r\nspaces and/or manual page breaks?\r\n\r\n"+
"An annotation will be added to every location where data has been deleted. The locations \r\ncan be found by performing a Global Search for the \"Manual Pagination Issues\" annotation type.",
"Confirm Pagination Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
@ -424,7 +422,7 @@ namespace VEPROMS
}
catch (Exception ex)
{
string str = string.Format("{0} - {1} - {2}", pdffile, ex.GetType().Name, ex.Message);
string str = string.Format("{0} - {1} - {2}",pdffile,ex.GetType().Name,ex.Message);
MessageBox.Show(str, "Error Opening PDFFile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}

View File

@ -418,8 +418,8 @@ namespace VEPROMS
sbMsg.Append("\n\nPlease have your DBA update the database with the PROMSFixes.sql script file that was\ndelivered with this PROMS executable.");
sbMsg.Append("\n\nThe PROMSFixes.sql file is included with the PROMS installation download.");
sbMsg.Append("\n\nIt can also be found in your PROMS executable folder:");
sbMsg.AppendFormat("\n\t{0}", ExeInfo.PROMSExecutableFolderPath());
FlexibleMessageBox.Show(sbMsg.ToString(), "SQL Stored Procedures Version Difference");
sbMsg.AppendFormat("\n\t{0}",ExeInfo.PROMSExecutableFolderPath());
FlexibleMessageBox.Show(sbMsg.ToString(),"SQL Stored Procedures Version Difference");
}
foreach (string parameter in parameters)
@ -1178,7 +1178,7 @@ namespace VEPROMS
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
}
catch (Exception ex)
catch(Exception ex)
{
StringBuilder sb = new StringBuilder();
@ -1197,21 +1197,7 @@ namespace VEPROMS
{
//args.Node.Parent.
SectionInfo si2 = (args.Node as VETreeNode).VEObject as SectionInfo;
int[] _prtSectID = new int[3]; // C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag.
if (si2.IsSubsection == true)
{
// If section is a subsection. Assigned values are section and subsection.
_prtSectID[0] = si2.MyParent.ItemID; // section
_prtSectID[1] = si2.ItemID; // sub section
_prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag
}
else
{
// If section is a regular section. assign values is section is not a subsection.
_prtSectID[0] = si2.ItemID; // section
_prtSectID[1] = -1; // sub section
_prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag
}
int _prtSectID = si2.ItemID;
if (si2 == null) return;
@ -1221,7 +1207,7 @@ namespace VEPROMS
using (DlgPrintProcedure prnDlg = new DlgPrintProcedure(si2.MyProcedure))
{
prnDlg.PrtSectID = _prtSectID; // Assign Section print values to parameter used in print secetions / sub sections.
prnDlg.PrtSectID = _prtSectID;
prnDlg.SelectedSlave = args.UnitIndex;
prnDlg.MySessionInfo = MySessionInfo;
prnDlg.SetupForProcedure(); // Setup filename

View File

@ -55,7 +55,7 @@ namespace Volian.Controls.Library
{
_MySectionInfo = mySectionInfo;
}
public vlnTreeSectionInfoEventArgs(SectionInfo mySectionInfo, bool isDeleting)
public vlnTreeSectionInfoEventArgs(SectionInfo mySectionInfo,bool isDeleting)
{
_MySectionInfo = mySectionInfo;
_IsDeleting = isDeleting;
@ -138,7 +138,7 @@ namespace Volian.Controls.Library
get { return _Node; }
set { _Node = value; }
}
private TreeNode _Destination = null;
private TreeNode _Destination=null;
public TreeNode Destination
{
get { return _Destination; }
@ -166,7 +166,7 @@ namespace Volian.Controls.Library
//end jcb multiunit
#endregion
#region Factory Methods
private vlnTreeEventArgs() {; }
private vlnTreeEventArgs() { ;}
public vlnTreeEventArgs(TreeNode node)
{
_Node = node;
@ -190,7 +190,7 @@ namespace Volian.Controls.Library
#endregion
public override string ToString()
{
return string.Format("Node={0},Destination={1},Index={2},Unit={3},UnitIndex={4}", NodePath(this.Node), this.Destination, this.Index, this.Unit, this.UnitIndex);
return string.Format("Node={0},Destination={1},Index={2},Unit={3},UnitIndex={4}",NodePath(this.Node),this.Destination, this.Index,this.Unit, this.UnitIndex);
}
private string NodePath(TreeNode node)
@ -213,14 +213,14 @@ namespace Volian.Controls.Library
}
#endregion
#region Factory Methods
private vlnTreeItemInfoEventArgs() {; }
private vlnTreeItemInfoEventArgs() { ;}
public vlnTreeItemInfoEventArgs(ItemInfo myItemInfo)
{
_MyItemInfo = myItemInfo;
}
#endregion
}
public enum E_InsertType { Before, After, Child };
public enum E_InsertType {Before, After, Child};
public partial class vlnTreeItemInfoInsertEventArgs
{
#region Business Methods
@ -256,7 +256,7 @@ namespace Volian.Controls.Library
}
#endregion
#region Factory Methods
private vlnTreeItemInfoInsertEventArgs() {; }
private vlnTreeItemInfoInsertEventArgs() { ;}
public vlnTreeItemInfoInsertEventArgs(ItemInfo myItemInfo, E_InsertType insertType, string stepText)
{
_MyItemInfo = myItemInfo;
@ -303,7 +303,7 @@ namespace Volian.Controls.Library
}
#endregion
#region Factory Methods
private vlnTreeItemInfoPasteEventArgs() {; }
private vlnTreeItemInfoPasteEventArgs() { ;}
public vlnTreeItemInfoPasteEventArgs(ItemInfo myItemInfo, int copyStartId, ItemInfo.EAddpingPart pasteType, int? type)
{
_MyItemInfo = myItemInfo;
@ -353,7 +353,7 @@ namespace Volian.Controls.Library
get { return _SectionConfig; }
set { _ConfigObject = _SectionConfig = value; }
}
private vlnTreePropertyEventArgs() {; }
private vlnTreePropertyEventArgs() { ;}
public vlnTreePropertyEventArgs(string title, FolderConfig folderConfig)
{
_Title = title;
@ -697,7 +697,7 @@ namespace Volian.Controls.Library
{
if (!ui.IsAdministrator() && DoSpecificInfo) cm.MenuItems.Add("Procedure Set Specific Information", new EventHandler(mi_Click));
// B2020-111 only allow Set Administrator to add new folders inside folders they admininstrate
if (ui.IsAdministrator() || ui.IsSetAdministrator(fi.MyParent))
if (ui.IsAdministrator()||ui.IsSetAdministrator(fi.MyParent))
{
cm.MenuItems.Add("Insert Folder Before", new EventHandler(mi_Click));
cm.MenuItems.Add("Insert Folder After", new EventHandler(mi_Click));
@ -842,6 +842,7 @@ namespace Volian.Controls.Library
MenuItem mitcas = new MenuItem("Create Time Critical Action Summary"); //F2022-024 added menu option
MenuItem mip = new MenuItem("Print");
MenuItem miqp = new MenuItem("Quick Print");
//MenuItem mips = new MenuItem("Print Section");
MenuItem mia = new MenuItem("Approve");
int k = 0;
foreach (string s in pri.MyDocVersion.UnitNames)
@ -855,6 +856,9 @@ namespace Volian.Controls.Library
MenuItem mqp = miqp.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
mqp.Enabled = procAppl;
mqp.Tag = k;
//MenuItem mps = mips.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
//mps.Enabled = procAppl;
//mps.Tag = k;
MenuItem ma = mia.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
ma.Enabled = procAppl;
ma.Tag = k;
@ -880,9 +884,13 @@ namespace Volian.Controls.Library
cm.MenuItems.Add("Create Time Critical Action Summary", new EventHandler(mi_Click));
cm.MenuItems.Add("Print", new EventHandler(mi_Click));
cm.MenuItems.Add("Quick Print", new EventHandler(mi_Click));
//cm.MenuItems.Add("Print Section", new EventHandler(mi_Click));
//MenuItem miqp = new MenuItem("Print");
AddShowChangeBarsAfterMenuItem(cm.MenuItems, pri);
cm.MenuItems.Add("Approve", new EventHandler(mi_Click));
//_MyLog.WarnFormat("Context Menu 1 before - {0}", GC.GetTotalMemory(true));
AddApprovedRevisions(cm.MenuItems, pri);
//_MyLog.WarnFormat("Context Menu 1 after - {0}", GC.GetTotalMemory(true));
}
}
else
@ -984,6 +992,13 @@ namespace Volian.Controls.Library
}
#endregion
//_MyLog.WarnFormat("Context Menu 2 - {0}", GC.GetTotalMemory(true));
//#region Print_Section
//if (!tn.IsExpanded && tn.VEObject as SectionInfo != null)
//{
// SectionInfo si = tn.VEObject as SectionInfo;
// if (si.IsStepSection) cm.MenuItems.Add("Print Section", new EventHandler(mi_Click));
//}
//#endregion
#region Menu_Open
if (!tn.IsExpanded && tn.VEObject as SectionInfo != null)
{
@ -1037,7 +1052,7 @@ namespace Volian.Controls.Library
ok = true;
else if (tn.VEObject is ItemInfo && (ui.IsAdministrator() || ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) || ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)))
ok = true;
if (ok)
if(ok)
Menu_Paste(tn, cm);
#endregion
//_MyLog.WarnFormat("Context Menu 5 - {0}", GC.GetTotalMemory(true));
@ -1129,7 +1144,7 @@ namespace Volian.Controls.Library
// Add Properties to the menu unless at the very 'top' node or on a grouping (partinfo)
// node (RNOs, Steps, Cautions, Notes) or at the step level.
// B2020-105 Allow Set Administrators to rename folder's (sets of procedures) to which they have been given access.
if (tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo));
if ( tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo));
else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo))
: (ui.IsAdministrator() || (tn.VEObject is ItemInfo) && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)
|| ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)));
@ -1241,7 +1256,7 @@ namespace Volian.Controls.Library
// F2022-024 added Time Critical Action Summary option
foreach (MenuItem itm in cm.MenuItems)
{
if (itm.Text == "Procedure Specific Information" || itm.Text == "New Section" || itm.Text == "Approve" || itm.Text == "Open" ||
if(itm.Text == "Procedure Specific Information" || itm.Text == "New Section" || itm.Text == "Approve" || itm.Text == "Open" ||
itm.Text == "Copy" || itm.Text == "Delete" || itm.Text == "Properties..." || itm.Text == "Replace Existing Procedure" ||
itm.Text.StartsWith("Showing Change Bars Starting") || itm.Text == "Create Continuous Action Summary" ||
itm.Text == "Create Time Critical Action Summary" || itm.Text == "Export Procedure")
@ -1252,7 +1267,7 @@ namespace Volian.Controls.Library
{
foreach (MenuItem itm in cm.MenuItems)
{
if (!itm.Text.StartsWith("Document Checked Out"))
if(!itm.Text.StartsWith("Document Checked Out"))
itm.Enabled = false;
}
}
@ -1410,7 +1425,7 @@ namespace Volian.Controls.Library
RevisionConfig rc = ri.MyConfig as RevisionConfig;
// bug fix: B2016-183 - add the child's name (ex Unit 1) to the export file name for Parent/Child procedures.
int applIdx = rc.Applicability_Index;
string str = (applIdx > 0) ? _currentPri.MyDocVersion.UnitNames[applIdx - 1] + "_" : ""; // if parent/child get the defined child name to inlcude the export filename
string str = (applIdx > 0)?_currentPri.MyDocVersion.UnitNames[applIdx-1] +"_":""; // if parent/child get the defined child name to inlcude the export filename
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
xd.LoadXml(ri.LatestVersion.ApprovedXML);
string PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database;
@ -1430,17 +1445,16 @@ namespace Volian.Controls.Library
bool superceded = false;
MenuItem mi = sender as MenuItem;
if (mi == null) return;
//RevisionInfo ri = mi.Tag as RevisionInfo;
RevisionInfo ri = RevisionInfo.Get(int.Parse(mi.Tag.ToString()));
RevisionInfo ri = mi.Tag as RevisionInfo;
{
MenuItem mip = mi.Parent as MenuItem;
//B2021-086 Added the check for the last revision stage is an Approved stage
if ((ri.RevisionID < int.Parse(mip.Parent.Tag.ToString())) && ri.LatestVersion.MyStage.IsApproved != 0)
if ((ri.RevisionID < int.Parse(mip.Parent.Tag.ToString())) && ri.LatestVersion.MyStage.IsApproved!=0)
superceded = true;
}
vlnTreeViewPdfArgs args = new vlnTreeViewPdfArgs(Volian.Base.Library.TmpFile.CreateFileName(ProcedureInfo.Get(ri.ItemID).PDFNumber), ri.LatestVersion.PDF, superceded ? "Superceded" : "");
OnViewPDF(sender, args);
// System.Diagnostics.Process pp = System.Diagnostics.Process.Start(GetDocPdf(ri, superceded));
// System.Diagnostics.Process pp = System.Diagnostics.Process.Start(GetDocPdf(ri, superceded));
}
void MultiUnitApprovedRevision_Click(object sender, EventArgs e)
{
@ -1781,7 +1795,7 @@ namespace Volian.Controls.Library
OnPrintSection(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
break;
case "Print All Procedures for":
OnPrintAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
OnPrintAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0,mi.Text,(int)mi.Tag));
break;
case "Approve":
OnApproveProcedure(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
@ -1793,10 +1807,10 @@ namespace Volian.Controls.Library
OnApproveSomeProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
break;
case "Create Continuous Action Summary":
OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0,mi.Text,(int)mi.Tag));
break;
case "Create Time Critical Action Summary":
OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0,mi.Text,(int)mi.Tag));
break;
default:
if (mip.Text.StartsWith("Showing Change Bars Starting"))
@ -2052,11 +2066,11 @@ namespace Volian.Controls.Library
UpdateROValues(SelectedNode as VETreeNode);
break;
case "Create Continuous Action Summary":
OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0));
break;
// F2022-024 Time Critical Action Summary
case "Create Time Critical Action Summary":
OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0));
break;
// B2017-243 added the following two Cannot Paste items when dealing with enhanced documents
// when then user selects these menu items a message box will appear giving more information as to why it cannot be pasted
@ -2188,7 +2202,7 @@ namespace Volian.Controls.Library
swROUpdate.Write(string.Format("Fixed Referenced Object for {1}({4}){0}Old Text: {2}{0}New Text: {3}{0}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID));
}
private ProgressBarItem _ProgressBar = null;
private ProgressBarItem _ProgressBar=null;
public ProgressBarItem ProgressBar
{
get { return _ProgressBar; }
@ -2365,7 +2379,7 @@ namespace Volian.Controls.Library
// assume that item to paste is a procedure, otherwise the menuing would not have
// included the paste options
tn = (VETreeNode)tn.Nodes[tn.Nodes.Count - 1];
tn = (VETreeNode) tn.Nodes[tn.Nodes.Count - 1];
p = "After";
}
else // this is an empty docversion:
@ -2482,8 +2496,8 @@ namespace Volian.Controls.Library
}
private void PasteReplace(VETreeNode tn, int copyStartID)
{
VETreeNode prevtn = (VETreeNode)tn.PrevNode;
VETreeNode partn = (VETreeNode)tn.Parent;
VETreeNode prevtn = (VETreeNode) tn.PrevNode;
VETreeNode partn = (VETreeNode) tn.Parent;
ItemInfo ii = tn.VEObject as ItemInfo;
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, true);
@ -2504,7 +2518,7 @@ namespace Volian.Controls.Library
}
private void tv_NodeCopy()
{
if (SelectedNode == null) return;
if (SelectedNode==null)return;
VETreeNode tn = SelectedNode as VETreeNode;
OnNodeCopy(this, new vlnTreeEventArgs(tn));
}
@ -2513,7 +2527,7 @@ namespace Volian.Controls.Library
private void SetupNodeProperties()
{
VETreeNode tn = SelectedNode as VETreeNode;
if (tn == null) return;
if (tn==null)return;
if ((tn.VEObject as FolderInfo) != null)
OpenProperties(tn.VEObject as FolderInfo);
@ -2525,7 +2539,7 @@ namespace Volian.Controls.Library
if (dvi != null && dvi.DocVersionAssociations != null && dvi.DocVersionAssociations.Count > 0) rofstid = dvi.DocVersionAssociations[0].MyROFst.ROFstID;
OpenProperties(tn.VEObject as DocVersionInfo);
if (dvi != null && dvi.DocVersionAssociations != null && dvi.DocVersionAssociations.Count > 0 && rofstid != dvi.DocVersionAssociations[0].MyROFst.ROFstID)
OnTabDisplay(this, new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST"));
OnTabDisplay(this,new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST"));
}
else if ((tn.VEObject as ProcedureInfo) != null)
OpenProperties(tn.VEObject as ProcedureInfo);
@ -2659,7 +2673,7 @@ namespace Volian.Controls.Library
}
if (f1 != -1) Folder.Delete(f1);
}
else if (newtype == MenuSelections.FolderAfter || newtype == MenuSelections.FolderBefore)
else if (newtype == MenuSelections.FolderAfter||newtype == MenuSelections.FolderBefore)
{
int f2 = -1;
string uniquename = _LastFolderInfo.MyParent.UniqueChildName("New Folder");
@ -2689,7 +2703,7 @@ namespace Volian.Controls.Library
else if (newtype == MenuSelections.Procedure)
{
int p1 = -1;
using (Procedure procedure = Procedure.MakeProcedure(_LastDocVersionInfo, _LastDocVersionInfo.Procedures.Count != 0 ? _LastDocVersionInfo.Procedures[_LastDocVersionInfo.Procedures.Count - 1] : null, null, "New Procedure", 0))
using (Procedure procedure = Procedure.MakeProcedure(_LastDocVersionInfo, _LastDocVersionInfo.Procedures.Count!=0?_LastDocVersionInfo.Procedures[_LastDocVersionInfo.Procedures.Count-1]:null, null, "New Procedure", 0))
{
ShowBrokenRules(procedure.BrokenRulesCollection);
SetLastValues(ProcedureInfo.Get(procedure.ItemID));
@ -2785,7 +2799,7 @@ namespace Volian.Controls.Library
"If you would like to view or copy these hidden steps you will need to go\n" +
"into the properties of this section and check the Editable Data checkbox.\n" +
"You will then be able to view and copy those steps. When finished, open\n" +
"the properties page again and uncheck the Editable Data checkbox.\n\n" +
"the properties page again and uncheck the Editable Data checkbox.\n\n"+
"Do you want to continue creating the subsection?";
if (FlexibleMessageBox.Show(this, msgstr, "Subsection Insert", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
@ -2797,7 +2811,7 @@ namespace Volian.Controls.Library
if (!hasMetaSubs) doPseudo = true;
}
}
using (Section section = CreateNewSection())
using(Section section = CreateNewSection())
{
ShowBrokenRules(section.BrokenRulesCollection);
SectionInfo savLastSectionInfo = _LastSectionInfo;
@ -2821,7 +2835,7 @@ namespace Volian.Controls.Library
// may have to add a 'steps' node if a step(s) already exist...
ItemInfo ii = (SelectedNode as VETreeNode).VEObject as ItemInfo;
int cpindx = 0;
if (SelectedNode.Nodes.Count > 0)
if (SelectedNode.Nodes.Count>0)
{
VETreeNode vtn = SelectedNode.Nodes[0] as VETreeNode;
// B2017-014: removed code that was adding a 2nd section part node. and also select node to
@ -2865,8 +2879,8 @@ namespace Volian.Controls.Library
if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK)
{
int indx = tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1);
int itemido = (indx >= par.Nodes.Count) ? -1 : (((par.Nodes[indx] as VETreeNode).VEObject) as ItemInfo).ItemID;
if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString() || itemido != section.ItemID)
int itemido = (indx >= par.Nodes.Count)?-1:(((par.Nodes[indx] as VETreeNode).VEObject) as ItemInfo).ItemID;
if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString() || itemido !=section.ItemID)
{
tn = new VETreeNode(_LastSectionInfo);
par.Nodes.Insert(indx, tn);
@ -3139,7 +3153,7 @@ namespace Volian.Controls.Library
// see if enhanced related steps need created:
SectionConfig scfgE = _LastItemInfo.ActiveSection.MyConfig as SectionConfig; // C2018-003 fixed use of getting the active section
if (scfgE != null && scfgE.Section_LnkEnh == "Y")
if (scfgE != null && scfgE.Section_LnkEnh=="Y")
{
// set up which item to insert from based on whether editor was open (see comment from 11/17 above).
EnhancedDocuments enhdocs = null;
@ -3422,7 +3436,7 @@ namespace Volian.Controls.Library
// just clear enhanced links back
_LastSectionInfo.ClearEnhancedSectionLink();
}
OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(_LastSectionInfo, true));
OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(_LastSectionInfo,true));
// always return false because an event gets fired to delete tree nodes.
if (!DeleteItemInfoAndChildren(_LastSectionInfo))
{
@ -3488,11 +3502,11 @@ namespace Volian.Controls.Library
// do delete using RTBItem - this manages windowing from the step editor.
// If the procedure is open & you're deleting procedure, you want to close open
// window - this is done in DisplayTabControl-DeleteStepTabItem.
OnProcessing(true, "Deleting");
OnProcessing(true,"Deleting");
if (!OnDeleteItemInfo(this, new vlnTreeItemInfoEventArgs(ii)))
Item.DeleteItemAndChildren(ii);
OnProcessing(false, "Deleted");
OnProcessingComplete(dtStart, "Deleted");
OnProcessing(false,"Deleted");
OnProcessingComplete(dtStart,"Deleted");
if (deletedSection)
{
// B2020-087 if we deleted the last sub section, then clear the SubSection_Edit in the parent's config
@ -3511,8 +3525,8 @@ namespace Volian.Controls.Library
}
catch (System.Data.SqlClient.SqlException ex)
{
OnProcessing(false, "Delete Failed");
OnProcessingComplete(dtStart, "Delete Failed");
OnProcessing(false,"Delete Failed");
OnProcessingComplete(dtStart,"Delete Failed");
// C2020-033: Support delete to bring up Search/Incoming Transitions panel
if (ex.Message.Contains("has External Transitions"))
{
@ -3532,13 +3546,13 @@ namespace Volian.Controls.Library
private void OnProcessingComplete(DateTime dtStart, string message)
{
if (ProcessingComplete != null)
ProcessingComplete(this, new vlnTreeTimeEventArgs(dtStart, message));
ProcessingComplete(this, new vlnTreeTimeEventArgs(dtStart,message));
}
public event vlnTreeViewStatusEvent Processing;
private void OnProcessing(bool status, string message)
{
if (Processing != null)
Processing(this, new vlnTreeStatusEventArgs(status, message));
Processing(this, new vlnTreeStatusEventArgs(status,message));
}
#endregion
#region SetLastValuesAndSaveIfChangedStuff
@ -3629,7 +3643,7 @@ namespace Volian.Controls.Library
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("tv_ItemDrag", ex);
if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_ItemDrag", ex);
}
}
#endregion
@ -3809,12 +3823,12 @@ namespace Volian.Controls.Library
//if (e.Effect == DragDropEffects.None) return;
if (_dropNode != null)
{
// if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation1 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond);
// if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation1 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond);
DragHelper.ImageList_DragShowNolock(false);
TreeView tv = _dropNode.TreeView;
TreeNode tmp = tv.GetNodeAt(tv.PointToClient(new Point(e.X, e.Y)));
// if (!ScrollOnly)
// {
// if (!ScrollOnly)
// {
if (ScrollTreeView(tmp) || !ScrollOnly)
{
//if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation2 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond);
@ -3824,11 +3838,11 @@ namespace Volian.Controls.Library
//tv.SelectedNode = dropNode;
Graphics g = tv.CreateGraphics();
TreeNodeTriangle(g);
if (_position != DropPosition.Child) InsertPointer(tmp, g);
if (_position != DropPosition.Child)InsertPointer(tmp, g);
}
}
// }
// else ScrollTreeView(tmp);
// }
// else ScrollTreeView(tmp);
DragHelper.ImageList_DragShowNolock(true);
}
}
@ -3916,7 +3930,7 @@ namespace Volian.Controls.Library
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("tv_DragOver", ex);
if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_DragOver", ex);
}
}
@ -3970,7 +3984,7 @@ namespace Volian.Controls.Library
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("GetTreeNodeFromData", ex);
if(_MyLog.IsErrorEnabled)_MyLog.Error("GetTreeNodeFromData", ex);
}
}
return null;
@ -3996,7 +4010,7 @@ namespace Volian.Controls.Library
this.SelectedNode = dragNode;
FolderInfo fdragi = ((VETreeNode)dragNode).VEObject as FolderInfo;
FolderInfo fdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as FolderInfo;
if (fdragi != null && fdropi != null && fdropi.FolderDocVersionCount == 0)
if (fdragi != null && fdropi != null && fdropi.FolderDocVersionCount==0)
{
using (Folder fdrag = fdragi.Get())
{
@ -4080,36 +4094,36 @@ namespace Volian.Controls.Library
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("tv_DragDrop", ex);
if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_DragDrop", ex);
}
}
// private void DumpMembers(object o)
// {
// Type t = o.GetType();
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("\r\n\r\nMembers for type {0}", t.ToString());
// MemberInfo[] mis = t.GetMembers();
// int i = 0;
// foreach (MemberInfo mi in mis)
// {
// i++;
// try
// {
// //if(mi.MemberType != MemberTypes.Method)
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0} {1} {2}", i, mi.Name, mi.MemberType);
//// if (fi.Name == "TreeView")
//// fi.SetValue(o, null);
// }
// catch (Exception ex)
// {
// if(_MyLog.IsErrorEnabled)_MyLog.Error("DumpMembers", ex);
// }
// }
// }
// private void DumpMembers(object o)
// {
// Type t = o.GetType();
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("\r\n\r\nMembers for type {0}", t.ToString());
// MemberInfo[] mis = t.GetMembers();
// int i = 0;
// foreach (MemberInfo mi in mis)
// {
// i++;
// try
// {
// //if(mi.MemberType != MemberTypes.Method)
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0} {1} {2}", i, mi.Name, mi.MemberType);
//// if (fi.Name == "TreeView")
//// fi.SetValue(o, null);
// }
// catch (Exception ex)
// {
// if(_MyLog.IsErrorEnabled)_MyLog.Error("DumpMembers", ex);
// }
// }
// }
private TreeNode Clone(TreeNode tn)
{
TreeNode tmp = (TreeNode)tn.Clone();
ExpandMatch(tmp, tn);
ExpandMatch(tmp,tn);
return tmp;
}
private void tv_DragDropOld(object sender, System.Windows.Forms.DragEventArgs e)

View File

@ -75,7 +75,7 @@ namespace Volian.Print.Library
if (MyItemInfo.MyPrevious != null) // add if statement to fix Westinghouse print issue 3-21-2014
return 1;
}
if (MyItemInfo.IsSection && _ChildrenBelow == null && YSize > (yLocation - yBottomMargin))
if (MyItemInfo.IsSection && _ChildrenBelow == null && YSize > (yLocation-yBottomMargin))
{
ShowPageBreak(1, "Page Break before empty section", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
return 1;
@ -171,7 +171,7 @@ namespace Volian.Print.Library
// line above the end message, thus 2 not 3. This change was made on July 20, 2011 by RHM & KBR. The
// procedure in questions was VEWCNEMG\EMGAPP.PRC, ES-01, Step 8.
//float yEndMsg = !_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0;
float yEndMsg = (!_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null) ? GetEndMessageHeight(MyItemInfo.MyDocStyle) : 0; // B2018-068 account for mult-line End Messages
float yEndMsg = (!_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null)? GetEndMessageHeight(MyItemInfo.MyDocStyle) : 0; // B2018-068 account for mult-line End Messages
// also consider if there is a phone list at the bottom of the page, add the amount of space the phone
// list requires onto yEndMsg to make it easier to figure out pagination (include an extra line for the
@ -202,7 +202,7 @@ namespace Volian.Print.Library
{
MyPageHelper.ParaBreaks.RemoveAt(0);
reason = AddReason("Partial Step - Case 1");
ShowPageBreak(1, reason, "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
ShowPageBreak(1,reason, "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
return 2; // break on this item within a step
}
// check for rnos:
@ -278,7 +278,7 @@ namespace Volian.Print.Library
StepConfig sc = firstChild.MyItemInfo.MyConfig as StepConfig;
ManualPageBreak = MyPageHelper.OriginalPageBreak ? (sc == null ? false : sc.Step_ManualPagebreak) :
sc == null ? false :
(MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks == null) ? sc.Step_NewManualPagebreak : false;
(MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks == null)? sc.Step_NewManualPagebreak : false;
// C2021-010: Remove trailing returns/spaces & manual page breaks & allow save.
if (sc != null && sc.Step_NewManualPagebreak && MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks != null &&
!MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks.Contains(firstChild.MyItemInfo.ItemID)) MyPageHelper.MyPromsPrinter.RemoveManualPageBreaks.Add(firstChild.MyItemInfo.ItemID);
@ -309,7 +309,7 @@ namespace Volian.Print.Library
float ySizeIncludingFirstStep = firstStepChild.YSize + (firstStepChild.YTopMost - YTopMost);
float ySizeBtmCtnMess = GetBottomContinueMessageSize(MyItemInfo.MyDocStyle);
float ySizeBtmEndMess = GetBottomEndMessageSize(MyItemInfo.MyDocStyle);
bool firstSubstepExceedsSpaceAvailable = ySizeIncludingFirstStep > (yWithinMargins - ySizeBtmCtnMess - ySizeBtmEndMess);
bool firstSubstepExceedsSpaceAvailable = ySizeIncludingFirstStep > (yWithinMargins - ySizeBtmCtnMess -ySizeBtmEndMess);
if (KeepStepsOnPage && firstSubstepExceedsSpaceAvailable && !isFirstChild)
KeepStepsOnPage = false;
if (ySizeIncludingFirst == YSize) KeepStepsOnPage = false;
@ -445,8 +445,8 @@ namespace Volian.Print.Library
if (BreakHighLevelStepWithSection) KeepWithHeader = true;
// for a HLS that has an asterisk box with the rno separator IN the box, adjust the size by 2 lines to account for box.
if (MyItemInfo.IsStep && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0 &&
(MyItemInfo.RNOs == null || MyItemInfo.RNOs.Count == 0))
mySize += (2 * SixLinesPerInch);
(MyItemInfo.RNOs==null ||MyItemInfo.RNOs.Count==0))
mySize += (2*SixLinesPerInch);
// mySize is the size of this step and includes an extra blank line. For HLS, if this is the last step in section & there is room in footer to keep
// step on the page, do so by eliminating the blank line before doing the test to see if it fits.
// B2017-254 Fixed Pagination Logic when checking to see if the current item is the last high level step
@ -486,7 +486,7 @@ namespace Volian.Print.Library
// 888 888 888 o oo .d8P `888'`888' 888 888 888 888 888 888 .
// o888o o888o o888ooooood8 8""88888P' `8' `8' o888o o888o o888o o888o o888o "888"
//Console.WriteLine("'PageBreak',1,'No','HLS will fit on page',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath);
ShowPageBreak(-1, "HLS will fit on page", firstStep, YSize, yPageSize, yWithinMargins, ManualPageBreak);
ShowPageBreak(-1, "HLS will fit on page", firstStep, YSize, yPageSize, yWithinMargins,ManualPageBreak);
return 0;
}
// !MyItemInfo.IsHigh - if (MyItemInfo.IsRNOPart && MyParent.XOffset < XOffset) return 0; // Don't paginate on an RNO to the right
@ -701,7 +701,7 @@ namespace Volian.Print.Library
else
ShowPageBreak(6, CheckForFirstCompression("HLS will have to split on current page"), "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak);
// B2018-081 - Fix pagination when a Step and it's substeps are so complicated that the high level step is separated from its high level RNO
if (this.MyItemInfo.IsHigh && MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.IsHigh)
if(this.MyItemInfo.IsHigh && MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.IsHigh)
{
MyPageHelper.ParaBreaks.Clear();
BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, true); // Case 1 :Works for ES05 Step 15 SubStep 7
@ -773,7 +773,7 @@ namespace Volian.Print.Library
bool hasRNO = false;
if (itemInfo1.IsInRNO) hasRNO |= true;
else
hasAER |= true;
hasAER |=true;
if (itemInfo2.IsInRNO) hasRNO |= true;
else
hasAER |= true;
@ -787,7 +787,7 @@ namespace Volian.Print.Library
if (endmsg != "")
{
string[] splitOn = { "\\par" }; // B2018-058 account for RTF newlines ( used for V.C. Summer End messages)
EndMsgHeight = (endmsg.Split(splitOn, StringSplitOptions.RemoveEmptyEntries).Length + 1) * SixLinesPerInch;
EndMsgHeight = (endmsg.Split(splitOn,StringSplitOptions.RemoveEmptyEntries).Length + 1) * SixLinesPerInch;
}
return EndMsgHeight;
}
@ -876,7 +876,7 @@ namespace Volian.Print.Library
// B2020-159: If forced pagination errors occurred, add a description to be placed on a dialog after printing.
if (PromsPrinter.ForcedPaginations == null) PromsPrinter.ForcedPaginations = new List<string>();
string path = MyItemInfo.Path.Replace(MyItemInfo.MyProcedure.DisplayText, "").Replace(MyItemInfo.MyProcedure.DisplayNumber, "").TrimStart(" ,".ToCharArray());
PromsPrinter.ForcedPaginations.Add(string.Format("{0}\t{1}\t{2}", MyPromsPrinter.PDFFile.Substring(0, MyPromsPrinter.PDFFile.IndexOf(".")), path, MyItemInfo.PageNumber));
PromsPrinter.ForcedPaginations.Add(string.Format("{0}\t{1}\t{2}", MyPromsPrinter.PDFFile.Substring(0,MyPromsPrinter.PDFFile.IndexOf(".")), path, MyItemInfo.PageNumber));
}
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && MyPageHelper.CreatingSupInfoPage)
@ -888,7 +888,7 @@ namespace Volian.Print.Library
if (breakOrNot != "No")
{
bool hasBox = MyItemInfo.IsStep && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0;
bool rnoSepIn = (MyItemInfo.RNOs == null || MyItemInfo.RNOs.Count == 0);
bool rnoSepIn = (MyItemInfo.RNOs==null ||MyItemInfo.RNOs.Count==0);
// DebugPagination.WriteLine("{0}", MyItemInfo.DBSequence); //,instance);
if (DebugPagination.IsOpen) DebugPagination.WriteLine("{0:D6},'{1}',{2},'{3}','{4}',{5},{6},{7},{8},{9},{10},{11}",
MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber - (breakOrNot == "Yes" ? 0 : 1),
@ -934,10 +934,10 @@ namespace Volian.Print.Library
private bool CheckAlternates(vlnParagraph vpBrk)
{
if (_AlternateBreaks == null) return false;
foreach (vlnParagraph vp in AlternateBreaks)
foreach(vlnParagraph vp in AlternateBreaks)
if (vp.MyItemInfo.ItemID == vpBrk.MyItemInfo.ItemID)
{
// _MyLog.WarnFormat("alternate used '{0}'-'{1}'",vpBrk.MyItemInfo.ShortPath,vp.MyItemInfo.ShortPath);
// _MyLog.WarnFormat("alternate used '{0}'-'{1}'",vpBrk.MyItemInfo.ShortPath,vp.MyItemInfo.ShortPath);
return true;
}
return false;
@ -999,7 +999,7 @@ namespace Volian.Print.Library
{
float myFirstPieceRNOSize = 0;
myFirstPieceRNOSize = ChildrenRight[0].GetFirstPieceSize();
if (myFirstPieceRNOSize < ySpaceOnCurPage)
if(myFirstPieceRNOSize < ySpaceOnCurPage)
if (ChildrenBelow.Count > 0)
{
float myFirstPieceAERSize = ChildrenBelow[0].GetFirstPieceSize() + ChildrenBelow[0].YOffset - YOffset;
@ -1465,7 +1465,7 @@ namespace Volian.Print.Library
}
float ySpaceAt7LPI = (adjustedCurPageYSpace - (accountForCalvertAlarmConditionResponseFooter + yEndMsg)) * SixLinesPerInch / _SevenLinesPerInch;
if ((YSize - yTop) > (adjustedCurPageYSpace - (accountForCalvertAlarmConditionResponseFooter + yEndMsg))
&& (YSize - yTop) < ySpaceAt7LPI)
&& (YSize - yTop) < ySpaceAt7LPI )
{
// Compress Rest of Step
// .oooooo. ooooooooo. .
@ -1596,13 +1596,13 @@ namespace Volian.Print.Library
/// <param name="myList"></param>
/// <returns></returns>
private static vlnParagraph FindPageBreak1(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList, vlnParagraph lastBreak, float fullPage,
float myBottomMsgSpace, bool RNOContinueOnly, float yTop)
float myBottomMsgSpace,bool RNOContinueOnly, float yTop)
{
vlnParagraph minPara = null;
//StringBuilder minBuff = new StringBuilder();
float? yLocationMin = null;
float? yLocationMin=null;
vlnParagraph minPara2 = null;
float? yLocationMin2 = null;
float? yLocationMin2=null;
float yAddForBtmMsg = 0;
// useful for debugging pagination issues, lastbreak gets the paragraph at the top of the previous page, shows all
// of the locations within 'range' on the next page.
@ -1824,7 +1824,7 @@ namespace Volian.Print.Library
// B2020-073 was not keeping all of RNO sub-step together - Comanche Peak FRC-0.1 (unit 1) Step 14
// B2020-081 was breaking on an AER substep that has an long RNO - should keep AER substep and part of RNO on the page = D.C. Cook "Current (Post FLEX) U1 NOP NOT [EOPs]" set, ES-0.1 step 1.
// B2020-085 was breaking first child of second RNO (third IF in RNO) - should break on second child of second RNO - D.C. Cook AOP Unit 1 002-020 Step 15
// B2020-099 was breaking on last sub-step of previous RNO - Calvert Approved Procedures; Abnormal Procedures <20> Unit 2; AOP-2A; Section VII; Step 11.RNO.11.1.c
// B2020-099 was breaking on last sub-step of previous RNO - Calvert Approved Procedures; Abnormal Procedures Unit 2; AOP-2A; Section VII; Step 11.RNO.11.1.c
private vlnParagraph HasSecondRNOThatWillFit(float yStart, float yLowerLimit, float yUpperLimit, StepLevelList myList, int stepLevel, float yTop)
{
// B2020-120: for calvert alarms/condition response table, don't run code for second rno
@ -1836,7 +1836,7 @@ namespace Volian.Print.Library
return this;
// see if there is a second RNO then see if it will fit on the page
vlnParagraph tmp = this;
while (!tmp.MyItemInfo.IsRNOPart && tmp.MyParent != null) tmp = tmp.MyParent; // if on a substep of an RNO, move up the substep's parent (RNO)
while (!tmp.MyItemInfo.IsRNOPart && tmp.MyParent!=null) tmp = tmp.MyParent; // if on a substep of an RNO, move up the substep's parent (RNO)
vlnParagraph parent = tmp;
while (parent.MyParent != null && !parent.MyParent.MyItemInfo.IsSection) parent = parent.MyParent; // this will take us to the High level step
float yTopParent = parent.YTopMost; // this is where the HLS starts printing
@ -1875,13 +1875,13 @@ namespace Volian.Print.Library
return maxBottomMost;
}
private static bool StepWillFitOnBlankPageButNotOnCurrentPage(vlnParagraph myPara, float yLocation, float yStart, float fullPage)
private static bool StepWillFitOnBlankPageButNotOnCurrentPage(vlnParagraph myPara, float yLocation, float yStart,float fullPage)
{
// B2019-150 & B2019-151 Pagination Bugs Seen for Summer EOP4.1 Step 10 and
// SAG Step 9. Added format flag to limit when this logic would be used.
if (myPara.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PaginateOnStepThatWillFitOnBlankPage == false)
return false;
float spaceOnCurrentPage = fullPage - (-yLocation + yStart);
float spaceOnCurrentPage = fullPage - (-yLocation+yStart);
// B2019-124 - Pagination - if substep will fit on a blank page but will not fit on the current page
// And is not the first substep then break
// B2019-130 - in Calvert data (FSG-1 Appendix 1 Unit 1 Actions, step E.1.g) the THEN sub step was placed on the next page
@ -1927,7 +1927,7 @@ namespace Volian.Print.Library
if (myPara.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertPagination)
return (myPara.YOffset <= myParaBreak.YOffset &&
(myPara.YOffset + myPara.Height) >= myParaBreak.YOffset);
return (myPara.YOffset == myParaBreak.YOffset);
return(myPara.YOffset == myParaBreak.YOffset);
}
private bool HasAncestor(vlnParagraph myParaBreak)
{

View File

@ -179,10 +179,8 @@ namespace Volian.Print.Library
get { return _PDFFile; }
set { _PDFFile = value; }
}
// C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag.
// C2024-003 values needed to print individual sections.
private int[] _prtSectID = new int[] { -1, -1, 0 };
public int[] PrtSectID
private int _prtSectID = -1;
public int PrtSectID
{
get { return _prtSectID; }
set { _prtSectID = value; }
@ -325,7 +323,7 @@ namespace Volian.Print.Library
set { _MergedPdf = value; }
}
public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite,
ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages, bool batchPrint, string prefix, bool saveLinks, int removeTrailngHardReturnsAndManualPageBreaks, string blankPageText, bool didAll, MergedPdf mergedPdf, string watermarkColor, int[] PrtSectID = null)
ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages, bool batchPrint, string prefix, bool saveLinks, int removeTrailngHardReturnsAndManualPageBreaks, string blankPageText, bool didAll, MergedPdf mergedPdf, string watermarkColor, int PrtSectID = -1)
{
Prefix = prefix; // RHM20150506 Multiline ItemID TextBox
_MyItem = myItem;
@ -343,8 +341,6 @@ namespace Volian.Print.Library
_BatchPrint = batchPrint;
_MyReaderHelper = new ReaderHelper(this);
_SaveLinks = saveLinks;
// C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag.
_prtSectID = PrtSectID;
// C2021-010: Remove trailing returns/spaces & manual page breaks & allow save.
if (removeTrailngHardReturnsAndManualPageBreaks == 1 || removeTrailngHardReturnsAndManualPageBreaks == 3) RemoveTrailingHardReturnsAndSpaces = new List<int>();
if (removeTrailngHardReturnsAndManualPageBreaks == 2 || removeTrailngHardReturnsAndManualPageBreaks == 3) RemoveManualPageBreaks = new List<int>();
@ -352,7 +348,8 @@ namespace Volian.Print.Library
_DidAll = didAll;
_MergeNotIncluded = false;
_MergedPdf = mergedPdf;
_prtSectID = PrtSectID;
//_MyReaderHelper.LoadTree(myItem);
}
// Pass 1 PDF Name
private string _BeforePageNumberPdf = null;
@ -371,11 +368,11 @@ namespace Volian.Print.Library
// B2019-152: MergedLandscapePages is a dictionary whose key is the pdf file name & values are all of the page numbers
// in that pdf that should have landscaped page numbers. These are added when the page is finished (onEndPage)
public static Dictionary<string, List<int>> MergedLandscapePages = null;
public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary, bool makeTimeCriticalActionSummary, int[] PrtSectID = null)
public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary, bool makeTimeCriticalActionSummary, int PrtSectID = -1)
{
if (_MyItem is ProcedureInfo)
{
_prtSectID = PrtSectID; // C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag.
_prtSectID = PrtSectID;
ProcedureConfig pcfg = (ProcedureConfig)(_MyItem as ProcedureInfo).MyConfig;
if (DidAll && pcfg.Print_NotInMergeAll) // will be merging a pdf, so don't print this procedure if user set that on procedure propertures
{
@ -807,46 +804,23 @@ namespace Volian.Print.Library
VlnItextFont.RegisterFontFolder(); //B2019-174 register the font folder so that symbols will display on auto TOC
if (myProcedure.Sections != null)
{
SectionInfo CurSection = null; // C2024-003 detrimine if the user in printing a sub section.
if (Convert.ToBoolean(PrtSectID[2])) // If section is a CurSection retrieved the CurSection.
{
foreach (SectionInfo si2 in myProcedure.Sections)
{
if (si2.ItemID == PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find Parent Section
{
if (subsi.ItemID == PrtSectID[1]) // Find sub section
{
CurSection = subsi; // Assign the subsection object to CurSection.
}
}
}
}
}
int cnt = 0;
foreach (SectionInfo mySection in myProcedure.Sections)
{
if (PrtSectID[0] == -1 || (PrtSectID[0] > -1 && mySection.ItemID == PrtSectID[0])) // C2024-003 check if the user is printing a section
if (PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID))
{
if (!Convert.ToBoolean(PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection. CurSection contains any type of section.
if (!mySection.MyDocStyle.IsStepSection && !mySection.IsAutoTOCSection)
{
CurSection = mySection; // if section is not a sub section.
}
if (!CurSection.MyDocStyle.IsStepSection && !CurSection.IsAutoTOCSection)
{
VEPROMS.CSLA.Library.Document.ConvertWordSectionToDOCX((ItemInfo)CurSection); // B2023-093 Convert a Word section to the DOCX Word format if needed before printing
VEPROMS.CSLA.Library.Document.ConvertWordSectionToDOCX((ItemInfo)mySection); // B2023-093 Convert a Word section to the DOCX Word format if needed before printing
}
//C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
if ((myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (CurSection.MyConfig as SectionConfig).Section_IsFoldout == "Y")
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && (CurSection.MyConfig as SectionConfig).Section_IsFoldout == "Y"))
if ((myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y")
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y"))
{
// if floating foldouts, need a list of sections & foldoutreaders. Just do first for now.
_MyFoldoutSection.Add(CurSection);
string foldoutPdf = PrintProcedureOrFoldout(myProcedure, CurSection, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout" + cnt.ToString() + @".pdf", false, false, false);
_MyFoldoutSection.Add(mySection);
string foldoutPdf = PrintProcedureOrFoldout(myProcedure, mySection, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout" + cnt.ToString() + @".pdf", false, false, false);
_MyFoldoutReader.Add(foldoutPdf != null ? new PdfReader(foldoutPdf) : null);
cnt++;
}
@ -977,67 +951,44 @@ namespace Volian.Print.Library
string clr = pc.GetValue("PSI", "WATERMARKOVERRIDECLR");
if (clr != null && clr != "") WatermarkOverrideColor = clr.ToUpper().Contains("DEFAULT") ? "BLUE" : clr;
}
SectionInfo CurSection = null; // C2024-003 detrimine if the user is printing a sub section.1639
if (Convert.ToBoolean(PrtSectID[2]))
{
foreach (SectionInfo si2 in myProcedure.Sections) // Find parent section.
{
if (si2.ItemID == PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find selected sub section.
{
if (subsi.ItemID == PrtSectID[1])
{
CurSection = subsi; // Assign sub section object to CurSection.
}
}
}
}
}
foreach (SectionInfo mySection in myProcedure.Sections)
{
if (PrtSectID[0] == -1 || (PrtSectID[0] > -1 && mySection.ItemID == PrtSectID[0]))
if(PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID) )
{
if (!Convert.ToBoolean(PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection
{
CurSection = mySection;
}
// B2020-115 Calculate maximum available space on a page for figures
vlnParagraph.hMax = ((float)CurSection.MyDocStyle.Layout.PageLength);
vlnParagraph.wMax = ((float)CurSection.MyDocStyle.Layout.PageWidth) - ((float)CurSection.MyDocStyle.Layout.LeftMargin - 12);
vlnParagraph.hMax = ((float)mySection.MyDocStyle.Layout.PageLength);
vlnParagraph.wMax = ((float)mySection.MyDocStyle.Layout.PageWidth) - ((float)mySection.MyDocStyle.Layout.LeftMargin - 12);
NeedSupInfoBreak = true;
bool isFoldoutSection = (CurSection.MyConfig as SectionConfig).Section_IsFoldout == "Y"; //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
bool isFoldoutSection = (mySection.MyConfig as SectionConfig).Section_IsFoldout == "Y"; //C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
if (((isFoldoutSection && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts)
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && isFoldoutSection))
!= doingFoldout) continue;
if (myFoldoutSection != null && myFoldoutSection.ItemID != CurSection.ItemID) continue;
PrintOverride.CompressSuper = CurSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
PrintOverride.CompressSub = CurSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
PrintOverride.CompressPropSubSup = CurSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup;
if (myFoldoutSection != null && myFoldoutSection.ItemID != mySection.ItemID) continue;
PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
PrintOverride.CompressPropSubSup = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup;
OnStatusChanged((CurSection.DisplayNumber ?? "") == "" ? CurSection.DisplayText : CurSection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
// Set up Helper for the particular Section
if (_MyHelper == null)
{
LastFmtName = CurSection.ActiveFormat.Name;
lastDocStyle = (int)CurSection.MyDocStyle.Index;
LastFmtName = mySection.ActiveFormat.Name;
lastDocStyle = (int)mySection.MyDocStyle.Index;
string hlsText = "";
int hlsItemId = 0;
if (CurSection.IsStepSection && CurSection.Steps != null && CurSection.Steps.Count > 0)
if (mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0)
{
hlsItemId = CurSection.Steps[0].ItemID;
hlsText = CurSection.Steps[0].DisplayText; // save the High level step text for use in the page list
hlsItemId = mySection.Steps[0].ItemID;
hlsText = mySection.Steps[0].DisplayText; // save the High level step text for use in the page list
}
cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(CurSection, this, hlsText, hlsItemId, PrtSectID);
cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this, hlsText, hlsItemId, PrtSectID);
_MyHelper.AllowAllWatermarks = AllowAllWatermarks;
_MyHelper.MyPdfWriter = cb.PdfWriter;
_MyHelper.CreatingFoldoutPage = doingFoldout;
_MyHelper.CreatingSupInfoPage = false;
_MyHelper.MyPdfContentByte = cb;
if (!CurSection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)CurSection, ((CurSection.DisplayNumber ?? "") == "" ? "" : CurSection.DisplayNumber + " - ") + CurSection.DisplayText, null);
if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
if (DebugOutput)
{
// 16-bit background
@ -1048,7 +999,7 @@ namespace Volian.Print.Library
_MyHelper.BackgroundFile = procedureFileName;
float x = 0;
float y = 0;
if (!(CurSection.ActiveFormat.Name.ToUpper().StartsWith("WST") || _MyHelper.Back32BitPROMS)) // compare folder contains PROMS generated PDF
if (!(mySection.ActiveFormat.Name.ToUpper().StartsWith("WST") || _MyHelper.Back32BitPROMS)) // compare folder contains PROMS generated PDF
{
// X value below = 16-bit pdf OverrideLeftMargin = -2 characters at the plant format's default Font's
// characters per inch.
@ -1084,29 +1035,29 @@ namespace Volian.Print.Library
{
//added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section
_MyHelper.MyGaps.Clear();
//Console.WriteLine("'{0}' PromsPrinter", CurSection.DisplayText);
//Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText);
// if pagination is separate or we've changed the format, we have not done the first page
// (if this format has the useonfirst page docstyle flag)
if (LastFmtName != CurSection.ActiveFormat.Name || lastDocStyle != (int)CurSection.MyDocStyle.Index || CurSection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate)
if (LastFmtName != mySection.ActiveFormat.Name || lastDocStyle != (int)mySection.MyDocStyle.Index || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate)
{
_MyHelper.DidFirstPageDocStyle = false;
lastDocStyle = (int)CurSection.MyDocStyle.Index;
LastFmtName = CurSection.ActiveFormat.Name;
lastDocStyle = (int)mySection.MyDocStyle.Index;
LastFmtName = mySection.ActiveFormat.Name;
}
if (!CurSection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)CurSection, ((CurSection.DisplayNumber ?? "") == "" ? "" : CurSection.DisplayNumber + " - ") + CurSection.DisplayText, null);
_MyHelper.MySection = CurSection;
if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
_MyHelper.MySection = mySection;
//OnStatusChanged("After Set Svg", PromsPrinterStatusType.SetSVG);
}
// if this format uses phonelists, see if this section has one. We need to know the number
//of lines to adjust the pagelength for pagination and printing.
_MyHelper.PhoneListHeight = 0;
if (CurSection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList)
if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList)
{
// get config for section
SectionConfig sc = CurSection.MyConfig as SectionConfig;
SectionConfig sc = mySection.MyConfig as SectionConfig;
if (sc.Section_PhoneList != null && sc.Section_PhoneList == "Y")
{
DocVersionConfig dvc = CurSection.MyDocVersion.MyConfig as DocVersionConfig;
DocVersionConfig dvc = mySection.MyDocVersion.MyConfig as DocVersionConfig;
if (dvc != null)
{
string phlist = dvc.Print_PhoneList;
@ -1131,13 +1082,13 @@ namespace Volian.Print.Library
}
_MyHelper.FinalMessageSectionID = finalMessageSectionID; // set VlnSvgPageHelper with the finalMessageSectionID
if (CurSection.IsAutoTOCSection)
if (mySection.IsAutoTOCSection)
{
if (((cb.PdfWriter.CurrentPageNumber % 2 == 0 && !_MyHelper.CreatingFoldoutPage) || myProcedure.ProcHasSupInfoData) && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
{
InsertBlankPage(cb);
}
GenerateTOC(CurSection, myProcedure, cb, _TextLayer);
GenerateTOC(mySection, myProcedure, cb, _TextLayer);
// B2020-102: extra page printing after auto TOC for summer. Retested for Farley and was successful also
// F2018-033: Farley Auto TOC. If doing foldouts or supinfo facing pages, add a blank page after also:
//if (myProcedure.ProcHasSupInfoData && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even
@ -1147,21 +1098,21 @@ namespace Volian.Print.Library
}
else
{
if (CurSection.IsStepSection)
if (mySection.IsStepSection)
{
if (CurSection.Steps != null && CurSection.Steps.Count > 0)
if (mySection.Steps != null && mySection.Steps.Count > 0)
{
// get first step to send to floating foldout indx.&& MyItemInfo.FoldoutIndex>-1)
ItemInfo firstStep = CurSection.Steps[0];
ItemInfo firstStep = mySection.Steps[0];
// B2019-165 Don't print the duplex foldout (on the back of the page) if the Don't Include Duplex Foldout check box was checked in section properties
if (firstStep.FoldoutIndex() > -1 && (CurSection.MyPrevious == null || !((CurSection.MyPrevious.MyConfig as SectionConfig).Section_DontIncludeDuplexFoldout)))
if (firstStep.FoldoutIndex() > -1 && (mySection.MyPrevious == null || !((mySection.MyPrevious.MyConfig as SectionConfig).Section_DontIncludeDuplexFoldout)))
DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper, firstStep.FoldoutIndex(), InsertBlankPages);
else if (!_MyHelper.CreatingFoldoutPage && _MyFoldoutReader.Count > 0 && InsertBlankPages)
{
// if it is continuous pagination, don't do blank page - not sure if this is correct place for this:
// C2023-001 if the previous section has the flag to not insert blank pages,
// then don't insert a blank page between the previous section and this one
if (CurSection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && !CurSection.SearchPrev.MyDocStyle.DontInsertBlankPages)
if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && !mySection.SearchPrev.MyDocStyle.DontInsertBlankPages)
{
// only insert a blank page if this section does not have a foldout (but the procedure as a whole does)
// and the checkbox on the print dialog to add blank pages is checked
@ -1173,18 +1124,18 @@ namespace Volian.Print.Library
{
// If the procedure has supplemental facing pages, but this section does not & it's the first section,
// need a blank 'facing page'. Sections after the first will get blank 'facing page' in print's pagination logic
if (SupInfoPrintType == E_SupInfoPrintType.Merge && !CurSection.HasSupInfoSteps && firstStepSec && InsertBlankPages)
if (SupInfoPrintType == E_SupInfoPrintType.Merge && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages)
{
InsertBlankPage(cb);
}
}
}
firstStepSec = false;
CreateStepPdf(CurSection, cb);
CreateStepPdf(mySection, cb);
}
else
{
CreateWordDocPdf(cb, CurSection);
CreateWordDocPdf(cb, mySection);
}
}
_MyHelper.PrintedSectionPage = 0;
@ -1631,44 +1582,19 @@ namespace Volian.Print.Library
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine("TOC Ystart {0} LeftMar {1} ScNmPos {2} ScTtlPos {3} ScPgPos {4}", yPageStart, leftMargin, secNumPos, secTitlePos, secPagePos);
bool inGroup = false;
SectionInfo CurSection = null; // C2024-003 detrimine determine if the user in printing a sub section.
if (Convert.ToBoolean(PrtSectID[2]))
{
foreach (SectionInfo si2 in ii.Sections) // Find parent section.
{
if (si2.ItemID == PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find sub section.
{
if (subsi.ItemID == PrtSectID[1])
{
CurSection = subsi; // Assigned sub section object to CurSection.
}
}
}
}
}
foreach (SectionInfo mySection in ii.Sections)
{
if (PrtSectID[0] == -1 || (PrtSectID[0] > -1 && mySection.ItemID == PrtSectID[0]))
if (PrtSectID == -1 || (PrtSectID > -1 && mySection.ItemID == PrtSectID))
{
if (!Convert.ToBoolean(PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection
{
CurSection = mySection;
}
sectCnt++;
SectionConfig sc = CurSection.MyConfig as SectionConfig;
if ((CurSection.MyDocStyle != null && CurSection.MyDocStyle.IncludeInTOC && (sc == null || sc.Section_TOC != "Y"))
|| ((CurSection.MyDocStyle == null || !CurSection.MyDocStyle.IncludeInTOC) && (sc != null && sc.Section_TOC == "Y")))
SectionConfig sc = mySection.MyConfig as SectionConfig;
if ((mySection.MyDocStyle != null && mySection.MyDocStyle.IncludeInTOC && (sc == null || sc.Section_TOC != "Y"))
|| ((mySection.MyDocStyle == null || !mySection.MyDocStyle.IncludeInTOC) && (sc != null && sc.Section_TOC == "Y")))
{
// for indenting of subsections, count up tree. Only start indenting
// at third level, i.e. not indent on 1.0 and 1.1, but indent on 1.1.1:
level = 0;
ItemInfo iilvl = CurSection as ItemInfo;
ItemInfo iilvl = mySection as ItemInfo;
while (!iilvl.IsProcedure)
{
level++;
@ -1710,7 +1636,7 @@ namespace Volian.Print.Library
// need to do the section number, section title & page number. Page number
// has to be put on at end after number of page is known, so use a Template.
bool didGrp = false;
string tmptxt = CurSection.MyContent.Number == null || CurSection.MyContent.Number == "" ? " " : CurSection.DisplayNumber;// B2017-019 - process "<u>" in section number
string tmptxt = mySection.MyContent.Number == null || mySection.MyContent.Number == "" ? " " : mySection.DisplayNumber;// B2017-019 - process "<u>" in section number
if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects
&& tocGrpHeading.Length > 0 && tmptxt.ToUpper().Contains(tocGrpHeading))
{
@ -1739,7 +1665,7 @@ namespace Volian.Print.Library
// logic put in for V.C. Summer who wants to their auto table of contents to print "OPERATOR ACTIONS" (set in the format) instead of "Procedure Steps"
// - note that Summer didn't want to change the section title because they want transition to say "procedure step" for the section title. 03/08/2016
string tocSecTitle = CurSection.FormattedDisplayText;// B2017-019 - process "<u>" in section title
string tocSecTitle = mySection.FormattedDisplayText;// B2017-019 - process "<u>" in section title
tocSecTitle = ConvertSpecialChars(tocSecTitle, ii.ActiveFormat.PlantFormat.FormatData); // B2019-172 process symbol characters
if (tocSecTitle.ToUpper() == "PROCEDURE STEPS" && tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle != "")
tocSecTitle = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle;
@ -1805,7 +1731,7 @@ namespace Volian.Print.Library
// adjust ylocation for pagenumber - the ylocation will get reset if the
// section title split on 2 lines and the page number needs to be on the 2nd line.
// Only do this if the title is not empty (the code was meant for if title spans more than a line)
if (retval != ttlRetval && CurSection.MyContent.Text != null && CurSection.MyContent.Text != "") yLocation += (retval - ttlRetval);
if (retval != ttlRetval && mySection.MyContent.Text != null && mySection.MyContent.Text != "") yLocation += (retval - ttlRetval);
// retval = the minimum (further down the page) between section number and
// title - this accounts for multi line title.
@ -1813,7 +1739,7 @@ namespace Volian.Print.Library
lastyLocation = retval;
// check that the page number should be in the TOC (some BGE sections do not have the page number)
if (!((CurSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontNumberInTOC) == E_DocStructStyle.DontNumberInTOC))
if (!((mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontNumberInTOC) == E_DocStructStyle.DontNumberInTOC))
{
// add a template for the page number:
// if the space character is not null & is not a space, the we've got to put out
@ -1864,8 +1790,8 @@ namespace Volian.Print.Library
}
// if in the pre-table of content list, just put the page number out as text.
// otherwise, add a template _MyHelper.MyTOCPageCounts
string key = "TOC" + CurSection.ItemID.ToString();
if (CurSection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key))
string key = "TOC" + mySection.ItemID.ToString();
if (mySection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key))
{
string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentTOCPageNumber + 1).ToString();
rtfText = GetRtfToC(pnum, tOfC);
@ -1879,10 +1805,10 @@ namespace Volian.Print.Library
//If the format wants single spacing within subsections (2nd level and lower), then need to figure out
// spacing (vcb1 table of contents)
//bool dosuby = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0)
// && (CurSection.MyParent.IsSection && ((CurSection.Sections != null && CurSection.Sections.Count > 0) || (level > 0 && CurSection.NextItem != null))))
// && (mySection.MyParent.IsSection && ((mySection.Sections != null && mySection.Sections.Count > 0) || (level > 0 && mySection.NextItem != null))))
// || didGrp;
doSubY = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0)
&& (CurSection.MyParent.IsSection && (/* CurSection.Sections == null && */ sectCnt < ii.Sections.Count))) // B2016-205
&& (mySection.MyParent.IsSection && (/* mySection.Sections == null && */ sectCnt < ii.Sections.Count))) // B2016-205
|| didGrp;
//float spc = (float)(tOfC.TofCLineSpacing ?? 1);
if (doSubY)
@ -1911,12 +1837,12 @@ namespace Volian.Print.Library
}
// C2021-015: Barakah High Level Steps in Table of Contents - check to see if we need to add the high level steps on
// table of contents for this section, format flag & section has steps:
if (CurSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCAllowHLS &&
CurSection.IsStepSection && CurSection.Steps != null && CurSection.Steps.Count > 0)
yLocation = AddHLSToTOC(tocSection, CurSection, tOfC, cb, yPageStart, yLocation, doSubY, level + 1, adjSecTitlePos);
if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCAllowHLS &&
mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0)
yLocation = AddHLSToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation, doSubY, level + 1, adjSecTitlePos);
}
float savYLoc = yLocation;
yLocation = AddSectionToTOC(tocSection, CurSection, tOfC, cb, yPageStart, yLocation, doSubY);
yLocation = AddSectionToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation, doSubY);
if (savYLoc == yLocation) // nothing was outputted i.e. the subsections are not included on the TOC // B2016-205
{
if (doSubY && sectCnt == ii.Sections.Count)
@ -3015,39 +2941,17 @@ namespace Volian.Print.Library
private void LoadSectionTree(ItemInfo ii)
{
if (ii.Sections == null) return; // B2021-067 crash on null reference
SectionInfo CurSection = null;
if (Convert.ToBoolean(MyPromsPrinter.PrtSectID[2])) // C2024-003 determine if the user is printing a sub section. If so assign it to CurSection.
{
foreach (SectionInfo si2 in ii.Sections) // Find parent section
{
if (si2.ItemID == MyPromsPrinter.PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find sub section.
{
if (subsi.ItemID == MyPromsPrinter.PrtSectID[1])
{
CurSection = subsi; // Assign sub section object to CurSection.
break;
}
}
}
}
}
foreach (SectionInfo si in ii.Sections)
if (MyPromsPrinter.PrtSectID[0] == -1 || (MyPromsPrinter.PrtSectID[0] > -1 && si.ItemID == MyPromsPrinter.PrtSectID[0]))
{
if (!Convert.ToBoolean(MyPromsPrinter.PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection
if (MyPromsPrinter.PrtSectID == -1 || (MyPromsPrinter.PrtSectID > -1 && si.ItemID == MyPromsPrinter.PrtSectID))
{
CurSection = si;
}
if (CurSection.IsStepSection)
if (si.IsStepSection)
{
if (CurSection.Sections != null) LoadSectionTree(CurSection);
if (si.Sections != null) LoadSectionTree(si);
}
else
{
MyPdfFile = _MyPromsPrinter.BuildMSWordPDF(CurSection);
MyPdfFile = _MyPromsPrinter.BuildMSWordPDF(si);
if (MyPdfFile != null)
{
try
@ -3056,18 +2960,18 @@ namespace Volian.Print.Library
if (fi.Length == 0) // B2017-218 Handle invalid word sections
{
if (!PromsPrinter.BaselineTesting) //B2018-071 Output a message box unless baseline testing is being performed.
MessageBox.Show(CurSection.DisplayNumber + " " + CurSection.DisplayText + " is not valid", "Invalid Word Section", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
MessageBox.Show(si.DisplayNumber + " " + si.DisplayText + " is not valid", "Invalid Word Section", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
MyReader = MyPdfFile != null ? new PdfReader(MyPdfFile) : null;
string key = string.Empty;
for (int i = 1; i <= MyReader.NumberOfPages; i++)
{
key = string.Format("{0}.{1}", CurSection.ItemID, i);
key = string.Format("{0}.{1}", si.ItemID, i);
dicPage.Add(key, MyPromsPrinter.MyContentByte.PdfWriter.GetImportedPage(MyReader, i));
iTextSharp.text.Rectangle rectgl = MyReader.GetPageSizeWithRotation(i);
// If the word page is set to landscape, but the document style is not landscape, then flip the height and width (put back to portrait)
if (!((CurSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_WordContentLandscaped) == E_DocStructStyle.DSS_WordContentLandscaped) && rectgl.Height < rectgl.Width)
if (!((si.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_WordContentLandscaped) == E_DocStructStyle.DSS_WordContentLandscaped) && rectgl.Height < rectgl.Width)
rectgl = new iTextSharp.text.Rectangle(rectgl.Height, rectgl.Width);
dicSize.Add(key, rectgl);
//dicSize.Add(key, MyReader.GetPageSizeWithRotation(i));
@ -3077,41 +2981,41 @@ namespace Volian.Print.Library
{
if (_MyPromsPrinter.DocReplace == null)
MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
_MyLog.Warn(string.Format("Error in LoadSectionTree [{0}],{1}.{2}", CurSection.ItemID, CurSection.DisplayNumber, CurSection.DisplayText), ex);
_MyLog.Warn(string.Format("Error in LoadSectionTree [{0}],{1}.{2}", si.ItemID, si.DisplayNumber, si.DisplayText), ex);
}
}
}
}
}
}
}
//public class PrintTimer
//{
// private DateTime _StartTime = DateTime.Now;
// public DateTime StartTime
// {
// get { return _StartTime; }
// set { _StartTime = value; }
// }
// private string _Description = "Start";
// public string Description
// {
// get { return _Description; }
// set
// {
// DateTime dtNext = DateTime.Now;
// //Console.WriteLine("{0},'{1}'", TimeSpan.FromTicks(dtNext.Ticks - LastTime.Ticks).TotalSeconds, Description);
// _Description = value;
// _LastTime = dtNext;
// }
// }
// private DateTime _LastTime = DateTime.Now;
// public DateTime LastTime
// {
// get { return _LastTime; }
// set { _LastTime = value; }
// }
//}
}
//public class PrintTimer
//{
// private DateTime _StartTime = DateTime.Now;
// public DateTime StartTime
// {
// get { return _StartTime; }
// set { _StartTime = value; }
// }
// private string _Description = "Start";
// public string Description
// {
// get { return _Description; }
// set
// {
// DateTime dtNext = DateTime.Now;
// //Console.WriteLine("{0},'{1}'", TimeSpan.FromTicks(dtNext.Ticks - LastTime.Ticks).TotalSeconds, Description);
// _Description = value;
// _LastTime = dtNext;
// }
// }
// private DateTime _LastTime = DateTime.Now;
// public DateTime LastTime
// {
// get { return _LastTime; }
// set { _LastTime = value; }
// }
//}

View File

@ -12,7 +12,7 @@ using Volian.Base.Library;
namespace Volian.Print.Library
{
public partial class VlnSvgPageHelper : SvgPageHelper
public partial class VlnSvgPageHelper:SvgPageHelper
{
private float _TableAdjustment = 0;// RHM20150525 - Table Scrunch
public float TableAdjustment
@ -58,7 +58,7 @@ namespace Volian.Print.Library
}
set
{
if (value == null || _BottomContent == null || _BottomContent > value)
if(value == null || _BottomContent == null || _BottomContent > value)
_BottomContent = value;
}
}
@ -85,27 +85,25 @@ namespace Volian.Print.Library
get { return _TopMessage; }
set { _TopMessage = value; }
}
// C2024-003 parameter contains parent section itemid, child section itemid, issubsection flag.
// C2024-003 values needed to print section.
private int[] _prtSectID = new int[] { -1, -1, 0 };
public int[] PrtSectID
private int _prtSectID = -1;
public int PrtSectID
{
get { return _prtSectID; }
set { _prtSectID = value; }
}
private List<vlnText> _TopMessageRs = new List<vlnText>(); // Added if there are 2 messages, in AER AND RNO (for BGE)
private List<vlnText> _TopMessageRs=new List<vlnText>(); // Added if there are 2 messages, in AER AND RNO (for BGE)
public List<vlnText> TopMessageRs
{
get { return _TopMessageRs; }
set { _TopMessageRs = value; }
}
private List<vlnText> _TopMessageSub1s = new List<vlnText>(); // BGE Alarms: in CONDITION/RESPONSE if break within substep
private List<vlnText> _TopMessageSub1s=new List<vlnText>(); // BGE Alarms: in CONDITION/RESPONSE if break within substep
public List<vlnText> TopMessageSub1s
{
get { return _TopMessageSub1s; }
set { _TopMessageSub1s = value; }
}
private List<vlnText> _TopMessageSub2s = new List<vlnText>(); // BGE Alarms: in CONDITION/RESPONSE if break within substep
private List<vlnText> _TopMessageSub2s=new List<vlnText>(); // BGE Alarms: in CONDITION/RESPONSE if break within substep
public List<vlnText> TopMessageSub2s
{
get { return _TopMessageSub2s; }
@ -268,7 +266,7 @@ namespace Volian.Print.Library
//Console.WriteLine("End {0}",path);
int profileDepth = ProfileTimer.Push(">>>> OnEndPage");
InitialsPrinted = false;
MyPromsPrinter.OnStatusChanged(string.Format("Page {0}", CurrentPageNumber + 1));
MyPromsPrinter.OnStatusChanged(string.Format("Page {0}", CurrentPageNumber+1));
// B2019-152: Landscape page merged page numbers
if (this.MySection != null && MySection.MyDocStyle.LandscapePageList) PromsPrinter.AddMergedLandscapePage(this, MyPromsPrinter.PDFFile);
bool onBlankPage = OnBlankPage;
@ -295,9 +293,9 @@ namespace Volian.Print.Library
}
else
{
E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence ?? 0;
E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence??0;
// if a foldout is only printing within its section, don't do increments on pagecounts:
if (numseq == E_NumberingSequence.WithinEachSection)
if (numseq==E_NumberingSequence.WithinEachSection)
MyPageCounts.CanIncrement = false;
else
MyPageCounts.CanIncrement = true;
@ -307,7 +305,7 @@ namespace Volian.Print.Library
}
// added the check for onBlankPage and Foldouts to fix bug found in V.C. Summer auto table of contents - 03/08/2016
//C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
if (!onBlankPage && (MySection.MyDocStyle.StructureStyle.Style == null || (MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountInTabOfCont) == 0) &&
if (!onBlankPage && (MySection.MyDocStyle.StructureStyle.Style==null || (MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountInTabOfCont) == 0) &&
!(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (MySection.MyConfig as SectionConfig).Section_IsFoldout == "Y"))
CurrentTOCPageNumber++;
if (MySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList)
@ -416,7 +414,7 @@ namespace Volian.Print.Library
cb.LineTo(x, y);
cb.Stroke();
}
i = 0;
i = 0;
cb.Stroke();
cb.RestoreState();
cb.EndLayer();
@ -529,7 +527,7 @@ namespace Volian.Print.Library
public void AddGap(float top, float bottom, float left, float right)
{
float center = MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0;
if (center == 0) return;
if(center == 0) return;
if (center > right || center < left) return;
MyGaps.Add(top, bottom);
}
@ -580,7 +578,7 @@ namespace Volian.Print.Library
if ((MySection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0)
{
//Console.WriteLine("{0} ResetDocStyleAndValues", MySection.MyDocStyle.Name);
ItemInfo ii = (ItemInfo)MySection;
ItemInfo ii = (ItemInfo) MySection;
int indx = (int)MySection.MyDocStyle.IndexOtherThanFirstPage;
foreach (DocStyle ds in ii.ActiveFormat.PlantFormat.DocStyles.DocStyleList)
{
@ -616,7 +614,7 @@ namespace Volian.Print.Library
cb.SetColorStroke(new Color(System.Drawing.Color.CornflowerBlue));
float yTop = (float)(cb.PdfWriter.PageSize.Height - layout.TopMargin);
//Console.WriteLine("Page,yTop,yTopMargin {0},{1},{2}", cb.PdfDocument.PageNumber, yTop, YTopMargin);
if (YTopMargin != null) yTop = (float)YTopMargin;
if(YTopMargin != null) yTop = (float)YTopMargin;
float yBottom = (float)(cb.PdfWriter.PageSize.Height - (layout.TopMargin + layout.PageLength));
//Console.WriteLine("'{0}',{1},{2}", MySection.MyDocStyle.Name, yTop, yBottom);
cb.MoveTo(x, yTop);
@ -657,14 +655,14 @@ namespace Volian.Print.Library
}
cb.SetLineWidth(w / 30);
i++;
cb.MoveTo(x + w, y - 1);
cb.LineTo(x, y - 1);
cb.MoveTo(x + w, y-1);
cb.LineTo(x, y-1);
cb.Stroke();
}
cb.SetLineWidth(.1F);
cb.Rectangle((float)layout.LeftMargin, yTop, (float)layout.PageWidth - (float)layout.LeftMargin, yBottom - yTop);
float yFooter = yBottom + (float)layout.FooterLength;
cb.MoveTo((float)layout.LeftMargin, yFooter);
float yFooter = yBottom+(float)layout.FooterLength;
cb.MoveTo((float)layout.LeftMargin,yFooter);
cb.LineTo((float)layout.PageWidth, yFooter);
float yRuler = 612;
cb.MoveTo(0, yRuler);
@ -673,17 +671,17 @@ namespace Volian.Print.Library
{
if (x1 % 72 == 0)
{
cb.MoveTo(x1, yRuler - 20);
cb.LineTo(x1, yRuler + 20);
cb.MoveTo(x1, yRuler-20);
cb.LineTo(x1, yRuler+20);
}
else if (x1 % 36 == 0)
{
cb.MoveTo(x1, yRuler - 10);
cb.LineTo(x1, yRuler + 10);
cb.MoveTo(x1, yRuler-10);
cb.LineTo(x1, yRuler+10);
}
else
{
cb.MoveTo(x1, yRuler - 5);
cb.MoveTo(x1, yRuler-5);
cb.LineTo(x1, yRuler);
}
}
@ -722,24 +720,20 @@ namespace Volian.Print.Library
foreach (PageBookmark pb in PageBookmarks)
{
int lev = pb.Level;
if (MyPdfOutlines.Count < lev || lev == 0)
if (MyPdfOutlines.Count < lev || lev==0)
{
PdfDestination dest = new PdfDestination(PdfDestination.FIT);
PdfOutline pdo = new PdfOutline(writer.DirectContent.RootOutline, dest, pb.Title, false);
if (!Convert.ToBoolean(_prtSectID[2]))
{
if (MyPdfOutlines.Count == lev)
MyPdfOutlines.Add(pdo);
else
MyPdfOutlines[lev] = pdo;
}
}
else
{
PdfDestination dest = pb.PdfDestination;
if (dest == null) dest = new PdfDestination(PdfDestination.FIT);
PdfOutline pdo = new PdfOutline(MyPdfOutlines[lev - 1], dest, Regex.Replace(pb.Title, @"\\{Prerequisite Step: .*?\\}", string.Empty), false);
PdfDestination dest =pb.PdfDestination;
if(dest==null) dest = new PdfDestination(PdfDestination.FIT);
PdfOutline pdo = new PdfOutline(MyPdfOutlines[lev-1], dest,Regex.Replace(pb.Title, @"\\{Prerequisite Step: .*?\\}", string.Empty), false);
if (MyPdfOutlines.Count == lev)
MyPdfOutlines.Add(pdo);
else
@ -885,8 +879,7 @@ namespace Volian.Print.Library
DidFirstPageDocStyle = false;
if (DidFirstPageDocStyle)
forceLoadSvg = SetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this)
if (_prtSectID[0] > -1)
{
if (_prtSectID > -1) {
forceLoadSvg = true;
}
Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg);
@ -1047,7 +1040,7 @@ namespace Volian.Print.Library
set { _MyPromsPrinter = value; }
}
private int _MyRomanPage = 1;
public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId, int[] PrtSectID = null)
public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId, int PrtSectID)
: base()
{
_prtSectID = PrtSectID;
@ -1178,7 +1171,7 @@ namespace Volian.Print.Library
// specific cases.
string key = ((int)MySection.MyDocStyle.NumberingSequence).ToString();
E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence ?? 0;
E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence??0;
//Console.WriteLine("\"{0}\"\t\"{1}\"\t{2}", MySection.DisplayNumber, MySection.DisplayText, numseq);
switch (numseq)
{
@ -1209,7 +1202,7 @@ namespace Volian.Print.Library
key = key + "." + MySection.ItemID;
break;
case E_NumberingSequence.WithinEachSectionNumber:
key = key + "." + (MySection.DisplayNumber == string.Empty ? (MySection.ActiveParent as ItemInfo).DisplayNumber : MySection.DisplayNumber);
key = key + "." + ( MySection.DisplayNumber == string.Empty ? (MySection.ActiveParent as ItemInfo).DisplayNumber : MySection.DisplayNumber);
break;
case E_NumberingSequence.GroupedByLevel:
case E_NumberingSequence.Like6_ButDoesntNeedSubsection:
@ -1288,7 +1281,7 @@ namespace Volian.Print.Library
{
// If subformat and does not have its own genmac, find an inherited genmac.
FormatInfo tmpf = FormatInfo.Get(activeFormat.ParentID);
while (tmpf.FormatID != 1 && (sGenMac == null || sGenMac == string.Empty))
while (tmpf.FormatID!=1 && (sGenMac==null||sGenMac==string.Empty))
{
sGenMac = tmpf.GenMac;
tmpf = FormatInfo.Get(tmpf.ParentID);
@ -1339,7 +1332,7 @@ namespace Volian.Print.Library
SectionConfig sc = section.MyConfig as SectionConfig;
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine("SecNum=\"{0}\" SecTitle=\"{1}\" DocStyle=\"{2}\" Format=\"{3}\" ItemID={4}", section.DisplayNumber, section.DisplayText, section.MyDocStyle.Name, sc.FormatSelection, section.ItemID);
Volian.Base.Library.BaselineMetaFile.WriteLine(" Pagination=\"{0}\" MSWordPgCnt={1} NumPages={2} WordMargin={3}", sc.Section_Pagination, section.MSWordPageCount, (string.IsNullOrEmpty(sc.Section_NumPages)) ? "0" : sc.Section_NumPages, (string.IsNullOrEmpty(sc.Section_WordMargin)) ? "N" : sc.Section_WordMargin);
Volian.Base.Library.BaselineMetaFile.WriteLine(" Pagination=\"{0}\" MSWordPgCnt={1} NumPages={2} WordMargin={3}", sc.Section_Pagination, section.MSWordPageCount, (string.IsNullOrEmpty(sc.Section_NumPages)) ? "0" : sc.Section_NumPages, (string.IsNullOrEmpty(sc.Section_WordMargin))?"N":sc.Section_WordMargin);
if (PgLogicals == null) PgLogicals = new Dictionary<string, bool>();
else PgLogicals.Clear();
@ -1383,7 +1376,7 @@ namespace Volian.Print.Library
}
VE_Font useFontForCheckOffHeader = null;
if (forceLoad || (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag == 0) && (pageItem.Row < 0))))
if (forceLoad || (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag ==0 )&& (pageItem.Row < 0))))
{
//if (PrevRow > 0)
//{
@ -1448,7 +1441,7 @@ namespace Volian.Print.Library
int idx = procnum.IndexOf('-');
otherChildUnit = procnum.Substring(0, idx); // we need to get RO info for the Other child applicability - this gets child's number
}
ROLookupVal = ROLookup(parts[0], parts[1], string.Empty, otherChildUnit); // will return empty string if alarm point is not found in RO database
ROLookupVal = ROLookup(parts[0], parts[1], string.Empty,otherChildUnit); // will return empty string if alarm point is not found in RO database
usePSIvalue = (ROLookupVal != section.MyProcedure.DisplayNumber); // use PSI value if child alarm ID not found or does not match resolved procedure number (alarm point)
}
// C2021-065 if usePSIvalue is true, then we know alarm point info is not in the RO database, so just use the default (PSI) value
@ -1831,7 +1824,7 @@ namespace Volian.Print.Library
case "[PROCTITLE3]":
case "{COVERPROCTITLE}":
case "[COVERPROCTITLE]":
int tlen = (token.Contains("COVERPROCTITLE")) ? (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength;
int tlen = (token.Contains("COVERPROCTITLE"))?(int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength;
//float linelen = (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength * (float)pageItem.Font.CPI / 12;
float linelen = tlen * (float)pageItem.Font.CPI / 12;
string title = section.MyProcedure.MyContent.Text;
@ -1859,7 +1852,7 @@ namespace Volian.Print.Library
break;
case "{TITLE&UNIT}":
case "[TITLE&UNIT]":
tlen = (token.Contains("COVERPROCTITLE")) ? (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength;
tlen = (token.Contains("COVERPROCTITLE"))?(int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength;
linelen = tlen * (float)pageItem.Font.CPI / 12;
plstr = SplitTitleAndUnit(svgGroup, pageItem, section.MyProcedure.MyContent.Text.ToUpper(), (int)linelen, token, plstr); //,rowAdj);
break;
@ -1978,7 +1971,7 @@ namespace Volian.Print.Library
case "[ATTACHTITLECONT]":
// B2020-038: incorrect pagination: Note that if PSOnlyFirst is active and pagination is set to continuous, pagination may be incorrect in printed output (no code change-just info here in case happens again)
bool printsectlevel = ((pageItem.Justify & VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) != VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) ||
(((pageItem.Justify & VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) == VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) && PrintedSectionPage == 0);
(((pageItem.Justify & VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) == VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) && PrintedSectionPage==0);
// if there is 'no title' for the section, only print it if a format flag says to print it.
if (printsectlevel)
{
@ -1992,7 +1985,7 @@ namespace Volian.Print.Library
&& token.Contains("ATTACHTITLECONT") && DidFirstPageDocStyle)
{
string myMsg = section.MyDocStyle.Continue.Top.Message;
if (myMsg != null && myMsg != string.Empty) stitle = stitle + myMsg;
if (myMsg != null && myMsg != string.Empty)stitle = stitle + myMsg;
}
// B2023-043: Beaver Valley AOP - allow attributes, such as superscript on section titles when printing
if (section.ActiveFormat.PlantFormat.FormatData.PrintData.SectionTitleWithAttributes)
@ -2219,7 +2212,7 @@ namespace Volian.Print.Library
// plants that have been delivered - so added special code for BGE.
if (section.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert)
{
if (Regex.IsMatch(procnum.Substring(0, 1), "[A-Za-z]"))
if (Regex.IsMatch(procnum.Substring(0,1),"[A-Za-z]"))
plstr = pd.ProcDescr1;
else
plstr = string.Empty;
@ -2275,12 +2268,12 @@ namespace Volian.Print.Library
plstr = plstr.Replace(token, thisDate2.ToString("H:mm"));
break;
case "{HLRNO}":
plstr = HLRNO == null ? string.Empty : plstr.Replace(token, HLRNO);
plstr = HLRNO==null?string.Empty:plstr.Replace(token, HLRNO);
break;
case "{HLSTAB}":
if (HLSTAB.Contains("{!Clock}")) // F2022-024 replace with the clock symbol defined in GenMac format file
{
HLSTAB = HLSTAB.Replace("{!Clock}", string.Empty).TrimStart(" ".ToCharArray());
HLSTAB = HLSTAB.Replace("{!Clock}",string.Empty).TrimStart(" ".ToCharArray());
svgGroup.Add(PageItemToSvgUse(pageItem, "Clock", supInfoMargAdj));
}
plstr = plstr.Replace(token, HLSTAB);
@ -2399,7 +2392,7 @@ namespace Volian.Print.Library
}
if (token.Contains(@"RO-"))
{
plstr = token.Replace("{", string.Empty).Replace("}", string.Empty);
plstr = token.Replace("{",string.Empty).Replace("}",string.Empty);
svgGroup.Add(PageItemToSvgText(pageItem, plstr, MySection, 0));
}
if (token.Contains(@"PS-"))
@ -2414,7 +2407,7 @@ namespace Volian.Print.Library
{
val = procConfig.GetValue("PSI", token.Substring(4, token.Length - 5));
// F2021-034: Resolve applicability unit tokens (not just '<u>')
if (val.ToUpper().Contains("<U>") || val.ToUpper().Contains("<U-")) // Replace token with the applicable unit information
if(val.ToUpper().Contains("<U>") || val.ToUpper().Contains("<U-")) // Replace token with the applicable unit information
{
string unbr3 = ResolveUnitApp(MySection.MyDocVersion, val);
val = unbr3 ?? string.Empty;
@ -2425,7 +2418,7 @@ namespace Volian.Print.Library
// in the TopMargin if the PSI text split onto more than one line.
if ((pageItem.MaxWidth ?? 0) > 0 || (pageItem.MaxWidthCurPage ?? 0) > 0)
{
int locwid = ((pageItem.MaxWidth ?? 0) > 0) ? (int)pageItem.MaxWidth : (int)pageItem.MaxWidthCurPage;
int locwid = ((pageItem.MaxWidth??0)>0)?(int)pageItem.MaxWidth:(int)pageItem.MaxWidthCurPage;
AdjustTopMarginForMultiLinePageListItems = SplitTextMaxWidth(svgGroup, pageItem, val, locwid, token, ref plstr);
if ((pageItem.MaxWidthCurPage ?? 0) > 0) AdjustTopMarginForMultiLinePageListItems = 0;
}
@ -2586,7 +2579,7 @@ namespace Volian.Print.Library
}
return Math.Max(0, yOffset);
}
private string SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr, int? numAndTitleLen)
private string SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr,int? numAndTitleLen)
{
bool includePrecedingText = false;
if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, string.Empty);
@ -2610,7 +2603,7 @@ namespace Volian.Print.Library
// B2022-061: don't print '\line' as part of procedure title in pagelist items.
if (match == "{PROCTITLE}") title = title.Replace("\\line ", string.Empty);
if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, string.Empty); // this would have been done in proctitle1
plstr = plstr.Replace(match, title).Replace("@@", string.Empty);
plstr = plstr.Replace(match, title).Replace("@@",string.Empty);
//svgGroup.Add(PageItemToSvgText(pageItem, title));
return plstr;
}
@ -2623,7 +2616,7 @@ namespace Volian.Print.Library
return string.Empty; // all resolved pagelist items were already added to svgGroup for printing.
}
// Otherwise determine how many line to split the text into
List<string> titleLines = Volian.Base.Library.RtfTools.SplitText(title, (includePrecedingText) ? (int)numAndTitleLen : (int)len);
List<string>titleLines = Volian.Base.Library.RtfTools.SplitText(title,(includePrecedingText)?(int)numAndTitleLen: (int)len);
// Adjust y location based on which pagelist token & how many lines. Proctitle1 is adjusted if
// there are more than 2 lines (proctitle1 should have it's own y location that is used if there are 1 or 2 lines.)
@ -2694,11 +2687,11 @@ namespace Volian.Print.Library
get { return _InitialsPrinted; }
set { _InitialsPrinted = value; }
}
public bool PrintInitials(PdfContentByte cb, float yLocation, float leftMargin)
public bool PrintInitials(PdfContentByte cb,float yLocation, float leftMargin)
{
if (InitialsPrinted) return false;
InitialsPrinted = true;
vlnParagraph.TextAt(cb, this, PIInitials ?? LastPIInitials, yLocation, leftMargin);
vlnParagraph.TextAt(cb,this, PIInitials ?? LastPIInitials, yLocation, leftMargin);
return true;
}
private void DoSpecialSectNumTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr)
@ -2787,7 +2780,7 @@ namespace Volian.Print.Library
}
// if the token was proctitle, dont' adjust. If the token was PROCTITLE1/2 then
// move down 6.
// int adj = pageItem.Token.Contains("1") || pageItem.Token.Contains("2") ? 0 : -6;
// int adj = pageItem.Token.Contains("1") || pageItem.Token.Contains("2") ? 0 : -6;
int adj = (titleLines.Count > 2) ? -6 : 0;
float yOffset = adj * (titleLines.Count - 2);
int lnCnt = 0;
@ -3050,10 +3043,10 @@ namespace Volian.Print.Library
|| (MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && Rev.Contains("\\")))
{
int indx = Rev.IndexOf(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/');
if (match.Value == "{REV}") return Rev.Substring(0, indx);
return Rev.Substring(indx + 1);
if (match.Value == "{REV}") return Rev.Substring(0,indx);
return Rev.Substring(indx+1);
}
if (match.Value == "{REV}") return Rev;
if (match.Value == "{REV}")return Rev;
return System.DateTime.Today.ToShortDateString();
case "{CHKOFFHEADING}":
return PageListTopCheckOffHeader;

View File

@ -785,7 +785,7 @@ namespace Volian.Print.Library
// Vertical Lines around HLS
//int countLine = (int)(this.Height / lpi);
yLocVertLine = yLocation + (lpi / 2);// -(lpi / 2);
yLocVertLine = yLocation + (lpi/2);// -(lpi / 2);
for (int i = 0; i < 1; i++)
{
Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin);
@ -962,7 +962,7 @@ namespace Volian.Print.Library
// B2018-033 Account for bottom continue message when seeing if a scrunched table will fit
float ySizeBtmCtnMess = GetBottomContinueMessageSize(MyItemInfo.MyDocStyle);
// B2018-085 Ignore the bottom continue message if the Table is the last part of the step.
if (ySizeBtmCtnMess > 0 && MyParent.MyItemInfo.IsHigh && YBottomMost == MyParent.YBottomMost) ySizeBtmCtnMess = 0;
if(ySizeBtmCtnMess > 0 && MyParent.MyItemInfo.IsHigh && YBottomMost == MyParent.YBottomMost) ySizeBtmCtnMess = 0;
// TableScrunch Phase 1: Is height of table greater than what will fit on current page.
if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase1) && heightBefore > (yLocation - (yBottomMargin + ySizeBtmCtnMess)))
{
@ -974,7 +974,7 @@ namespace Volian.Print.Library
MyPageHelper.TableAdjustment += (heightBefore - heightAfter);
MyPageHelper.AdjustedTable = this; // B2020-059 - save the information of the table that is being compressed (used in RTF2PDF.cs TextAt())
MyPageHelper.AdjustedTableYtop = yLocation; // B2020-059 save the top location of the compressed table (used in RTF2PDF.cs TextAt())
// B2018-092 Determine if the Table is too big by checking it including either 6 LPI or 7 LPI as appropriate
//B2018-092 Determine if the Table is too big by checking it including either 6 LPI or 7 LPI as appropriate
if (heightAfter * MyPageHelper.YMultiplier < (yLocation - yBottomMargin - ySizeBtmCtnMess))
{
// B2018-081 - Removed error log message if the code was able to properly adjust the table
@ -1008,7 +1008,7 @@ namespace Volian.Print.Library
MyPageHelper.BottomContent = yLocation - (MyGrid.Height + 4) * MyPageHelper.YMultiplier;
float retval = Rtf2Pdf.GridAt(cb, MyGrid, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless"));
//B2018-092 Determine if the Table is too big by checking it including either 6 LPI or 7 LPI as appropriate
if ((MyGrid.Height + 4) * MyPageHelper.YMultiplier > (yLocation - yBottomMargin - ySizeBtmCtnMess))
if ((MyGrid.Height + 4)* MyPageHelper.YMultiplier > (yLocation - yBottomMargin - ySizeBtmCtnMess))
{
// B2018-081 Changed the Error Log Message to be more useful when a table is too big.
_MyLog.ErrorFormat("\r\n===> Table is too big to fit on page, expect pagination problems in\r\n" +
@ -1017,7 +1017,7 @@ namespace Volian.Print.Library
" 3> Height Before={3:N2} Height After={4:N2} SpaceAvailable={5:N2}\r\n" +
" 4> ACTION REQUIRED: Table should be restructured or split over multiple pages",
MyItemInfo.ItemID, _MyItemInfo.ShortPath,
_MyItemInfo.SearchDVPath.Replace("\a", "/"), heightBefore / 72, MyGrid.Height / 72, (yTopMargin - yBottomMargin) / 72);
_MyItemInfo.SearchDVPath.Replace("\a", "/"), heightBefore/72, MyGrid.Height/72, (yTopMargin - yBottomMargin)/72);
//_MyLog.ErrorFormat("<<< ERROR >>> Table is too big to fit on page, expect pagination problems\r\n==>'Table Too Big',{0},'{1}','{2}',{3},{4},{5}" // RHM20150429 - Table Scrunch
// , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath, heightBefore, MyGrid.Height, (yTopMargin - yBottomMargin));
}
@ -1119,7 +1119,7 @@ namespace Volian.Print.Library
{
// B2018-034 The following code previously used IParagraph rather than _IParagraph. See first Comment
Chunk chk1 = _IParagraph.Chunks[0] as Chunk;
if (MyItemInfo.MyContent.Text.ToUpper().Contains("LINK:TR") && MyItemInfo.MyContent.ContentTransitionCount == 0)
if (MyItemInfo.MyContent.Text.ToUpper().Contains("LINK:TR") && MyItemInfo.MyContent.ContentTransitionCount==0)
Console.WriteLine("Missing Transition {0}", MyItemInfo.ItemID);
chk1.SetLocalDestination(string.Format("ItemID={0}", MyItemInfo.ItemID)); // Destination
// B2019-052: If multiple ROs/Transitions within a step, each should have a their own link rather than all linking to same thing.
@ -1349,8 +1349,8 @@ namespace Volian.Print.Library
}
// B2020-115 Limit the figure size to the space available in a page.
float mult = 1.0F;
if (Width > (vlnParagraph.wMax - 12)) mult = (vlnParagraph.wMax - 24) / Width;
if (Height > (vlnParagraph.hMax - 36)) mult = Math.Min(mult, (vlnParagraph.hMax - 36) / Height);
if (Width > (vlnParagraph.wMax-12)) mult = (vlnParagraph.wMax-24) / Width;
if (Height > (vlnParagraph.hMax-36)) mult = Math.Min(mult, (vlnParagraph.hMax-36) / Height);
if (mult < 1.0F)
{
Width = Width * mult;
@ -1468,7 +1468,7 @@ namespace Volian.Print.Library
// C2018-004 create meta file for baseline compares
// B2020-008: removed some code that was causing the header to not get refreshed, and uncommented
// out the ResetSvg command below.
Volian.Base.Library.BaselineMetaFile.WriteLine("Reset DocStyle to \"{0}\"", ds.Name);
Volian.Base.Library.BaselineMetaFile.WriteLine("Reset DocStyle to \"{0}\"",ds.Name);
MyItemInfo.ActiveSection.MyDocStyle = ds;
MyPageHelper.MySection = MyItemInfo.ActiveSection as SectionInfo;
MyPageHelper.MySection.MyDocStyle = ds;
@ -1574,7 +1574,7 @@ namespace Volian.Print.Library
SectionInfo parent = MyItemInfo.ActiveParent as SectionInfo;
bool hasSteps = false;
bool hasSections = false;
foreach (PartInfo pi in parent.MyContent.ContentParts)
foreach(PartInfo pi in parent.MyContent.ContentParts)
{
if (pi.FromType == (int)E_FromType.Step && parent.SectionConfig.SubSection_Edit == "Y") hasSteps = true;
if (pi.FromType == (int)E_FromType.Section) hasSections = true;
@ -1607,8 +1607,7 @@ namespace Volian.Print.Library
// if parent was continuous & this is separate, don't reset document style to subsection (next page) type
// this was putting incorrect pagelist item on parent section's page. This occurred in BGE/OI3 set/OI-7 procedure/10.0 Attachments.
// B2017-273 added a check for Farley format, we don't want the subsection pagelist infor to appear on the parent section page - works with Paginate() logic - (section has steps and a sub-section ex: FNP-2-EEP-0 Attachment 4)
// C2024-003 fixed a null exception bug by changing MyParent.MyItemInfo to MyItemInfo.MyParent.
if (!MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining && !MyItemInfo.ActiveFormat.Name.ToUpper().StartsWith("FNP") && (MyItemInfo.MyParent as SectionInfo).IsSeparatePagination() || !(MyItemInfo as SectionInfo).IsSeparatePagination())
if (!MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining && !MyItemInfo.ActiveFormat.Name.ToUpper().StartsWith("FNP") && (MyParent.MyItemInfo as SectionInfo).IsSeparatePagination() || !(MyItemInfo as SectionInfo).IsSeparatePagination())
{
MyPageHelper.MySection = MyItemInfo as SectionInfo;
MyPageHelper.ResetSvg();
@ -1766,10 +1765,10 @@ namespace Volian.Print.Library
{
// page break here, determine if there is caution/note above where the page break actually needs to go:
int aboveSupinfoId = ChildrenAboveHaveSupInfo();
if (supInfoSect != null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0 && aboveSupinfoId > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(aboveSupinfoId);
if (supInfoSect!=null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0 && aboveSupinfoId > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(aboveSupinfoId);
else if (supInfoSect != null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID);
else MyPromsPrinter.NeedSupInfoBreak = true;
if (supInfoSect != null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID);
if (supInfoSect!=null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID);
}
YTopMost = OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
docstyle = MyItemInfo.MyDocStyle;
@ -1877,9 +1876,9 @@ namespace Volian.Print.Library
case 2: // Break within a Step'
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks)
{
if (supInfoSect != null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID);
if (supInfoSect!=null&& MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID);
else MyPromsPrinter.NeedSupInfoBreak = true;
if (supInfoSect != null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID);
if (supInfoSect!=null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID);
}
YTopMost = OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
docstyle = MyItemInfo.MyDocStyle;
@ -1911,7 +1910,7 @@ namespace Volian.Print.Library
}
if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin);
// B2019-115 Locate Bottom Continue Message below AER Table if necesssary
float bcm_yLocation = TableBottom == -1 ? yLocation : Math.Min(TableBottom, yLocation);
float bcm_yLocation = TableBottom == -1 ? yLocation: Math.Min(TableBottom,yLocation);
DoBottomContinueMsg(cb, yBottomMargin, bcm_yLocation, docstyle, doThreeContinues);
MyPromsPrinter.NewPage();
// C2018-003 fixed use of getting the active section
@ -2037,7 +2036,7 @@ namespace Volian.Print.Library
PartsLeft.Add(vlnm);
MyPageHelper.AlarmYoffStart = alrmY - SixLinesPerInch;
yPageStart -= (4 * SixLinesPerInch);
if (ChildrenRight.Count > 0 && ChildrenRight[0].ChildrenAbove.Count > 0 && ChildrenRight[0].ChildrenAbove[0].MyItemInfo.IsCautionOrNotePart)
if(ChildrenRight.Count>0 && ChildrenRight[0].ChildrenAbove.Count > 0 && ChildrenRight[0].ChildrenAbove[0].MyItemInfo.IsCautionOrNotePart)
yPageStart += (SixLinesPerInch); // B2020-121: Account for Header on Caution or Note
}
// For Calvert Alarms, if there is no box & this is top of page, if previous step
@ -2073,17 +2072,17 @@ namespace Volian.Print.Library
case 3: // Break on High Level Step (SevenLinesPerInch)
if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks)
{
if (supInfoSect != null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID);
if (supInfoSect!=null && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID);
else MyPromsPrinter.NeedSupInfoBreak = true;
if (supInfoSect != null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID);
if(supInfoSect!=null) supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID);
}
if (!firstHighLevelStep || (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyPageHelper.CreatingSupInfoPage)) // B2017-229: Added supinfo print check to run facing page logic
{
YTopMost = OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin);
MyPromsPrinter.NewPage(); // HLS (7 lpi) breakif (MyItemInfo.IsSection)
// _MyLog.InfoFormat("NewPage 12 {0}", cb.PdfWriter.CurrentPageNumber);
// Console.WriteLine("'b3',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset);
//_MyLog.InfoFormat("NewPage 12 {0}", cb.PdfWriter.CurrentPageNumber);
//Console.WriteLine("'b3',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset);
ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
//Console.WriteLine("'a3',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset);
DebugText.WriteLine("Paginate3");
@ -2284,7 +2283,7 @@ namespace Volian.Print.Library
// B2017-201 if si is null we need to get it via the ItemID
if (si == null)
si = SectionInfo.Get(MyItemInfo.MyActiveSection.ItemID); // MyActiveSection does not try to resolve anything - ActiveSection is call above and will resolve and set MyActiveSection
bool _skipEndMessage = (si == null || si.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One) && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.EndForSingle;
bool _skipEndMessage = (si == null ||si.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One) && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.EndForSingle;
bool _lastSect = true;
if (si != null && si.MyActiveParent.IsSection) // is this meta/subsection. Only put end message out on last section
{
@ -2836,13 +2835,13 @@ namespace Volian.Print.Library
{
// Vogtle Alarms: Their alarms are set up differently than standard procedures - the HLS in Vogtle
// alarms is a section in other procedures. The top continue message is shown when a break occurs:
// • A continued message will appear on the top of the page ONLY if the pagination occurs anywhere
// • A continued message will appear on the top of the page ONLY if the pagination occurs anywhere
// within the first level substep. If, for example, the page break occurs between substep 3 and substep
// 4 as in example 2, no continued message will appear on the top of the page.
// • If a continued message is needed, the continued message will include the first level substep number
// if it is a sequential substep, such as “5. (continued)”. If it is NOT a sequential substep, then only
// the word “(continued)” will appear.
// • If a page break occurs between high level steps, such as before “Causes:”, then no continued message is needed.
// • If a continued message is needed, the continued message will include the first level substep number
// if it is a sequential substep, such as “5. (continued)”. If it is NOT a sequential substep, then only
// the word “(continued)” will appear.
// • If a page break occurs between high level steps, such as before “Causes:”, then no continued message is needed.
bool doMessage = true;
if (MyItemInfo.IsHigh) doMessage = false; // at high, don't do message
if (MyItemInfo.MyParent.IsHigh) doMessage = false; // at first level, don't do message
@ -2901,8 +2900,7 @@ namespace Volian.Print.Library
// CONDITION/RESPONSE table. Messages only get printed if the break is on a substep at steplevel > 2.
// see comments within code for what the tab contains, it varies depending on which side
// break occurred & how deep in the step the break occurred.
if (subTab != null && MyItemInfo.StepLevel > 2)
{
if (subTab != null && MyItemInfo.StepLevel > 2) {
bool incond = !MyItemInfo.IsInRNO;
float ybot = yTopMargin + (4 * SixLinesPerInch);
string concatrnoTab = ""; // constructed tab for Response side
@ -3036,7 +3034,7 @@ namespace Volian.Print.Library
case E_ContBottomLoc.EndOfText: // place continue string at end of text
// msg_yLocation accounts for extra lines in message from docstyle; and BottomContent is the actual
// location of the last line of text on page.
// msg_yLocation = ((float)(MyPageHelper.BottomContent??0) - (SixLinesPerInch * MyPageHelper.YMultiplier)); // B2018-080 null reference check added
//msg_yLocation = ((float)(MyPageHelper.BottomContent??0) - (SixLinesPerInch * MyPageHelper.YMultiplier)); // B2018-080 null reference check added
// B2019-079 changed yLocaton - msg_yLocation to '+'. The msg_ylocation has an adjustment for adding an extra line by moving down the page, this was moving
// the line up the page (double negative).
msg_yLocation = yLocation + msg_yLocation - (SixLinesPerInch * MyPageHelper.YMultiplier); //B2019-021 yLocation accounts for checkoffs
@ -3056,7 +3054,7 @@ namespace Volian.Print.Library
msg_yLocation = Math.Max(msg_yLocation, yBottomMargin + SixLinesPerInch);
break;
case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page
// msg_yLocation = yBottomMargin + 2 * SixLinesPerInch + (float)docstyle.Layout.FooterLength; // 2 lines above bottom margin
//msg_yLocation = yBottomMargin + 2 * SixLinesPerInch + (float)docstyle.Layout.FooterLength; // 2 lines above bottom margin
msg_yLocation = msg_yLocation + yBtmMarginForMsg + (float)docstyle.Layout.FooterLength;
// if (MyPageHelper.YMultiplier != 1.0F) msg_yLocation = msg_yLocation / MyPageHelper.YMultiplier;
break;
@ -3279,10 +3277,10 @@ namespace Volian.Print.Library
{
vPara.ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
// B2019-115 Locate Bottom Continue Message below AER Table if necessary
if (vPara.MyItemInfo.IsTable)
if(vPara.MyItemInfo.IsTable)
{
if (TableBottom == -1)
TableBottom = (yPageStart - vPara.YOffset) - vPara.Height - SixLinesPerInch;
TableBottom = (yPageStart-vPara.YOffset)-vPara.Height- SixLinesPerInch;
else
TableBottom = Math.Min(TableBottom, (yPageStart - vPara.YOffset) - vPara.Height - SixLinesPerInch);
}
@ -4000,7 +3998,7 @@ namespace Volian.Print.Library
if (YOffset != 0 && MyItemInfo.FormatStepData != null &&
MyItemInfo.MyPrevious == null && MyItemInfo.FormatStepData.ThreeBlanksAbove && (!MyItemInfo.IsNote || MyItemInfo.MyParent.Cautions == null))
addExtraSpace = 24; // already has one blank line above, added two more
// if (YOffset != 0 && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace > 0)
//if (YOffset != 0 && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace > 0)
// addExtraSpace = (float)MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace;
// if this plant has the AlwaysUseExtraLines and there are notes/cautions above the hls, don't add in the
// extra space:
@ -4493,8 +4491,8 @@ namespace Volian.Print.Library
//B2020-160 use YTopMost instead of Yoffset if there are children above.
// Get the minimun value between the AER and RNO YtopMost.
// example. Calvert AOP-7E/XIII/Step A5.h Unit 2 Approved set
// B2021-027 use YOffset if there isn't any children above (AER).
// example: Catawba Unit 1 AP's; AP/1/A/5500/050; Enclosure 8 step 1
//B2021-027 use YOffset if there isn't any children above (AER).
// example: Catawba Unit 1 APs; AP/1/A/5500/050; Enclosure 8 step 1
if (ChildrenAbove.Count == 0)
YTopMost = ChildrenRight[0].ChildrenAbove[0].YOffset; //B2021-027
else
@ -4521,7 +4519,7 @@ namespace Volian.Print.Library
}
// B2023-008: when an equation is off a paragraph sub-step in single column mode, extra lines were added so
// when in single column mode & the substep has an equation (rtfraw), then don't reset yoffright to yverybottom
bool rtfRawInSingleCol = (itemInfo.ColumnMode == ((int)VEPROMS.CSLA.Library.SectionConfig.SectionColumnMode.One - 1)) && (itemInfo.Tables != null && itemInfo.Tables.Count > 0 && itemInfo.Tables[0].IsRtfRaw);
bool rtfRawInSingleCol = (itemInfo.ColumnMode == ((int)VEPROMS.CSLA.Library.SectionConfig.SectionColumnMode.One-1)) && (itemInfo.Tables != null && itemInfo.Tables.Count > 0 && itemInfo.Tables[0].IsRtfRaw);
if (yOffRight < yoffRightParent) yOffRight = yoffRightParent;
// find the very bottom Yoffset (don't do this is in single column mode for cautions/notes: B2016-261)
vlnParagraph parentPar = parent;
@ -5224,11 +5222,11 @@ namespace Volian.Print.Library
// Get SectionInfos to access specific section config items...
//SectionInfo si = SectionInfo.Get(mySectionInfo.ItemID);
SectionInfo si = (mySectionInfo != null) ? mySectionInfo.GetSectionInfo() : null;
SectionInfo si = (mySectionInfo != null)? mySectionInfo.GetSectionInfo() : null;
int sindx = si.CheckOffHeadingIndex();
//SectionInfo subi = mySubSectionInfo == null ? null : SectionInfo.Get(mySubSectionInfo.ItemID);
SectionInfo subi = (mySubSectionInfo == null) ? null : mySubSectionInfo.GetSectionInfo();
int subindx = (subi == null) ? -1 : subi.CheckOffHeadingIndex();
SectionInfo subi = (mySubSectionInfo == null)? null : mySubSectionInfo.GetSectionInfo();
int subindx = (subi == null)? -1 : subi.CheckOffHeadingIndex();
// if there is no subsections & the main section doesn't use a header OR
// if there is a subsection, & it does not use a header... Return.
@ -5261,7 +5259,7 @@ namespace Volian.Print.Library
}
// grab the string from the format, depending on whether it should get it from the section or subsection.
string cohead = (mySubSectionInfo != null) ? mySubSectionInfo.SectionCheckOffHeader : (mySectionInfo != null) ? mySectionInfo.SectionCheckOffHeader : null;
string cohead = (mySubSectionInfo != null) ? mySubSectionInfo.SectionCheckOffHeader : (mySectionInfo != null)? mySectionInfo.SectionCheckOffHeader : null;
if (cohead == "" || cohead == null) return;
// PageListCheckOffHeader is an svgtext - but really we only need the x/y location for this (pagelist support)
@ -5337,7 +5335,7 @@ namespace Volian.Print.Library
if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
ctrCalvertAlarmTbl = MyItemInfo.IsWithInSingleColumnTemplate();
// B2019-049 added check for table being in a Caution or Note - if so, use the single column setting for the format variable TableCenterPos
float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[(itemInfo.IsInCautionOrNote) ? 0 : itemInfo.ColumnMode]);
float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[(itemInfo.IsInCautionOrNote)?0:itemInfo.ColumnMode]);
if (ctrCalvertAlarmTbl || formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel)
XOffset = leftMargin + (pageWidth - leftMargin - (scale * Width)) / 2;
else
@ -5514,7 +5512,7 @@ namespace Volian.Print.Library
List<Macro> myMacros = itemInfo.MyMacros;
if (myMacros != null)
{
int colMode = (MyItemInfo.ActiveSection != null) ? MyItemInfo.ActiveSection.ColumnMode : 0; // C2018-003 fixed use of getting the active section
int colMode = (MyItemInfo.ActiveSection != null)? MyItemInfo.ActiveSection.ColumnMode : 0; // C2018-003 fixed use of getting the active section
foreach (Macro myMacro in myMacros)
{
// if the format has the 'LocWithXOff' locate the macro along with the tab's offset.
@ -5648,7 +5646,7 @@ namespace Volian.Print.Library
// if this is a caution or note, put the change bar to the right of the text:
//if ((paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) && fixedChgCol < -10) return -fixedChgCol;
if ((fixedChgCol == 0))// && paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote)
// if ((fixedChgCol==0) || paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote)
//if ((fixedChgCol==0) || paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote)
{
float rightEdge = (paragraph.XOffset + paragraph.Width + 5);
rightEdge -= (float)paragraph.MyItemInfo.MyDocStyle.Layout.LeftMargin;
@ -6088,7 +6086,7 @@ namespace Volian.Print.Library
{
myTab.XOffset = XOffset - ((myTab == null) ? 0 : myTab.Width) - 12;
// B2017-253 - Limit the tab offset to 2 points inside the left margin
myTab.XOffset = Math.Max(myTab.XOffset, itemInfo.MyDocStyle.Layout.LeftMargin ?? 72) + 2;
myTab.XOffset = Math.Max(myTab.XOffset,itemInfo.MyDocStyle.Layout.LeftMargin ?? 72)+2;
float mytbwidth = myTab.Width;
myTab.Width = 2.5f * myTab.Width;
// C2018-022: adjust xoffset of text by 12 if the tab would overwrite the text and the format flag is on:
@ -6177,7 +6175,7 @@ namespace Volian.Print.Library
}
XOffset += (itemInfo.FormatStepData.Font.CharsToTwips * adj); // indent 2 characters for background steps
// B2018-146 Adjust the width to match the HLS Right Margin.
// if (itemInfo.ActiveFormat.Name.StartsWith("WCN")) -- Not needed since IsBackgroundStep
//if (itemInfo.ActiveFormat.Name.StartsWith("WCN")) -- Not needed since IsBackgroundStep
Width = this.MyHighLevelParagraph.Width + this.MyHighLevelParagraph.XOffset - this.XOffset;
//else
// Width -= (itemInfo.FormatStepData.Font.CharsToTwips * adj); // Adjust width by 2 characters
@ -6197,7 +6195,7 @@ namespace Volian.Print.Library
else
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
// B2018-146 Adjust the width to match the HLS Right Margin.
if (itemInfo.IsPartOfBackgroundStep())
if(itemInfo.IsPartOfBackgroundStep())
//if(itemInfo.ActiveFormat.Name.StartsWith("WCN"))
Width = this.MyHighLevelParagraph.Width + this.MyHighLevelParagraph.XOffset - this.XOffset;
return;
@ -7214,12 +7212,10 @@ namespace Volian.Print.Library
public int StepLevel
{
get { return _StepLevel; }
set
{
set {
//if (MyParagraph.MyItemInfo.InList(97960,84472,91010))
// Console.WriteLine("stop");
_StepLevel = value;
}
_StepLevel = value; }
}
private vlnParagraph _MyParagraph;
public vlnParagraph MyParagraph