B2022-049: Copy/paste of enhanced procedure and bad links between source and enhanced

This commit is contained in:
2022-08-03 15:03:40 +00:00
parent f234174a51
commit b6d69fbd4c
8 changed files with 347 additions and 22 deletions

View File

@@ -183,7 +183,9 @@ namespace Volian.Controls.Library
if (bi.Name.StartsWith("btnEnhanced"))
existingEnhancedButtons.Add(bi.Name);
bool inSource = dveds[0].Type != 0;
int buttonsNeeded = inSource ? dveds.Count : (dveds.Count * 2); // enhanced items need unlink button also.
int buttonsNeeded = inSource ? dveds.Count : (dveds.Count * 2); // enhanced items need unlink button also.
// if in view only mode, don't do unlink
if (!inSource && MyEditItem != null && MyEditItem.MyStepPanel.VwMode == E_ViewMode.View) buttonsNeeded--;
if (MyItemInfo.IsSection && !MyItemInfo.IsStepSection) buttonsNeeded = 0; // no buttons for word sections
if (buttonsNeeded > existingEnhancedButtons.Count) // add buttons
{
@@ -195,7 +197,8 @@ namespace Volian.Controls.Library
biEnhanced.Click += btnEnhancedGoTo_Click;
myButtonItem.SubItems.Add(biEnhanced);
existingEnhancedButtons.Add(biEnhanced.Name);
if (!inSource)
// if in view only mode, don't do unlink
if (!inSource && MyEditItem != null && MyEditItem.MyStepPanel.VwMode != E_ViewMode.View)
{
// add unlink buttons:
buttonName = string.Format("btnEnhancedUnlink{0}", dved.Type);