Skip to content

Commit 4c35c2f

Browse files
authored
Remove dead code (#926)
* Remove dead code This removal is part of the changes that were made in the PubSub branch with commit c6ec604. * cleanup Apply additional cleanup from commit c6ec604.
1 parent ea21aab commit 4c35c2f

10 files changed

Lines changed: 6 additions & 110 deletions

File tree

Src/Common/Framework/FwApp.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,6 @@ public abstract class FwApp : IApp, ISettings, IDisposable, IHelpTopicProvider,
182182
protected DebugProcs m_debugProcs;
183183
#endif
184184
private FwRegistrySettings m_registrySettings;
185-
/// <summary>
186-
/// null means that we are not suppressing view refreshes.
187-
/// True means we're suppressing and we need to do a refresh when finished.
188-
/// False means we're suppressing, but have no need to do a refresh when finished.
189-
/// </summary>
190-
private bool? m_refreshView;
191185

192186
/// <summary>The find patterns for the find/replace dialog, one for each database.</summary>
193187
/// <remarks>We need one pattern per database (cache). Otherwise it'll crash when we try to
@@ -542,7 +536,6 @@ protected virtual void Dispose(bool disposing)
542536
m_registrySettings = null;
543537
m_findPattern = null;
544538
m_findReplaceDlg = null;
545-
m_refreshView = null;
546539
PictureHolder = null;
547540
#if DEBUG
548541
m_debugProcs = null;
@@ -1044,24 +1037,6 @@ public List<IFwMainWnd> MainWindows
10441037
}
10451038
}
10461039

1047-
/// ------------------------------------------------------------------------------------
1048-
/// <summary>
1049-
/// Refreshes all the views in all of the Main Windows of the app.
1050-
/// </summary>
1051-
/// ------------------------------------------------------------------------------------
1052-
public void RefreshAllViews()
1053-
{
1054-
CheckDisposed();
1055-
1056-
if (m_refreshView != null)
1057-
m_refreshView = true;
1058-
else
1059-
{
1060-
foreach (IFwMainWnd wnd in MainWindows)
1061-
wnd.RefreshAllViews();
1062-
}
1063-
}
1064-
10651040
/// <summary>
10661041
/// Restart the spell-checking process (e.g. when dictionary changed)
10671042
/// </summary>

Src/Common/Framework/IFwMainWnd.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@ public interface IFwMainWnd : IxWindow
7878
/// ------------------------------------------------------------------------------------
7979
bool OnEditFind(object args);
8080

81-
/// ------------------------------------------------------------------------------------
82-
/// <summary>
83-
/// Refreshes all the views that belong to this main window
84-
/// </summary>
85-
/// ------------------------------------------------------------------------------------
86-
void RefreshAllViews();
87-
8881
/// ------------------------------------------------------------------------------------
8982
/// <summary>
9083
/// Closes this instance.

Src/Common/RootSite/IApp.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@ public interface IApp
6767
/// </summary>
6868
PictureHolder PictureHolder { get; }
6969

70-
/// ------------------------------------------------------------------------------------
71-
/// <summary>
72-
/// Refreshes all the views in all of the Main Windows of the app.
73-
/// </summary>
74-
/// ------------------------------------------------------------------------------------
75-
void RefreshAllViews();
76-
7770
/// <summary>
7871
/// Restart the spell-checking process (e.g. when dictionary changed)
7972
/// </summary>

Src/Common/RootSite/UndoActions.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Copyright (c) 2003-2013 SIL International
22
// This software is licensed under the LGPL, version 2.1 or later
33
// (http://www.gnu.org/licenses/lgpl-2.1.html)
4-
//
5-
// File: UndoActions.cs
6-
// Responsibility: TE Team
74

85
using System.Diagnostics;
96
using System.Windows.Forms;

Src/LexText/Interlinear/ConcordanceControl.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,11 +1781,6 @@ protected override void Dispose(bool disposing)
17811781
base.Dispose(disposing);
17821782
}
17831783

1784-
protected override void RefreshAfterInvalidObject()
1785-
{
1786-
ConcordanceControl.LoadMatches(true);
1787-
}
1788-
17891784
/// <summary>
17901785
/// Overridden to prevent trying to get a name for the "current object" which we can't do because
17911786
/// it is not a true CmObject.

Src/LexText/Interlinear/InterlinearTextsRecordClerk.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ public override void ReloadIfNeeded()
9797

9898
public override bool OnRefresh(object sender)
9999
{
100-
if(m_list as ConcordanceWordList != null)
100+
if(m_list is ConcordanceWordList cwList)
101101
{
102-
((ConcordanceWordList)m_list).RequestRefresh();
102+
cwList.RequestRefresh();
103103
}
104104
return base.OnRefresh(sender);
105105
}

Src/LexText/LexTextDll/LexTextApp.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.IO;
88
using System.Windows.Forms;
99
using System.Diagnostics;
10-
using System.ComponentModel;
1110
using System.Runtime.InteropServices;
1211
using SIL.FieldWorks.Common.Controls;
1312
using SIL.FieldWorks.Common.Framework;

