Skip to content

Commit

Permalink
Fix: build break and more warnings removed
Browse files Browse the repository at this point in the history
  • Loading branch information
uxmal committed Aug 9, 2024
1 parent e00cb37 commit 602efaf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Gui/Controls/IComboBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public interface IComboBox : IControl
object? DataSource { get; set; }
IList Items { get; }
int SelectedIndex { get; set; }
object SelectedItem { get; set; }
object SelectedValue { get; set; }
object? SelectedItem { get; set; }
object? SelectedValue { get; set; }
string Text { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/UserInterfaces/AvaloniaUI/Controls/TextView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public TextView()
{
this.Selection = new TextSelection(this);
this.model = new EmptyEditorModel();
this.styleStack = new StyleStack();
this.styleStack = default!;
}

event EventHandler? ILogicalScrollable.ScrollInvalidated
Expand Down
2 changes: 1 addition & 1 deletion src/UserInterfaces/WindowsForms/Forms/FindStringsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public FindStringsDialog()
InitializeComponent();
}

public FindStringsDialogInteractor DataContext
public new FindStringsDialogInteractor DataContext
{
get => interactor;
set
Expand Down
12 changes: 7 additions & 5 deletions src/UserInterfaces/WindowsForms/SearchResultServiceImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,14 @@ public void Advance(int distance)
if (itemCount < 2)
return;
int i;
if (listView.FocusedItem == null)
var tag = listView.FocusedItem?.Tag;
if (tag is null)
{
i = 0;
}
else
{
i = ((int) listView.FocusedItem.Tag + itemCount + distance) % itemCount;
i = ((int) tag + itemCount + distance) % itemCount;
}
listView.SelectedIndices.Clear();
listView.SelectedIndices.Add(i);
Expand All @@ -175,9 +176,10 @@ public void Advance(int distance)

void listView_DoubleClick(object? sender, EventArgs e)
{
if (listView.FocusedItem == null)
var tag = listView.FocusedItem?.Tag;
if (tag is null)
return;
DoubleClickItem((int)listView.FocusedItem.Tag);
DoubleClickItem((int) tag);
}

private class SearchResultView : ISearchResultView
Expand Down Expand Up @@ -221,7 +223,7 @@ public void Invalidate()
{
var i = listView.TopItem;
if (i is null)
return null;
return Task.FromResult<string?>(null);
return typeMarker.ShowAsync(program, addr, i.Position);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public int SelectedIndex
set { ddl.SelectedIndex = value; }
}

public object SelectedItem
public object? SelectedItem
{
get { return ddl.SelectedItem; }
set { ddl.SelectedItem= value; }
Expand Down

0 comments on commit 602efaf

Please sign in to comment.