diff options
Diffstat (limited to 'c/episodelistview.cpp')
-rw-r--r-- | c/episodelistview.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index 7b9653e..5de5e2e 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -431,21 +431,19 @@ void EpisodeListView::Update() void EpisodeListView::UpdateItem(const LVITEM* const pLvi) { std::basic_string<TCHAR> tstrName; - int iRating; - static TCHAR tszRating[3]; - if (!Pl("episode_data","episode_title",pLvi->lParam,&tstrName)) { if (!Pl("episode_data","update_episode_data")) goto r; - if (!Pl("episode_data","episode_title",pLvi->lParam,&tstrName)) - goto r; + if (!Pl("episode_data","episode_title",pLvi->lParam,&tstrName)) goto r; } ListView_SetItemText(hWnd, pLvi->iItem, ELVSITITLE, tstrName.data()); + int iRating; r: if (!Pl("episode_data","episode_rating",pLvi->lParam,&iRating)) { ListView_SetItemText(hWnd, pLvi->iItem, ELVSIRATING, (TCHAR*)TEXT("")); return; } + TCHAR tszRating[3]; _stprintf_s(tszRating, sizeof(tszRating), TEXT("%d"), iRating); ListView_SetItemText(hWnd, pLvi->iItem, ELVSIRATING, tszRating); } |