Src/LexText/Morphology/PhEnvStrRepresentationSlice.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ private void DoValidation(bool refresh)
310310
{
311311
if (frm != null)
312312
wc = new WaitCursor(frm);
313-
ConstraintFailure failure;
314-
m_env.CheckConstraints(PhEnvironmentTags.kflidStringRepresentation, true, out failure, /* adjust the squiggly line */ true);
313+
m_env.CheckConstraints(PhEnvironmentTags.kflidStringRepresentation, true, out _, /* adjust the squiggly line */ true);
315314
// This will make the record list update to the new value.
316315
if (refresh)
317316
{
@@ -322,8 +321,7 @@ private void DoValidation(bool refresh)
322321
}
323322
finally
324323
{
325-
if (wc != null)
326-
wc.Dispose();
324+
wc?.Dispose();
327325
}
328326
}
329327

Src/xWorks/FwXWindow.cs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,29 +1605,6 @@ protected bool OnUndo(object args)
16051605
return false;
16061606
}
16071607

1608-
private void HandleUndoResult(UndoResult ures, bool fPrivate)
1609-
{
1610-
// Enhance JohnT: may want to display messages for kuresFailed, kuresError
1611-
if (ures != UndoResult.kuresSuccess)
1612-
{
1613-
1614-
if (!fPrivate && m_app != null)
1615-
{
1616-
// currently implemented, this will cause this app to do a master refresh,
1617-
m_app.Synchronize();
1618-
}
1619-
else
1620-
{
1621-
// EricP/JohnT -- this path will probably never be called in a production
1622-
// context, since we'll have an FwApp. And even in the case of tests
1623-
// taking this path, we wonder if we should issue a "MasterRefresh" instead
1624-
#pragma warning disable 618 // suppress obsolete warning
1625-
m_mediator.SendMessage("Refresh", this);
1626-
#pragma warning restore 618
1627-
}
1628-
}
1629-
}
1630-
16311608
/// ------------------------------------------------------------------------------------
16321609
/// <summary>
16331610
/// Disables/enables the Edit/Undo menu item
@@ -2397,24 +2374,6 @@ private void ResyncRootboxStyles()
23972374
}
23982375
}
23992376

2400-
/// ------------------------------------------------------------------------------------
2401-
/// <summary>
2402-
/// JohnT: this might be a poorly named or obsolete message. Kept because there are
2403-
/// some callers and I don't have time to analyze them all. Generally better to use
2404-
/// RefreshDisplay().
2405-
/// </summary>
2406-
/// ------------------------------------------------------------------------------------
2407-
public void RefreshAllViews()
2408-
{
2409-
CheckDisposed();
2410-
2411-
// We don't want to clear the cache... just update the view.
2412-
#pragma warning disable 618 // suppress obsolete warning
2413-
m_mediator.SendMessage("Refresh", this);
2414-
#pragma warning restore 618
2415-
//OnMasterRefresh(null);
2416-
}
2417-
24182377
/// ------------------------------------------------------------------------------------
24192378
/// <summary>
24202379
/// Gets the currently active view (client window).

Src/xWorks/RecordClerk.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
using SIL.LCModel.Core.KernelInterfaces;
4040
using SIL.FieldWorks.Common.FwUtils;
4141
using static SIL.FieldWorks.Common.FwUtils.FwUtils;
42-
using SIL.FieldWorks.Common.RootSites;
4342
using SIL.LCModel;
4443
using SIL.LCModel.Application;
4544
using SIL.LCModel.DomainServices;
@@ -1156,8 +1155,7 @@ public virtual bool OnRefresh(object argument)
11561155
var window = m_propertyTable.GetValue<Form>("window");
11571156
using (new WaitCursor(window))
11581157
{
1159-
if (m_rch != null)
1160-
m_rch.Fixup(false); // no need to recursively refresh!
1158+
m_rch?.Fixup(false); // no need to recursively refresh!
11611159
m_list.ReloadList();
11621160
return false; //that other colleagues do a refresh, too.
11631161
}
@@ -2058,8 +2056,7 @@ virtual public bool IsControllingTheRecordTreeBar
20582056
m_propertyTable.SetProperty("UpdateStatusBar", m_updateStatusBar, true);
20592057
m_propertyTable.SetPropertyPersistence("UpdateStatusBar", false);
20602058

2061-
if (oldActiveClerk != null)
2062-
oldActiveClerk.BecomeInactive();
2059+
oldActiveClerk?.BecomeInactive();
20632060
m_propertyTable.SetProperty("OldActiveClerk", oldActiveClerk, true);
20642061
m_propertyTable.SetPropertyPersistence("OldActiveClerk", false);
20652062
m_propertyTable.SetProperty("ActiveClerk", this, true);
@@ -2333,16 +2330,6 @@ protected virtual void ClearInvalidSubitem()
23332330
{
23342331
}
23352332

2336-
/// <summary>
2337-
/// Handles refreshing the record list after an object was deleted.
2338-
/// </summary>
2339-
/// <remarks>This should be overriden to perform more efficient refreshing of the record list display</remarks>
2340-
protected virtual void RefreshAfterInvalidObject()
2341-
{
2342-
// to be safe we just do a full refresh
2343-
m_propertyTable.GetValue<IApp>("App").RefreshAllViews();
2344-
}
2345-
23462333
private int FindClosestValidIndex(int idx, int cobj)
23472334
{
23482335
for (int i = idx + 1; i < cobj; ++i)

0 commit comments

Comments
 (0)