diff --git a/PROMS/Volian.Controls.Library/StepPanel.cs b/PROMS/Volian.Controls.Library/StepPanel.cs index 2fcb431b..2755cea7 100644 --- a/PROMS/Volian.Controls.Library/StepPanel.cs +++ b/PROMS/Volian.Controls.Library/StepPanel.cs @@ -231,18 +231,14 @@ namespace Volian.Controls.Library private void ExpandAsNeeded(ItemInfo myItemInfo) { int id = myItemInfo.ItemID; - if (_LookupStepItems.ContainsKey(id)) // If the item is currently displayed - { - _LookupStepItems[id].AutoExpand(); // Expand it if it should expand - } - else - { + if (!_LookupStepItems.ContainsKey(id)) // If the item is not currently displayed ExpandAsNeeded((ItemInfo)myItemInfo.ActiveParent); // Expand it's parent - if (!_LookupStepItems.ContainsKey(id)) // Expand Parent if not expanded - { - int parentId = ((ItemInfo)myItemInfo.ActiveParent).ItemID; - _LookupStepItems[parentId].AutoExpand(); - } + if (_LookupStepItems.ContainsKey(id)) // Expanding Parent should have added it to _LookupStepItems + { + StepItem itm = _LookupStepItems[id]; + if (itm.Visible == false) + ExpandAsNeeded((ItemInfo)myItemInfo.ActiveParent); + itm.AutoExpand(); // Expand it if it should expand } } #endregion diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 11bdd2e3..b55ce63d 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -79,6 +79,7 @@ namespace Volian.Controls.Library RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT); //_InitializingRTB = false; _IsDirty = false; + ClearUndo(); } } } @@ -252,7 +253,11 @@ namespace Volian.Controls.Library if (ReadOnly) return; if (!_IsDirty) return; bool success = _origDisplayText.Save((RichTextBox)this); - if (success) _IsDirty = false; + if (success) + { + _IsDirty = false; + ClearUndo(); + } } #endregion #region AddRtfTextAndStyles