Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Src/LexText/Interlinear/ITextDllTests/SandboxBaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void HandleTab()
VerifySelection(sandbox, false, SandboxBase.ktagSbWordGloss, 0, -1);
// Next the icon on the word cat line.
sandbox.HandleTab(false);
VerifySelection(sandbox, true, SandboxBase.ktagSbNamedObjName, SandboxBase.ktagSbWordPos, -1);
VerifySelection(sandbox, true, SandboxBase.ktagWordPosIcon, 0, -1);
// Then we wrap around to the start icon on the word line.
sandbox.HandleTab(false);
VerifySelection(sandbox, true, SandboxBase.ktagAnalysisIcon, 0, -1);
Expand All @@ -117,7 +117,7 @@ public void HandleTab()
sandbox.HandleTab(true);
VerifySelection(sandbox, true, SandboxBase.ktagAnalysisIcon, 0, -1);
sandbox.HandleTab(true);
VerifySelection(sandbox, true, SandboxBase.ktagSbNamedObjName, SandboxBase.ktagSbWordPos, -1);
VerifySelection(sandbox, true, SandboxBase.ktagWordPosIcon, 0, -1);
sandbox.HandleTab(true);
VerifySelection(sandbox, false, SandboxBase.ktagSbWordGloss, 0, -1);
sandbox.HandleTab(true);
Expand Down
2 changes: 1 addition & 1 deletion Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ internal void UpdateMorphBreaks(string sMorphs)
MorphemeBreaker mb = new MorphemeBreaker(m_caches, sMorphs, m_hvoSbWord,
m_wsVern, m_sandbox);
mb.Run();
m_sandbox.CopyLexEntryInfoToMonomorphemicWordGlossAndPos();
m_sandbox.CopyLexEntryInfoToMonomorphemicWordGlossAndPos(m_sandbox.UsingGuess);
m_rootb.Reconstruct(); // Everything changed, more or less.
// We've changed properties that the morph manager cares about, but we don't want it
// to fire when we fix the selection.
Expand Down
8 changes: 0 additions & 8 deletions Src/LexText/Interlinear/SandboxBase.SandboxVc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,6 @@ private void DisplayWordPOS(IVwEnv vwenv, int hvo, int ws, int choiceIndex)
vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
(int)FwTextPropVar.ktpvEnum,
(int)TptEditable.ktptNotEditable);
int wordPosHvo = vwenv.DataAccess.get_ObjectProp(hvo, ktagSbWordPos);
if (vwenv.DataAccess.get_IntProp(wordPosHvo, ktagSbNamedObjGuess) == 1)
{
// Show that the word category is guessed.
vwenv.set_IntProperty((int)FwTextPropType.ktptBackColor,
(int)FwTextPropVar.ktpvDefault,
InterlinVc.MachineGuessColor);
}
AddOptionalNamedObj(vwenv, hvo, ktagSbWordPos, ktagMissingWordPos,
kfragMissingWordPos, ktagWordPosIcon, ws, choiceIndex);
}
Expand Down
8 changes: 4 additions & 4 deletions Src/LexText/Interlinear/SandboxBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ private bool LoadRealDataIntoSec1(int hvoSbWord, bool fLookForDefaults, bool fAd
}
if (hasMf)
// Wait until all of the morphemes have been loaded (cf. LT-22235).
CopyLexEntryInfoToMonomorphemicWordGlossAndPos();
CopyLexEntryInfoToMonomorphemicWordGlossAndPos(fGuessing != 0);
if (bldrError.Length > 0)
{
var msg = bldrError.ToString().Trim();
Expand Down Expand Up @@ -1454,14 +1454,14 @@ private bool LoadRealDataIntoSec1(int hvoSbWord, bool fLookForDefaults, bool fAd
return fGuessing != 0;
}

internal void CopyLexEntryInfoToMonomorphemicWordGlossAndPos()
internal void CopyLexEntryInfoToMonomorphemicWordGlossAndPos(bool usingGuess)
{
bool fDirty = Caches.DataAccess.IsDirty();
bool fApproved = !UsingGuess;
bool fApproved = !usingGuess;
bool fHasApprovedWordGloss = HasWordGloss() && (fDirty || fApproved);
bool fHasApprovedWordCat = HasWordCat() && (fDirty || fApproved);
// conditionally set up the word gloss and POS to correspond to monomorphemic lex morph entry info.
SyncMonomorphemicGlossAndPos(!fHasApprovedWordGloss, !fHasApprovedWordCat);
SyncMonomorphemicGlossAndPos(usingGuess && !fHasApprovedWordGloss, usingGuess && !fHasApprovedWordCat);
// Forget we had an existing wordform; otherwise, the program considers
// all changes to be editing the wordform, and since it belongs to the
// old analysis, the old analysis gets resurrected.
Expand Down
Loading