diff --git a/Src/LexText/Interlinear/ChooseAnalysisHandler.cs b/Src/LexText/Interlinear/ChooseAnalysisHandler.cs index bdb5f82c6f..c83feb2268 100644 --- a/Src/LexText/Interlinear/ChooseAnalysisHandler.cs +++ b/Src/LexText/Interlinear/ChooseAnalysisHandler.cs @@ -296,7 +296,7 @@ public void SetupCombo() } } - // Add option to clear the analysis altogeter. + // Add option to clear the analysis altogether. AddItem(wordform, MakeSimpleString(ITextStrings.ksNewAnalysis), false, WfiWordformTags.kClassId); // Add option to reset to the default AddItem(null, MakeSimpleString(ITextStrings.ksUseDefaultAnalysis), false); @@ -374,7 +374,6 @@ internal static ITsString MakeAnalysisStringRep(IWfiAnalysis wa, LcmCache fdoCac ITsTextProps formTextProperties = FormTextProperties(fdoCache, fUseStyleSheet, wsVern); ITsTextProps glossTextProperties = GlossTextProperties(fdoCache, true, fUseStyleSheet); ITsStrBldr tsb = TsStringUtils.MakeStrBldr(); - ISilDataAccess sda = fdoCache.MainCacheAccessor; int cmorph = wa.MorphBundlesOS.Count; if (cmorph == 0) return TsStringUtils.MakeString(ITextStrings.ksNoMorphemes, fdoCache.DefaultUserWs); @@ -436,7 +435,12 @@ internal static ITsString MakeAnalysisStringRep(IWfiAnalysis wa, LcmCache fdoCac if (sense != null) { ITsString tssGloss = sense.Gloss.get_String(fdoCache.DefaultAnalWs); - tsb.Replace(ichMinSense, ichMinSense, tssGloss.Text, glossTextProperties); + var inflType = mb.InflTypeRA; + var glossAccessor = sense.Gloss; + var wsAnalysis = fdoCache.ServiceLocator.WritingSystemManager.Get(fdoCache.DefaultAnalWs); + var tssSense = MorphServices.MakeGlossOptionWithInflVariantTypes(inflType, glossAccessor, wsAnalysis); + var displayText = tssSense?.Text ?? tssGloss.Text; + tsb.Replace(ichMinSense, ichMinSense, displayText, glossTextProperties); } else tsb.Replace(ichMinSense, ichMinSense, ksMissingString, glossTextProperties); @@ -569,6 +573,7 @@ public void Activate(Rect loc) combo.Location = new System.Drawing.Point(loc.left, loc.top); // 21 is the default height of a combo, the smallest reasonable size. combo.Size = new System.Drawing.Size(Math.Max(loc.right - loc.left + 30, 200), Math.Max( loc.bottom - loc.top, 50)); + if (!m_owner.Controls.Contains(combo)) m_owner.Controls.Add(combo); }