diff --git a/Src/Utilities/AlloVarGen/AllomorphGeneratorDll/AlloGenFormBase.cs b/Src/Utilities/AlloVarGen/AllomorphGeneratorDll/AlloGenFormBase.cs index df0ffd122c..641351f96b 100644 --- a/Src/Utilities/AlloVarGen/AllomorphGeneratorDll/AlloGenFormBase.cs +++ b/Src/Utilities/AlloVarGen/AllomorphGeneratorDll/AlloGenFormBase.cs @@ -1091,9 +1091,17 @@ protected virtual void lBoxOperations_SelectedIndexChanged(object sender, EventA if (ActionOp.ReplaceOpRefs.Count == 0) { // need at least one replace action - Replace replace = CreateNewReplace(); - AlloGens.AddReplaceOp(replace); - lBoxReplaceOps.Items.Add(replace); + if (AlloGens.ReplaceOperations.Count > 0) + { + ActionOp.ReplaceOpRefs.Add(AlloGens.ReplaceOperations.ElementAt(0).Guid); + } + else + { + Replace replace = CreateNewReplace(); + AlloGens.AddReplaceOp(replace); + lBoxReplaceOps.Items.Add(replace); + } + MarkAsChanged(true); } StemName = ActionOp.StemName; tbStemName.Text = StemName.Name; @@ -1105,6 +1113,7 @@ protected virtual void lBoxOperations_SelectedIndexChanged(object sender, EventA protected void RefreshReplaceListBox() { lBoxReplaceOps.Items.Clear(); + List brokenRefs = new List(); foreach (string guid in ReplaceOpRefs) { Replace replace = AlloGens.FindReplaceOp(guid); @@ -1112,6 +1121,15 @@ protected void RefreshReplaceListBox() { lBoxReplaceOps.Items.Add(replace); } + else + { + brokenRefs.Add(guid); + } + } + foreach (string guid in brokenRefs) + { + ReplaceOpRefs.Remove(guid); + MarkAsChanged(true); } if (ReplaceOpRefs.Count > 0) lBoxReplaceOps.SetSelected(0, true); diff --git a/Src/Utilities/AlloVarGen/AllomorphGeneratorDll/SimpleMatchDlgAlloGen.resx b/Src/Utilities/AlloVarGen/AllomorphGeneratorDll/SimpleMatchDlgAlloGen.resx index 74b4f19aca..9bbfd9f52f 100644 --- a/Src/Utilities/AlloVarGen/AllomorphGeneratorDll/SimpleMatchDlgAlloGen.resx +++ b/Src/Utilities/AlloVarGen/AllomorphGeneratorDll/SimpleMatchDlgAlloGen.resx @@ -423,7 +423,7 @@ 8, 19 - 488, 172 + 823, 255 Match for forms containing...