aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-04-06 23:31:13 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-04-06 23:31:13 +0200
commitc4e5a91da5f50b01cbf46d70830fdb7e51413e29 (patch)
treeb19ed2d534eefe55d3c294bdde3631787bedafc6
parent7477864c92ee980d51049a90271a70ae0c5dfc6b (diff)
downloadEpisodeBrowser-c4e5a91da5f50b01cbf46d70830fdb7e51413e29.tar.gz
Fix small reselection bug, make selection array static.
-rw-r--r--c/episodelistview.c5
1 files changed, 3 insertions, 2 deletions
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);
}