Skip to content

Commit c874439

Browse files
jtmaxwell3jasonleenaylorclaude
authored
Fix LT-22606: Word Cat has tan background when bundle selected (#999)
* Fix LT-22606: Word Cat has tan background when bundle selected * Use passed-in usingGuess instead of stale UsingGuess * Revert HandleTab test expectations to pre-LT-20848 values Not guessing the word cat for user-approved analyses restores the pre-LT-20848 tab behavior: the Nihimbilira test data is an approved analysis with no category, so tabbing to the word cat line lands on the plain dropdown icon (ktagWordPosIcon) again. Revert the two assertions that LT-20848 had updated for the auto-filled category. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Jason Naylor <jason_naylor@sil.org> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 22a5f7b commit c874439

4 files changed

Lines changed: 7 additions & 15 deletions

File tree

Src/LexText/Interlinear/ITextDllTests/SandboxBaseTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void HandleTab()
100100
VerifySelection(sandbox, false, SandboxBase.ktagSbWordGloss, 0, -1);
101101
// Next the icon on the word cat line.
102102
sandbox.HandleTab(false);
103-
VerifySelection(sandbox, true, SandboxBase.ktagSbNamedObjName, SandboxBase.ktagSbWordPos, -1);
103+
VerifySelection(sandbox, true, SandboxBase.ktagWordPosIcon, 0, -1);
104104
// Then we wrap around to the start icon on the word line.
105105
sandbox.HandleTab(false);
106106
VerifySelection(sandbox, true, SandboxBase.ktagAnalysisIcon, 0, -1);
@@ -117,7 +117,7 @@ public void HandleTab()
117117
sandbox.HandleTab(true);
118118
VerifySelection(sandbox, true, SandboxBase.ktagAnalysisIcon, 0, -1);
119119
sandbox.HandleTab(true);
120-
VerifySelection(sandbox, true, SandboxBase.ktagSbNamedObjName, SandboxBase.ktagSbWordPos, -1);
120+
VerifySelection(sandbox, true, SandboxBase.ktagWordPosIcon, 0, -1);
121121
sandbox.HandleTab(true);
122122
VerifySelection(sandbox, false, SandboxBase.ktagSbWordGloss, 0, -1);
123123
sandbox.HandleTab(true);

Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ internal void UpdateMorphBreaks(string sMorphs)
12131213
MorphemeBreaker mb = new MorphemeBreaker(m_caches, sMorphs, m_hvoSbWord,
12141214
m_wsVern, m_sandbox);
12151215
mb.Run();
1216-
m_sandbox.CopyLexEntryInfoToMonomorphemicWordGlossAndPos();
1216+
m_sandbox.CopyLexEntryInfoToMonomorphemicWordGlossAndPos(m_sandbox.UsingGuess);
12171217
m_rootb.Reconstruct(); // Everything changed, more or less.
12181218
// We've changed properties that the morph manager cares about, but we don't want it
12191219
// to fire when we fix the selection.

Src/LexText/Interlinear/SandboxBase.SandboxVc.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -550,14 +550,6 @@ private void DisplayWordPOS(IVwEnv vwenv, int hvo, int ws, int choiceIndex)
550550
vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
551551
(int)FwTextPropVar.ktpvEnum,
552552
(int)TptEditable.ktptNotEditable);
553-
int wordPosHvo = vwenv.DataAccess.get_ObjectProp(hvo, ktagSbWordPos);
554-
if (vwenv.DataAccess.get_IntProp(wordPosHvo, ktagSbNamedObjGuess) == 1)
555-
{
556-
// Show that the word category is guessed.
557-
vwenv.set_IntProperty((int)FwTextPropType.ktptBackColor,
558-
(int)FwTextPropVar.ktpvDefault,
559-
InterlinVc.MachineGuessColor);
560-
}
561553
AddOptionalNamedObj(vwenv, hvo, ktagSbWordPos, ktagMissingWordPos,
562554
kfragMissingWordPos, ktagWordPosIcon, ws, choiceIndex);
563555
}

Src/LexText/Interlinear/SandboxBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,7 @@ private bool LoadRealDataIntoSec1(int hvoSbWord, bool fLookForDefaults, bool fAd
14121412
}
14131413
if (hasMf)
14141414
// Wait until all of the morphemes have been loaded (cf. LT-22235).
1415-
CopyLexEntryInfoToMonomorphemicWordGlossAndPos();
1415+
CopyLexEntryInfoToMonomorphemicWordGlossAndPos(fGuessing != 0);
14161416
if (bldrError.Length > 0)
14171417
{
14181418
var msg = bldrError.ToString().Trim();
@@ -1454,14 +1454,14 @@ private bool LoadRealDataIntoSec1(int hvoSbWord, bool fLookForDefaults, bool fAd
14541454
return fGuessing != 0;
14551455
}
14561456

1457-
internal void CopyLexEntryInfoToMonomorphemicWordGlossAndPos()
1457+
internal void CopyLexEntryInfoToMonomorphemicWordGlossAndPos(bool usingGuess)
14581458
{
14591459
bool fDirty = Caches.DataAccess.IsDirty();
1460-
bool fApproved = !UsingGuess;
1460+
bool fApproved = !usingGuess;
14611461
bool fHasApprovedWordGloss = HasWordGloss() && (fDirty || fApproved);
14621462
bool fHasApprovedWordCat = HasWordCat() && (fDirty || fApproved);
14631463
// conditionally set up the word gloss and POS to correspond to monomorphemic lex morph entry info.
1464-
SyncMonomorphemicGlossAndPos(!fHasApprovedWordGloss, !fHasApprovedWordCat);
1464+
SyncMonomorphemicGlossAndPos(usingGuess && !fHasApprovedWordGloss, usingGuess && !fHasApprovedWordCat);
14651465
// Forget we had an existing wordform; otherwise, the program considers
14661466
// all changes to be editing the wordform, and since it belongs to the
14671467
// old analysis, the old analysis gets resurrected.

0 commit comments

Comments
 (0)