Compare commits

..

No commits in common. "72457d956e5ec82d607e93c575477be703e66b9c" and "dcfdf5f85245ba1e78d648f1474bceb8ee70ca50" have entirely different histories.

7 changed files with 125 additions and 133 deletions

View File

@ -59,8 +59,6 @@ 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
{

View File

@ -91,8 +91,6 @@ 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
{

View File

@ -1197,17 +1197,17 @@ 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.
int[] _prtSectID = new int[3];
if (si2.IsSubsection == true)
{
// If section is a subsection. Assigned values are section and subsection.
// If section is a 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.
// If section is a regular section
_prtSectID[0] = si2.ItemID; // section
_prtSectID[1] = -1; // sub section
_prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag
@ -1221,7 +1221,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

@ -179,8 +179,6 @@ 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
{
@ -343,7 +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>();
@ -352,7 +349,16 @@ namespace Volian.Print.Library
_DidAll = didAll;
_MergeNotIncluded = false;
_MergedPdf = mergedPdf;
//if(Convert.ToBoolean(PrtSectID[0]))
// {
// }
// else
// {
// }
//_prtSectID = PrtSectID;
//_MyReaderHelper.LoadTree(myItem);
}
// Pass 1 PDF Name
private string _BeforePageNumberPdf = null;
@ -375,7 +381,7 @@ namespace Volian.Print.Library
{
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,18 +813,18 @@ 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.
SectionInfo CurSection = null;
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
foreach (SectionInfo subsi in si2.Sections)
{
if (subsi.ItemID == PrtSectID[1]) // Find sub section
if (subsi.ItemID == PrtSectID[1])
{
CurSection = subsi; // Assign the subsection object to CurSection.
CurSection = subsi;
}
}
}
@ -827,12 +833,12 @@ namespace Volian.Print.Library
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[0] == -1 || (PrtSectID[0] > -1 && mySection.ItemID == PrtSectID[0]))
{
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 (!Convert.ToBoolean(PrtSectID[2])) // If section is not a Sub Section assign the iteration variable to CurSection
{
CurSection = mySection; // if section is not a sub section.
CurSection = mySection;
}
if (!CurSection.MyDocStyle.IsStepSection && !CurSection.IsAutoTOCSection)
@ -977,19 +983,18 @@ 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
SectionInfo CurSection = null;
if (Convert.ToBoolean(PrtSectID[2]))
{
foreach (SectionInfo si2 in myProcedure.Sections) // Find parent section.
foreach (SectionInfo si2 in myProcedure.Sections)
{
if (si2.ItemID == PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find selected sub section.
foreach (SectionInfo subsi in si2.Sections)
{
if (subsi.ItemID == PrtSectID[1])
{
CurSection = subsi; // Assign sub section object to CurSection.
CurSection = subsi;
}
}
}
@ -1631,19 +1636,18 @@ 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.
SectionInfo CurSection = null;
if (Convert.ToBoolean(PrtSectID[2]))
{
foreach (SectionInfo si2 in ii.Sections) // Find parent section.
foreach (SectionInfo si2 in ii.Sections)
{
if (si2.ItemID == PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find sub section.
foreach (SectionInfo subsi in si2.Sections)
{
if (subsi.ItemID == PrtSectID[1])
{
CurSection = subsi; // Assigned sub section object to CurSection.
CurSection = subsi;
}
}
}
@ -3015,19 +3019,18 @@ 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.
SectionInfo SubSection = null;
if (Convert.ToBoolean(MyPromsPrinter.PrtSectID[2])) // If section is a sub section
{
foreach (SectionInfo si2 in ii.Sections) // Find parent section
foreach (SectionInfo si2 in ii.Sections)
{
if (si2.ItemID == MyPromsPrinter.PrtSectID[0])
{
foreach (SectionInfo subsi in si2.Sections) // Find sub section.
foreach (SectionInfo subsi in si2.Sections)
{
if (subsi.ItemID == MyPromsPrinter.PrtSectID[1])
if (subsi.ItemID == MyPromsPrinter.PrtSectID[0])
{
CurSection = subsi; // Assign sub section object to CurSection.
break;
SubSection = subsi;
}
}
}
@ -3037,17 +3040,13 @@ namespace Volian.Print.Library
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 (si.IsStepSection)
{
CurSection = si;
}
if (CurSection.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 +3055,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,7 +3076,7 @@ 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);
}
}
}

View File

@ -85,8 +85,6 @@ 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
{

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Text;
//using System.Drawing;
@ -7272,4 +7272,3 @@ namespace Volian.Print.Library
}
}
}