Fixed B2015-065 and fix for setting default section in section combo box

Shortened page length of Attachment section; added Transition to Default Section’s step.
This commit is contained in:
Kathy Ruffing 2015-05-20 13:48:15 +00:00
parent 86f3339ed5
commit 1ae09f7272
2 changed files with 7 additions and 4 deletions

Binary file not shown.

View File

@ -172,7 +172,7 @@ namespace Volian.Controls.Library
if (secStartId > -1) if (secStartId > -1)
{ {
secitm = ItemInfo.Get(secStartId); secitm = ItemInfo.Get(secStartId);
selitm = (secitm.Steps.Count > 0) ? secitm.Steps[0] : null; selitm = (secitm.Steps != null && secitm.Steps.Count > 0) ? secitm.Steps[0] : null;
} }
else else
btnTranSave.Enabled = false; // if there is an invalid section start - don't allow save. btnTranSave.Enabled = false; // if there is an invalid section start - don't allow save.
@ -181,7 +181,7 @@ namespace Volian.Controls.Library
// Fill step items, passing in the active step to the selected item, or the first // Fill step items, passing in the active step to the selected item, or the first
// step if the selection was not at the step level. // step if the selection was not at the step level.
ItemInfo stpitm = null; ItemInfo stpitm = null;
if (selitm.MyContent.Type >= 20000) if (selitm != null && selitm.MyContent.Type >= 20000)
{ {
if (_DoingRange) if (_DoingRange)
@ -504,7 +504,7 @@ namespace Volian.Controls.Library
private void cbTranProcsFillIn(ItemInfo prcitm) private void cbTranProcsFillIn(ItemInfo prcitm)
{ {
cbTranProcs.Items.Clear(); cbTranProcs.Items.Clear();
ItemInfo selitm = prcitm; // this is the selected 'section' ItemInfo selitm = prcitm; // this is the selected 'procedure'
prcitm = prcitm.FirstSibling; prcitm = prcitm.FirstSibling;
while (prcitm != null) while (prcitm != null)
{ {
@ -747,7 +747,10 @@ namespace Volian.Controls.Library
int sectstartid = FindSectionStart(_CurrentProcedure); int sectstartid = FindSectionStart(_CurrentProcedure);
if (sectstartid==-1) btnTranSave.Enabled = false; // if there is an invalid section start - don't allow save. if (sectstartid==-1) btnTranSave.Enabled = false; // if there is an invalid section start - don't allow save.
IList chldrn = _CurrentProcedure.GetChildren(); IList chldrn = _CurrentProcedure.GetChildren();
if (chldrn != null && chldrn.Count > 0) cbTranSectsFillIn((ItemInfo)chldrn[0], secitm==null?sectstartid:secitm.ItemID, true); //sectstartid); int secIdForCbSect = secitm == null ? sectstartid : secitm.ItemID;
// if this transition format requires the default section, use it:
if ((etmnew & E_TransUI.SectDefault) == E_TransUI.SectDefault) secIdForCbSect = sectstartid;
if (chldrn != null && chldrn.Count > 0) cbTranSectsFillIn((ItemInfo)chldrn[0], secIdForCbSect, true); //sectstartid);
} }
_TranFmtIndx = listBoxTranFmt.SelectedIndex; _TranFmtIndx = listBoxTranFmt.SelectedIndex;
groupPanelTranFmt.Style.BackColor = (_CurTrans == null && _TranFmtIndx == 0) ? Color.Yellow : Color.Orange; groupPanelTranFmt.Style.BackColor = (_CurTrans == null && _TranFmtIndx == 0) ? Color.Yellow : Color.Orange;