diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-17 00:50:37 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-17 00:50:37 +0200 |
commit | 03fe36165b6767bc4e0d26bf1b1de38fdff3f75e (patch) | |
tree | d4145d918964b0b0f93e611de52220632113bfa8 /c/datalistview.cpp | |
parent | 605a3ff052defc3e41542204b0579e528d81ad72 (diff) | |
download | EpisodeBrowser-03fe36165b6767bc4e0d26bf1b1de38fdff3f75e.tar.gz |
Use SWI-Prolog's wide-character functions.
This avoids the use of TsmFromSz.
Diffstat (limited to 'c/datalistview.cpp')
-rw-r--r-- | c/datalistview.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp index f75fc99..532e3a6 100644 --- a/c/datalistview.cpp +++ b/c/datalistview.cpp @@ -9,6 +9,7 @@ #include "episodelistview.h" #include "listview.h" #include "main.h" +#include "pl.h" extern EpisodeListView *g_lpElv; @@ -44,24 +45,21 @@ void DataListView::ShowEpisode(int iEpisode) PL_predicate("episode_datum", 3, "episode_data"), t); for (int i = 0; PL_next_solution(q); i++) { - char *szKey; - char *szValue; + TCHAR *tszKey; + TCHAR *tszValue; - if (!(PL_get_atom_chars(t+1,&szKey) && PL_get_atom_chars(t+2,&szValue))) + if (!(PlGet(t+1, &tszKey) && PlGet(t+2, &tszValue))) continue; - 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 = tsmKey.data(); + lviKey.pszText = tszKey; ListView_InsertItem(m_hWnd, &lviKey); lviValue.iItem = i; lviValue.iSubItem = 1; - lviValue.pszText = tsmValue.data(); + lviValue.pszText = tszValue; ListView_SetItem(m_hWnd, &lviValue); } |