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

This commit is contained in:
Kathy Ruffing 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 // 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, // steplevel of 5, but the 2nd was a steplevel of 4). If something similar is seen with Cautions,
// that check could be added. // 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; level += firstInc;
else else
firstInc = 0; firstInc = 0;
@ -3866,14 +3867,14 @@ namespace VEPROMS.CSLA.Library
{ {
if (IsStep) if (IsStep)
{ {
_MyTab = new Tab(AdjustForTextSubFollowsTextStyle(FormatStepData.TabData.Font)); MyTab = new Tab(AdjustForTextSubFollowsTextStyle(FormatStepData.TabData.Font));
_MyHeader = new MetaTag(FormatStepData.TabData.Font); _MyHeader = new MetaTag(FormatStepData.TabData.Font);
_MyFooter = new MetaTag(FormatStepData.TabData.Font); _MyFooter = new MetaTag(FormatStepData.TabData.Font);
SetTabText(); SetTabText();
} }
else else
{ {
_MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.Font); MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.Font);
_MyHeader = null; _MyHeader = null;
_MyFooter = null; _MyFooter = null;
_MyTab.CleanText = DisplayNumber; _MyTab.CleanText = DisplayNumber;
@ -5400,7 +5401,7 @@ namespace VEPROMS.CSLA.Library
public string Text public string Text
{ {
get { return _Text; } get { return _Text; }
set { _Text = value; } set { _Text = value; }
} }
public string CleanText; // all tokens removed public string CleanText; // all tokens removed
public MetaTag() public MetaTag()
@ -7533,7 +7534,7 @@ namespace VEPROMS.CSLA.Library
//private int? _TemplateColumnMode //private int? _TemplateColumnMode
public override void SetupTags() 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); string sectTab = GetSectionTab(false);
_MyTab.Text = sectTab; _MyTab.Text = sectTab;
_MyTab.CleanText = sectTab.PadRight(20); _MyTab.CleanText = sectTab.PadRight(20);
@ -7779,7 +7780,7 @@ namespace VEPROMS.CSLA.Library
// B2016-160 Support transitions to sections // B2016-160 Support transitions to sections
VE_Font fnt = new VE_Font("Arial", 10, E_Style.None, 10); VE_Font fnt = new VE_Font("Arial", 10, E_Style.None, 10);
if (FormatStepData != null) fnt = FormatStepData.TabData.Font; if (FormatStepData != null) fnt = FormatStepData.TabData.Font;
_MyTab = new Tab(AdjustForTextSubFollowsTextStyle(fnt)); MyTab = new Tab(AdjustForTextSubFollowsTextStyle(fnt));
MyHeader = new MetaTag(fnt); MyHeader = new MetaTag(fnt);
MyFooter = new MetaTag(fnt); MyFooter = new MetaTag(fnt);
SetTabText(); SetTabText();

View File

@ -352,7 +352,7 @@ namespace VEPROMS.CSLA.Library
// Refresh ItemInfo to update Previous // Refresh ItemInfo to update Previous
using (Item item = Get()) ItemInfo.Refresh(item); 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 // 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(); tmp.UpdateROText();
OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before)); OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before));
((ItemInfo)ActiveParent).MyContent.RefreshContentParts(); ((ItemInfo)ActiveParent).MyContent.RefreshContentParts();
@ -2173,6 +2173,7 @@ namespace VEPROMS.CSLA.Library
public void ResetOrdinal() public void ResetOrdinal()
{ {
ResetOrdinal(ItemID); ResetOrdinal(ItemID);
Application.DoEvents(); // B2020-043: Fix transition text
} }
public static void DeleteItemInfoAndChildren(int itemID) public static void DeleteItemInfoAndChildren(int itemID)
{ {
@ -2320,10 +2321,6 @@ namespace VEPROMS.CSLA.Library
nextItem.RefreshItemParts(); nextItem.RefreshItemParts();
//nextItem.ResetOrdinal(); - UpdateTransitionText calls ResetOrdinal //nextItem.ResetOrdinal(); - UpdateTransitionText calls ResetOrdinal
//_MyTimer.ActiveProcess = "UpdateTransitionText"; //_MyTimer.ActiveProcess = "UpdateTransitionText";
if(prevItem != null)
prevItem.UpdateTransitionText();
else
nextItem.UpdateTransitionText();
} }
else if (prevItem != null) else if (prevItem != null)
{ {
@ -2332,10 +2329,14 @@ namespace VEPROMS.CSLA.Library
//_MyTimer.ActiveProcess = "ResetOrdinal"; //_MyTimer.ActiveProcess = "ResetOrdinal";
if (prevItem.IsCaution || prevItem.IsNote) prevItem.ResetOrdinal(); if (prevItem.IsCaution || prevItem.IsNote) prevItem.ResetOrdinal();
//_MyTimer.ActiveProcess = "UpdateTransitionText"; //_MyTimer.ActiveProcess = "UpdateTransitionText";
prevItem.UpdateTransitionText();
} }
//_MyTimer.ActiveProcess = "DeleteItemInfoAndChildren"; //_MyTimer.ActiveProcess = "DeleteItemInfoAndChildren";
ItemInfo.DeleteItemInfoAndChildren(item.ItemID); // Dispose ItemInfo and Children 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) catch (Exception ex)
{ {

View File

@ -759,7 +759,7 @@ namespace Volian.Controls.Library
{ {
RefreshTab(); RefreshTab();
if (_MyAfterEditItems != null) foreach (EditItem chld in _MyAfterEditItems) chld.SetAllTabs(); if (_MyAfterEditItems != null) _MyAfterEditItems[0].SetAllTabs(); // B2020-043: used to loop through all, but then recursion would redo.
if (_MyNextEditItem != null) _MyNextEditItem.SetAllTabs(); if (_MyNextEditItem != null) _MyNextEditItem.SetAllTabs();
// Update the RNO tab if it exists - RHM 20100106 // Update the RNO tab if it exists - RHM 20100106
if (_MyRNOEditItems != null) foreach (EditItem chld in _MyRNOEditItems) chld.SetAllTabs(); if (_MyRNOEditItems != null) foreach (EditItem chld in _MyRNOEditItems) chld.SetAllTabs();
@ -1018,6 +1018,11 @@ namespace Volian.Controls.Library
//Console.Write(",\"Parent\","); //Console.Write(",\"Parent\",");
} }
//_MyTimer.ShowElapsedTimes("DeleteItem"); //_MyTimer.ShowElapsedTimes("DeleteItem");
if (newFocus != null) // B2020-043: Fix transition text when previous text is deleted
{
newFocus.SetAllTabs();
newFocus.MyItemInfo.UpdateTransitionText();
}
return newFocus; return newFocus;
} }
@ -1409,6 +1414,7 @@ namespace Volian.Controls.Library
AddGridIfNeeded(newItemInfo); AddGridIfNeeded(newItemInfo);
AddImageIfNeeded(newItemInfo); AddImageIfNeeded(newItemInfo);
DoAddSiblingBefore(newItemInfo, updateSelection); DoAddSiblingBefore(newItemInfo, updateSelection);
newItemInfo.UpdateTransitionText(); // B2020-043: fix transition text when a step is inserted before
if (MyStepPanel.SelectedEditItem is RTBItem) if (MyStepPanel.SelectedEditItem is RTBItem)
{ {
RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem; RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem;