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 do a after from current HLS - if not at HLS, go up parents until find it.
|
||||||
else if (fromtype == 0 && !_MyEditItem.MyItemInfo.IsStepSection)
|
else if (fromtype == 0 && !_MyEditItem.MyItemInfo.IsStepSection)
|
||||||
{
|
{
|
||||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||||
_MyEditItem.MyParentEditItem.Select(); // High Level Step
|
|
||||||
EditItem hlsEditItem = _MyEditItem;
|
EditItem hlsEditItem = _MyEditItem;
|
||||||
while (!hlsEditItem.MyItemInfo.IsHigh)
|
while (!hlsEditItem.MyItemInfo.IsHigh)
|
||||||
hlsEditItem = hlsEditItem.ActiveParent;
|
hlsEditItem = hlsEditItem.ActiveParent;
|
||||||
@ -1073,8 +1072,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
else if (contenttype == 21040)
|
else if (contenttype == 21040)
|
||||||
{
|
{
|
||||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||||
_MyEditItem.MyParentEditItem.Select(); // SupInfo
|
|
||||||
_MyEditItem.AddChild((E_FromType)fromtype, 20040);
|
_MyEditItem.AddChild((E_FromType)fromtype, 20040);
|
||||||
}
|
}
|
||||||
else if (InsertingTable(contenttype))
|
else if (InsertingTable(contenttype))
|
||||||
@ -1398,17 +1396,24 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
private void btnInsBefore_Click(object sender, EventArgs e)
|
private void btnInsBefore_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||||
_MyEditItem.MyParentEditItem.Select(); // Previous
|
|
||||||
_MyEditItem.AddSiblingBefore();
|
_MyEditItem.AddSiblingBefore();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnInsAfter_Click(object sender, EventArgs e)
|
private void btnInsAfter_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||||
_MyEditItem.MyParentEditItem.Select(); // Next
|
|
||||||
_MyEditItem.AddSiblingAfter();
|
_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>
|
/// <summary>
|
||||||
/// Using style for step type, enable/disable formatting buttons
|
/// Using style for step type, enable/disable formatting buttons
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -3588,16 +3593,14 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
StepTabPanel tmp = Parent as StepTabPanel;
|
StepTabPanel tmp = Parent as StepTabPanel;
|
||||||
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
|
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
|
||||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||||
_MyEditItem.MyParentEditItem.Select(); // Paste After
|
|
||||||
MyEditItem.PasteSiblingAfter(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
MyEditItem.PasteSiblingAfter(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
||||||
}
|
}
|
||||||
private void btnPasteBefore_Click(object sender, EventArgs e)
|
private void btnPasteBefore_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
StepTabPanel tmp = Parent as StepTabPanel;
|
StepTabPanel tmp = Parent as StepTabPanel;
|
||||||
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
|
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
|
||||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
SaveTableChanges(); // B2018-055 Save Current Changes to the table
|
||||||
_MyEditItem.MyParentEditItem.Select(); // Paste Before
|
|
||||||
MyEditItem.PasteSiblingBefore(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
MyEditItem.PasteSiblingBefore(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
||||||
}
|
}
|
||||||
private void btnStepPaste_Click(object sender, EventArgs e)
|
private void btnStepPaste_Click(object sender, EventArgs e)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user