diff --git a/PROMS/Formats/fmtall/SUMall.xml b/PROMS/Formats/fmtall/SUMall.xml index 907e1d9d..2519a3fa 100644 Binary files a/PROMS/Formats/fmtall/SUMall.xml and b/PROMS/Formats/fmtall/SUMall.xml differ diff --git a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs index e6a9abc4..07fa6aa3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs @@ -508,6 +508,18 @@ namespace VEPROMS.CSLA.Library } } #endregion + #region CenterToStepThenPage + [Category("Layout")] + [Description("CenterToStepThenPage")] + private LazyLoad _CenterToStepThenPage; + public bool CenterToStepThenPage + { + get + { + return LazyLoad(ref _CenterToStepThenPage, "@CenterToStepThenPage"); + } + } + #endregion } #endregion #region SectTop diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index d2a28446..035c688c 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -4058,18 +4058,31 @@ namespace Volian.Print.Library XOffset = hls1.XOffset + hls1.Width - Width; // align with the right edge of hls text } } + if (itemInfo.MyDocStyle.Layout.CenterToStepThenPage) + { + if (Width > hls1.Width) + { + float XOffsetPage = leftMargin + ((pageWidth - leftMargin) - Width) / 2; + float fraction = (Width - hls1.Width) / ((pageWidth - leftMargin) - hls1.Width); + float XOffsetNew = (1 - fraction) * XOffset + fraction * XOffsetPage; + _MyLog.WarnFormat("***XOffsetAdjust-CenterToStepThenPage*** ItemID, XOffset, XOffsetPage, XOffsetNew ={0},{1},{2},{3}", itemInfo.ItemID, XOffset, XOffsetPage, XOffsetNew); + XOffset = XOffsetNew; + } + } + else + { + // if the XOffset < High Level Step Text's XOffset , then align with the High Level Step Text + if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit)) + XOffset = xLowerLimit; - // if the XOffset < High Level Step Text's XOffset , then align with the High Level Step Text - if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit)) - XOffset = xLowerLimit; + // if the right margin exceeds the right edge of the rightmost RNO, then adjust right edge to match. + if (XOffset + Width > xUpperLimit) + XOffset = xUpperLimit - Width; - // if the right margin exceeds the right edge of the rightmost RNO, then adjust right edge to match. - if (XOffset + Width > xUpperLimit) - XOffset = xUpperLimit - Width; - - // because of the above, if it pushes beyond the left margin, use the left margin. - if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin) - XOffset = XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin; + // because of the above, if it pushes beyond the left margin, use the left margin. + if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin) + XOffset = XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin; + } } private float AdjustForBlankLines() {