aboutsummaryrefslogtreecommitdiff
path: root/c/datalistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/datalistview.cpp')
-rw-r--r--c/datalistview.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp
index 3269dab..05d46a4 100644
--- a/c/datalistview.cpp
+++ b/c/datalistview.cpp
@@ -31,23 +31,18 @@ DataListView::Create()
void
DataListView::ShowEpisode(int iEpisode)
{
- int i, iItem;
- LVFINDINFO lvfi;
- LVITEM lviKey, lviValue;
- term_t t;
- qid_t q;
-
ListView_DeleteAllItems(m_hWnd);
+ LVITEM lviKey, lviValue;
lviKey.mask = LVIF_TEXT;
lviValue.mask = LVIF_TEXT;
- t = PL_new_term_refs(3);
+ term_t t = PL_new_term_refs(3);
if (!Plp(t,"I",iEpisode)) return;
- q = PL_open_query(NULL, PL_Q_NORMAL,
+ qid_t q = PL_open_query(NULL, PL_Q_NORMAL,
PL_predicate("episode_datum", 3, "episode_data"), t);
- for (i = 0; PL_next_solution(q); i++) {
+ for (int i = 0; PL_next_solution(q); i++) {
char *szKey;
char *szValue;
TCHAR *tszKey, *tszValue;
@@ -77,9 +72,10 @@ DataListView::ShowEpisode(int iEpisode)
PL_cut_query(q);
UpdateLayout();
+ LVFINDINFO lvfi;
lvfi.flags = LVFI_PARAM;
lvfi.lParam = iEpisode;
- iItem = ListView_FindItem(g_elv.HWnd(), -1, &lvfi);
+ int iItem = ListView_FindItem(g_elv.HWnd(), -1, &lvfi);
if (iItem != -1)
ListView_EnsureVisible(g_elv.HWnd(), iItem, TRUE);
}