From c4e5a91da5f50b01cbf46d70830fdb7e51413e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 6 Apr 2022 23:31:13 +0200 Subject: Fix small reselection bug, make selection array static. --- c/episodelistview.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'c') diff --git a/c/episodelistview.c b/c/episodelistview.c index 1113b47..f1cc819 100644 --- a/c/episodelistview.c +++ b/c/episodelistview.c @@ -166,10 +166,11 @@ s: ListView_SetItemState(HElv, -1, LVIF_STATE, LVIS_SELECTED); void ElvUpdate() { - int i, iEpisode, iEpisodes, iEpisodeSelected[2048], iItem, iItemTopNew; + int i, iEpisode, iEpisodes, iItem, iItemTopNew; LVITEM lviEpisode, lviSelected, lviTop; LVFINDINFO lvfi; term_t t; + static int iEpisodeSelected[2048]; lviEpisode.mask = LVIF_TEXT|LVIF_PARAM; @@ -243,7 +244,7 @@ ElvUpdate() for (i = 0; iEpisodeSelected[i]; i++) { int iSel; lvfi.lParam = iEpisodeSelected[i]; - if ((iSel = ListView_FindItem(HElv, -1, &lvfi)) == -1) break; + if ((iSel = ListView_FindItem(HElv, -1, &lvfi)) == -1) continue; ListView_SetItemState(HElv, iSel, LVIS_SELECTED, LVIS_SELECTED); } -- cgit v1.2.3