From ba036e23ffabde124e04b2b038dbd90fb52f9a7d Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 26 May 2015 16:16:04 +0000 Subject: [PATCH] B2015-066: Last update for page number transitions was not correct. This fixes problem. (Note that last checkin listed incorrect bug number) --- .../Extension/TransitionExt.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs index d1088f78..ac19bf9f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs @@ -778,15 +778,22 @@ namespace VEPROMS.CSLA.Library return "Invalid Transition Destination"; TransitionBuilder tb = SetupTransitionBuilder(formatInfo, fromInfo, tranType, toItem, toItem.ItemID==rangeItem.ItemID && !toItem.IsHigh?toItem.LastSibling:rangeItem); - if (pagenum && (tranType==1||tranType==2||tranType==4) && !tb._TransFormat.Contains("{Page Num}")) + + if (pagenum) { - // if range transition, the page number token needs to go after the first step, else it's at the end: - if (tranType == 2 && tb._TransFormat.Contains("{First Step")) + // The tranType parameter is really the index. For page number transitions, get the transition + // type (holdover from 16bit, used to define whether transitions are range) for range transitions, the page number goes after the 1st step. + int strantype = tranType < tb._FromItem.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList.Count ? (int)tb._FromItem.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tranType].Type : 0; + if ((strantype == 1 || strantype == 2 || strantype == 4) && !tb._TransFormat.Contains("{Page Num}")) { - tb._TransFormat = tb._TransFormat.Insert(tb._TransFormat.IndexOf("{First Step}")+12, " {Page Num}"); + // if range transition, the page number token needs to go after the first step, else it's at the end: + if (strantype == 2 && tb._TransFormat.Contains("{First Step")) + { + tb._TransFormat = tb._TransFormat.Insert(tb._TransFormat.IndexOf("{First Step}") + 12, " {Page Num}"); + } + else + tb._TransFormat = tb._TransFormat + " {Page Num}"; } - else - tb._TransFormat = tb._TransFormat + " {Page Num}"; } if(_AppendMethods==null) SetupMethods();