B2018-055 - Correction to code that fixed B2018-005. Needed to handle second and third siblings of a table. Code was implemented to use the parent. It needed to support using the previous edititem if the parent was null.
This commit is contained in:
parent
3acba6eff2
commit
f3af44b26a
@ -1064,8 +1064,7 @@ namespace Volian.Controls.Library
|
||||
// else do a after from current HLS - if not at HLS, go up parents until find it.
|
||||
else if (fromtype == 0 && !_MyEditItem.MyItemInfo.IsStepSection)
|
||||
{
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select(); // High Level Step
|
||||
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||
EditItem hlsEditItem = _MyEditItem;
|
||||
while (!hlsEditItem.MyItemInfo.IsHigh)
|
||||
hlsEditItem = hlsEditItem.ActiveParent;
|
||||
@ -1073,8 +1072,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
else if (contenttype == 21040)
|
||||
{
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select(); // SupInfo
|
||||
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||
_MyEditItem.AddChild((E_FromType)fromtype, 20040);
|
||||
}
|
||||
else if (InsertingTable(contenttype))
|
||||
@ -1398,17 +1396,24 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
private void btnInsBefore_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select(); // Previous
|
||||
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||
_MyEditItem.AddSiblingBefore();
|
||||
}
|
||||
|
||||
private void btnInsAfter_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select(); // Next
|
||||
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||
_MyEditItem.AddSiblingAfter();
|
||||
}
|
||||
|
||||
private void SaveTableChanges()
|
||||
{
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
if (_MyEditItem.MyParentEditItem != null)// B2018-055 Move to Parent if it exists
|
||||
_MyEditItem.MyParentEditItem.Select(); // Next
|
||||
else if (_MyEditItem.MyPreviousEditItem != null)// B2018-055 Move to Previous if it exists
|
||||
_MyEditItem.MyPreviousEditItem.Select();
|
||||
}
|
||||
/// <summary>
|
||||
/// Using style for step type, enable/disable formatting buttons
|
||||
/// </summary>
|
||||
@ -3588,16 +3593,14 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select(); // Paste After
|
||||
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||
MyEditItem.PasteSiblingAfter(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
||||
}
|
||||
private void btnPasteBefore_Click(object sender, EventArgs e)
|
||||
{
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select(); // Paste Before
|
||||
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||
MyEditItem.PasteSiblingBefore(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
||||
}
|
||||
private void btnStepPaste_Click(object sender, EventArgs e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user