This commit is contained in:
2013-04-17 12:31:14 +00:00
parent bc923f77a0
commit f0d9003d0d
15 changed files with 134 additions and 76 deletions

View File

@@ -728,7 +728,7 @@ namespace Volian.Print.Library
int eindx = token.IndexOf("}", bindx);
val = token.Substring(bindx + 1, eindx - bindx - 1);
}
if (val != null && val != "") PgLogicals.Add(pstok, val != null);
if (val != null && val != "" && !PgLogicals.ContainsKey(pstok)) PgLogicals.Add(pstok, val != null);
//if (val == null || val == "")
//val = " ";
if (val == null)

View File

@@ -31,7 +31,7 @@ namespace Volian.Print.Library
int fontStyle = (MyFont.WindowsFont.Bold ? iTextSharp.text.Font.BOLD : 0) + (MyFont.WindowsFont.Italic ? iTextSharp.text.Font.ITALIC : 0);
iTextSharp.text.Font itextFont = Volian.Svg.Library.Svg.GetFont(fontFace, MyFont.WindowsFont.Size, fontStyle, System.Drawing.Color.Black);
float hdrwidth = itextFont.BaseFont.GetWidthPoint(Text, MyFont.WindowsFont.Size);
hdrwidth += 1;
hdrwidth += 5;
float yLocation = CalculateYOffset(yPageStart, yTopMargin);
Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, hdrwidth, 100, "", yBottomMargin);
return yPageStart;

View File

