B2016-030: Crash when deleting a source (has linked enhanced) sections when all are displayed in editor.

B2016-029: Title of newly created enhanced section is not correct if source section not titled ‘New Section’.
B2016-031: Insert from tree of section after a non-linked section does not get inserted in enhanced procedure in correct location.
This commit is contained in:
2016-02-02 14:07:25 +00:00
parent ab76c69199
commit 596a59d0f6
2 changed files with 22 additions and 16 deletions

View File

@@ -704,14 +704,17 @@ namespace Volian.Controls.Library
if (MyItemInfo.IsSection)
{
SectionConfig secc = MyItemInfo.MyConfig as SectionConfig;
if (secc.Section_LnkEnh=="Y")thisEnhs = secc.MyEnhancedDocuments;
if (secc.Section_LnkEnh == "Y") thisEnhs = secc.MyEnhancedDocuments;
}
}
List<int> enhIds = new List<int>();
foreach (EnhancedDocument ed in thisEnhs)
if (thisEnhs != null)
{
if (ed.Type != 0) enhIds.Add(ed.ItemID);
foreach (EnhancedDocument ed in thisEnhs)
{
if (ed.Type != 0) enhIds.Add(ed.ItemID);
}
}
BeingRemoved = true;
MyStepPanel.SelectedEditItem = null; // Unselect the item to be deleted
@@ -723,7 +726,7 @@ namespace Volian.Controls.Library
pnl.Size = new Size(10, 10);
MyStepPanel.Controls.Add(pnl);
pnl.BackColor = Color.Red;
pnl.Location = new Point(xOffset += 15, MyStepPanel.ClientSize.Height+10);
pnl.Location = new Point(xOffset += 15, MyStepPanel.ClientSize.Height + 10);
EditItem newFocus = DeleteItem();
if (newFocus == null)
{
@@ -748,10 +751,10 @@ namespace Volian.Controls.Library
MyStepPanel.Controls.Remove(pnl);
foreach (int enhId in enhIds)
{
ItemInfo ii = ItemInfo.Get(enhId);
bool success = this._MyStepPanel.MyStepTabPanel.MyDisplayTabControl.DeleteRTBItem(ii);
if (!success) // item was not displayed in editor, just delete from database (add tree if necessarY)
Item.DeleteItemAndChildren(ii);
ItemInfo ii = ItemInfo.Get(enhId);
bool success = this._MyStepPanel.MyStepTabPanel.MyDisplayTabControl.DeleteRTBItem(ii);
if (!success)
Item.DeleteItemAndChildren(ii);
}
}