Skip to content

Commit f9e8be5

Browse files
authored
Fix LT-22465: Missing "Edit Lexical Entry" command (#768)
1 parent d58727c commit f9e8be5

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2083,7 +2083,13 @@ private void RunCreateEntryDlg()
20832083
ILexEntry le;
20842084
IMoForm allomorph;
20852085
ILexSense sense;
2086+
bool hasLexEntry = GetLexEntry() != null;
20862087
CreateNewEntry(false, out le, out allomorph, out sense);
2088+
if (!hasLexEntry && GetLexEntry() != null)
2089+
{
2090+
// Add "Edit Lexical Entry...".
2091+
SetupCombo();
2092+
}
20872093
}
20882094

20892095
internal void CreateNewEntry(bool fCreateNow, out ILexEntry le, out IMoForm allomorph, out ILexSense sense)
@@ -2598,7 +2604,15 @@ private void OnSelectEditLexicalEntry(object sender, EventArgs args)
25982604
private ILexEntry GetLexEntry()
25992605
{
26002606
IWfiMorphBundle bundle = m_caches.RealObject(m_hvoMorph) as IWfiMorphBundle;
2601-
return bundle?.MorphRA?.Owner as ILexEntry;
2607+
if (bundle?.MorphRA?.Owner is ILexEntry)
2608+
{
2609+
return bundle.MorphRA.Owner as ILexEntry;
2610+
}
2611+
if (m_sandbox.m_hvoLastSelEntry != 0)
2612+
{
2613+
return m_caches.MainCache.ServiceLocator.GetInstance<ILexEntryRepository>().GetObject(m_sandbox.m_hvoLastSelEntry);
2614+
}
2615+
return null;
26022616
}
26032617
private void OnSelectAllomorphOf(object sender, EventArgs args)
26042618
{

0 commit comments

Comments
 (0)