Skip to content

Commit bcfbea0

Browse files
authored
LT-21495: Fix problem with Subscribe() not getting called
IsControllingTheRecordTreeBar.Set had a situation where it would return before calling Subscribe(). Changed InterlinearTextsRecordClerk so that it subscribes and unsubscribes the same as RecordClerk.
1 parent ca0a979 commit bcfbea0

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

Src/LexText/Interlinear/InterlinearTextsRecordClerk.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,12 @@ public List<int> GetScriptureIds()
3737
return (from st in GetInterestingTextList().ScriptureTexts select st.Hvo).ToList();
3838
}
3939

40-
public override bool IsControllingTheRecordTreeBar
40+
public override void ActivateUI(bool useRecordTreeBar, bool updateStatusBar = true)
4141
{
42-
set
43-
{
44-
CheckDisposed();
45-
46-
// Nothing to do if we were already the active clerk or if we are not controlling the recordtreebar,
47-
var oldActiveClerk = m_propertyTable.GetValue<RecordClerk>("ActiveClerk");
48-
if (oldActiveClerk == this || !value)
49-
return;
42+
// Only needs to handle changes if this RecordClerk is being used in the GUI.
43+
Subscriber.Subscribe(EventConstants.AddTexts, AddTexts);
5044

51-
base.IsControllingTheRecordTreeBar = value;
52-
Subscriber.Subscribe(EventConstants.AddTexts, AddTexts);
53-
}
45+
base.ActivateUI(useRecordTreeBar, updateStatusBar);
5446
}
5547

5648
protected override void RemoveNotification()

0 commit comments

Comments
 (0)