aboutsummaryrefslogtreecommitdiff
path: root/c/episodelistview.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-23 18:59:37 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-23 18:59:37 +0200
commitc6cd2f1f164baac1414f2cf658566de146b10552 (patch)
treecec573bbddacd175f37d8d45e48e8cea80727420 /c/episodelistview.cpp
parent2958c57db73b5af03af36598c9dffc9123a0a003 (diff)
downloadEpisodeBrowser-c6cd2f1f164baac1414f2cf658566de146b10552.tar.gz
Fix display of Unicode text.
Turns out that SWI-Prolog's wide string functions, which I started using in 03fe361, do not convert between narrow Prolog atoms and wide C strings, as I mistakenly thought. Instead, they work with wide Prolog atoms. In hindsight, it is not surprising.
Diffstat (limited to 'c/episodelistview.cpp')
-rw-r--r--c/episodelistview.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp
index cdb3dc7..bc01ce9 100644
--- a/c/episodelistview.cpp
+++ b/c/episodelistview.cpp
@@ -414,17 +414,16 @@ void EpisodeListView::Update()
/* Update episode name and rating. */
void EpisodeListView::UpdateItem(const LVITEM* const pLvi)
{
- Mark m;
- TCHAR* tszName;
+ std::basic_string<TCHAR> tstrName;
int iRating;
static TCHAR tszRating[3];
- if (!Pl("episode_data","episode_title",pLvi->lParam,&tszName)) {
+ 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,&tszName))
+ if (!Pl("episode_data","episode_title",pLvi->lParam,&tstrName))
goto r;
}
- ListView_SetItemText(hWnd, pLvi->iItem, ELVSITITLE, tszName);
+ ListView_SetItemText(hWnd, pLvi->iItem, ELVSITITLE, tstrName.data());
r: if (!Pl("episode_data","episode_rating",pLvi->lParam,&iRating)) {
ListView_SetItemText(hWnd, pLvi->iItem, ELVSIRATING, (TCHAR*)TEXT(""));