B2020-043: After insert of step above, resolved transition text was incorrect if tab had step number

This commit is contained in:
2020-04-02 12:58:12 +00:00
parent 9bea938777
commit bdd1b054a4
3 changed files with 21 additions and 13 deletions

View File

@@ -1358,7 +1358,8 @@ namespace VEPROMS.CSLA.Library
// the addition of the parent.IsNote, the note was breaking between 2 ANDs (the 1st AND was a
// steplevel of 5, but the 2nd was a steplevel of 4). If something similar is seen with Cautions,
// that check could be added.
if (!item.IsRNOPart && !item.IsHigh && (item.MyPrevious == null || (((item.ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.EnhancedBackgrounds) != E_PurchaseOptions.EnhancedBackgrounds) && item.MyParent.IsNote)))
if (!item.IsRNOPart && !item.IsHigh && (item.MyPrevious == null || (((item.ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.EnhancedBackgrounds) != E_PurchaseOptions.EnhancedBackgrounds)
&& item.MyParent != null && item.MyParent.IsNote)))
level += firstInc;
else
firstInc = 0;
@@ -3866,14 +3867,14 @@ namespace VEPROMS.CSLA.Library
{
if (IsStep)
{
_MyTab = new Tab(AdjustForTextSubFollowsTextStyle(FormatStepData.TabData.Font));
MyTab = new Tab(AdjustForTextSubFollowsTextStyle(FormatStepData.TabData.Font));
_MyHeader = new MetaTag(FormatStepData.TabData.Font);
_MyFooter = new MetaTag(FormatStepData.TabData.Font);
SetTabText();
}
else
{
_MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.Font);
MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.Font);
_MyHeader = null;
_MyFooter = null;
_MyTab.CleanText = DisplayNumber;
@@ -5400,7 +5401,7 @@ namespace VEPROMS.CSLA.Library
public string Text
{
get { return _Text; }
set { _Text = value; }
set { _Text = value; }
}
public string CleanText; // all tokens removed
public MetaTag()
@@ -7533,7 +7534,7 @@ namespace VEPROMS.CSLA.Library
//private int? _TemplateColumnMode
public override void SetupTags()
{
_MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Font);
MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Font);
string sectTab = GetSectionTab(false);
_MyTab.Text = sectTab;
_MyTab.CleanText = sectTab.PadRight(20);
@@ -7779,7 +7780,7 @@ namespace VEPROMS.CSLA.Library
// B2016-160 Support transitions to sections
VE_Font fnt = new VE_Font("Arial", 10, E_Style.None, 10);
if (FormatStepData != null) fnt = FormatStepData.TabData.Font;
_MyTab = new Tab(AdjustForTextSubFollowsTextStyle(fnt));
MyTab = new Tab(AdjustForTextSubFollowsTextStyle(fnt));
MyHeader = new MetaTag(fnt);
MyFooter = new MetaTag(fnt);
SetTabText();

View File

@@ -352,7 +352,7 @@ namespace VEPROMS.CSLA.Library
// Refresh ItemInfo to update Previous
using (Item item = Get()) ItemInfo.Refresh(item);
// Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item
tmp.UpdateTransitionText();
tmp.ResetOrdinal(); // B2020-043: Fix transition text (was updatetransitiontext)
tmp.UpdateROText();
OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before));
((ItemInfo)ActiveParent).MyContent.RefreshContentParts();
@@ -2173,6 +2173,7 @@ namespace VEPROMS.CSLA.Library
public void ResetOrdinal()
{
ResetOrdinal(ItemID);
Application.DoEvents(); // B2020-043: Fix transition text
}
public static void DeleteItemInfoAndChildren(int itemID)
{
@@ -2320,10 +2321,6 @@ namespace VEPROMS.CSLA.Library
nextItem.RefreshItemParts();
//nextItem.ResetOrdinal(); - UpdateTransitionText calls ResetOrdinal
//_MyTimer.ActiveProcess = "UpdateTransitionText";
if(prevItem != null)
prevItem.UpdateTransitionText();
else
nextItem.UpdateTransitionText();
}
else if (prevItem != null)
{
@@ -2332,10 +2329,14 @@ namespace VEPROMS.CSLA.Library
//_MyTimer.ActiveProcess = "ResetOrdinal";
if (prevItem.IsCaution || prevItem.IsNote) prevItem.ResetOrdinal();
//_MyTimer.ActiveProcess = "UpdateTransitionText";
prevItem.UpdateTransitionText();
}
//_MyTimer.ActiveProcess = "DeleteItemInfoAndChildren";
ItemInfo.DeleteItemInfoAndChildren(item.ItemID); // Dispose ItemInfo and Children
if (prevItem != null)
prevItem.UpdateTransitionText();
else
nextItem.ResetOrdinal(); // B2020-043: Fix transition text, code moved from above, so that DeleteItemInfoAndChildren is called first.
}
catch (Exception ex)
{