aboutsummaryrefslogtreecommitdiff
path: root/c/datalistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/datalistview.cpp')
-rw-r--r--c/datalistview.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp
index 2920c0c..2f184dc 100644
--- a/c/datalistview.cpp
+++ b/c/datalistview.cpp
@@ -46,29 +46,23 @@ void DataListView::ShowEpisode(int iEpisode)
for (int i = 0; PL_next_solution(q); i++) {
char *szKey;
char *szValue;
- TCHAR *tszKey, *tszValue;
if (!(PL_get_atom_chars(t+1,&szKey) && PL_get_atom_chars(t+2,&szValue)))
continue;
- tszKey = TszFromSz(szKey, CP_UTF8);
- if (!tszKey) continue;
- tszValue = TszFromSz(szValue, CP_UTF8);
- if (!tszValue) goto c;
+ std::basic_string<TCHAR> tsmKey = TsmFromSz(szKey, CP_UTF8);
+ std::basic_string<TCHAR> tsmValue = TsmFromSz(szValue, CP_UTF8);
lviKey.mask = LVIF_TEXT;
lviKey.iItem = i;
lviKey.iSubItem = 0;
- lviKey.pszText = tszKey;
+ lviKey.pszText = tsmKey.data();
ListView_InsertItem(m_hWnd, &lviKey);
lviValue.iItem = i;
lviValue.iSubItem = 1;
- lviValue.pszText = tszValue;
+ lviValue.pszText = tsmValue.data();
ListView_SetItem(m_hWnd, &lviValue);
-
- free(tszValue);
- c: free(tszKey);
}
PL_cut_query(q);