@@ -143,8 +143,8 @@ namespace Volian.Print.Library
Processed = true;
if (_PartsAbove != null && _PartsAbove.Count > 0) yPageStart = PartsAbove.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
if (MyItemInfo.IsHigh && MyItemInfo.MyDocStyle.SpecialStepsFoldout) yPageStart -= SixLinesPerInch;
//SHE if (MyItemInfo.IsHigh && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.DoSTExtraAtTop && (yPageStart - YTopMost == yTopMargin))
//SHE yPageStart += ((MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0);
if (MyItemInfo.IsHigh && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.DoSTExtraAtTop && (yPageStart - YTopMost == yTopMargin))
yPageStart += ((MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0);
float yLocation = CalculateYOffset(yPageStart, yTopMargin);
if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess);
float retval = yLocation;
@@ -1035,14 +1035,6 @@ namespace Volian.Print.Library
mytab.XOffset += mytab.Width;
XOffset = mytab.XOffset + mytab.Width;
}
//SHE if this is the High Level RNO step (MyTopRNO) and we are numbering the RNO, adjust the xoffset to
//SHE include the HLS tab size.
//SHEif (!itemInfo.IsSection && itemInfo.FormatStepData.NumberHighLevel && itemInfo.IsRNOPart && itemInfo.ItemID == MyTopRNO.MyItemInfo.ItemID)
//SHE{
//SHE float tadj = itemInfo.MyHLS.FormatStepData.TabData.RNOIdentPrint == null || itemInfo.MyHLS.FormatStepData.TabData.RNOIdentPrint == "" ? mytab.Text.Length * 6 : (itemInfo.MyHLS.FormatStepData.TabData.RNOIdentPrint.Length * 6);
//SHE mytab.XOffset += tadj;
//SHE XOffset = mytab.XOffset + (tadj + 6); // had to do this to get it to match 16 bit for SHE.
//SHE}
AdjustWidth(itemInfo, maxRNO, formatInfo, mytab);
AdjustXOffsetForTab(itemInfo, maxRNO, formatInfo, mytab, xMetaAdj);
if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && !doSectTab)
@@ -1081,6 +1073,12 @@ namespace Volian.Print.Library
myBullet.Rtf = myBullet.Rtf.Replace("\u25CF", @"\f1\u9679?\f0 ");
PartsLeft.Add(myBullet);
}
if (itemInfo.MyTab.AsteriskOffset != 0)
{
// the '-24' was used for the SHE format to get the continuous HLS's asterisk to match 16bit.
vlnText myAsterisk = new vlnText(cb, this, "*", "*", mytab.XOffset - 24, YOffset, MyItemInfo.FormatStepData.TabData.Font);
PartsLeft.Add(myAsterisk);
}
if (itemInfo.IsRNOPart)
{
// there may be other places that double space, but this supports it for RNOs (the DoubleRNOspace flag)
@@ -1106,7 +1104,7 @@ namespace Volian.Print.Library
if (dropCheckoff)
yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text
yoff += (Height + (2 * SixLinesPerInch));
CalculateXOffset(itemInfo, maxRNO, formatInfo);
CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo);
yoff = (float)Math.Ceiling(yoff); // RHM 20120925 - Make sure that yOff is an integer value after a grid
}
else if (itemInfo.IsFigure) // if a figure we've got to determine the size:
@@ -1159,7 +1157,7 @@ namespace Volian.Print.Library
}
}
if (erMsg != null) Rtf = GetRtf(erMsg, itemInfo.ActiveFormat.PlantFormat.FormatData.Font);
CalculateXOffset(itemInfo, maxRNO, formatInfo);
CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo);
}
}
else
@@ -1196,7 +1194,7 @@ namespace Volian.Print.Library
if (itemInfo.IsTablePart) // Not for grid, this is for old-style tables.
{
Width = GetTableWidth(cb, IParagraph, MyItemInfo.MyDocStyle.Layout.PageWidth);
CalculateXOffset(itemInfo, maxRNO, formatInfo);
CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo);
}
else
if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0);
@@ -1252,17 +1250,10 @@ namespace Volian.Print.Library
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.SkipSpaces)
{
if (mytab != null)
{
int cntspac = 0;
xloc_co = mytab.XOffset;
// SHE commented out next two lines - may need to control this by format flag
for (int c = 0; c < itemInfo.MyTab.CleanText.Length; c++) if (itemInfo.MyTab.CleanText[c] == ' ') cntspac++;
xloc_co = xloc_co - (cntspac * 6);
}
//SHE else
//SHE xloc_co = XOffset; //there's no tab - put checkoff at step's xoff. Macro should back up from step's x.
else
xloc_co = XOffset; //there's no tab - put checkoff at step's xoff. Macro should back up from step's x.
}
PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff, co.Macro));
}
float yOffRight = yoff;
@@ -1299,7 +1290,6 @@ namespace Volian.Print.Library
SectionConfig sc = itemInfo.MyConfig as SectionConfig;
if (sc != null && sc.SubSection_Edit != "Y") printsteps = false;
}
if (itemInfo.Steps != null && printsteps) yoff = ChildrenBelow.Add(cb, itemInfo.Steps, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo);
if (itemInfo.Sections != null) yoff = ChildrenBelow.Add(cb, itemInfo.Sections, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
if (itemInfo.Procedures != null) yoff = ChildrenBelow.Add(cb, itemInfo.Procedures, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
@@ -1496,14 +1486,13 @@ namespace Volian.Print.Library
return bottomChild;
}
}
private void CalculateXOffset(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo)
private void CalculateXOffsetGridOrFigure(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo)
{
bool aerTableOrFigure = itemInfo.FormatStepData.Type.Contains("AER");
vlnParagraph hls1 = MyParent;
while (hls1.MyParent != null && !hls1.MyItemInfo.IsHigh) hls1 = hls1.MyParent;
float colR = float.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]);
//SHE float xLowerLimit = hls1.PartsLeft != null && hls1.PartsLeft.Count > 0 ? hls1.PartsLeft[0].XOffset : hls1.XOffset;
float xLowerLimit = hls1.XOffset;
float xLowerLimit = hls1.PartsLeft != null && hls1.PartsLeft.Count > 0 ? hls1.PartsLeft[0].XOffset : hls1.XOffset;
float xUpperLimit = hls1.XOffset + hls1.Width + colR * itemInfo.ColumnMode;
float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[itemInfo.ColumnMode]);
if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel)
@@ -2069,6 +2058,14 @@ namespace Volian.Print.Library
XOffset -= (itemInfo.MyTab.Offset - hls.MyTab.Offset);
}
}
// if the step is within the rno and we're numbering the high level rno, we've got to account for the
// indenting (increased x offset) for the top level rno's tab, if there is no top level rno:
if (itemInfo.FormatStepData.NumberHighLevel && (itemInfo.MyHLS.RNOs == null || itemInfo.MyHLS.RNOs.Count<=0))
{
// add in the size that an RNO off HLS would take.
XOffset += tabWidth;
if (myTab != null) myTab.XOffset += tabWidth;
}
}
else if (MyParent != null)
{
@@ -2122,7 +2119,7 @@ namespace Volian.Print.Library
widOvrd = xwid;
else
widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride;
if (itemInfo.IsRNOPart && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt != null)
if (itemInfo.IsRNOPart && itemInfo.MyParent.IsHigh && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt != null)
{
string[] splitRNOWidthAlt = itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt.Split(',');
float ovrd = (itemInfo.RNOLevel < splitRNOWidthAlt.Length) ? float.Parse(splitRNOWidthAlt[itemInfo.RNOLevel]) : 0;

View File

@@ -130,25 +130,13 @@ namespace Volian.Print.Library
Width = (float)myparent.MyItemInfo.FormatStepData.TabData.IdentWidth;
else if (CCCs != IIIs)
{
if (myparent.MyItemInfo.ActiveFormat.Name.ToUpper().Contains("WST")) // Temporary for WST development. need better way to do this check
{
Width = 6.8f * origTab.Length;
}
else if (myparent.MyItemInfo.ActiveFormat.Name.ToUpper().Contains("SHE")) // Temporary for SHE development. need better way to do this check
{
if (myparent.MyItemInfo.IsHigh)
Width = 6 * origTab.Length;
else
Width = GetTextWidth(MyFont, (Text != null ? Text : origTab), symblFontName); //MyFont.CharsToTwips * (Text != null ? Text.Length : origTab.Length);
}
else
{
origTab1 = origTab1.TrimStart(" ".ToCharArray());
// 6 = number of points per character. 4 characters between end of tab and beginning of text
// origTab1.Trim... is number of non-space characters of the tab string.
// Tested for FPL & NSP
Width = 6 * (4 + origTab1.Trim(" ".ToCharArray()).Length);
}
float tPtPerChar = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar ?? 6;
Width = tPtPerChar * origTab.Length;
// Check the following, it may be needed for FPL:
//origTab1 = origTab1.TrimStart(" ".ToCharArray());
// 6 = number of points per character. 4 characters between end of tab and beginning of text
// origTab1.Trim... is number of non-space characters of the tab string.
//Width = 6 * (4 + origTab1.Trim(" ".ToCharArray()).Length);
}
else
Width = GetTextWidth(MyFont, (Text != null ? Text : origTab), symblFontName); //MyFont.CharsToTwips * (Text != null ? Text.Length : origTab.Length);
@@ -168,11 +156,9 @@ namespace Volian.Print.Library
cleanTab = origTab;
if (CCCs != IIIs)
{
if (myparent.MyItemInfo.ActiveFormat.Name.ToUpper().Contains("WST")) // Temporary for WST development. need better way to do this check
{
Width = 6.8f * origTab.Length;
}
float? tPtPerChar1 = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar;
if (tPtPerChar1!=null)
Width = (float)tPtPerChar1 * origTab.Length;
else
{
origTab = origTab + " ";