From 23dc657f0af27bdac887f8d18208d544cc9f010e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 2 Aug 2022 23:50:58 +0200 Subject: Improve wstring_owner, rename to wchar_ptr. The user-defined conversion function makes the interface a lot simpler AND safer. --- c/datalistview.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'c/datalistview.cpp') diff --git a/c/datalistview.cpp b/c/datalistview.cpp index ecaa76f..cdc6dfb 100644 --- a/c/datalistview.cpp +++ b/c/datalistview.cpp @@ -64,20 +64,20 @@ void DataListView::ShowEpisode(const int iEpisode) LVITEM lviValue = {LVIF_TEXT}; for (int i = 0; q.NextSolution(std::nothrow); i++) { - wstring_owner key; - wstring_owner value; + wchar_ptr key; + wchar_ptr value; if (!(PlGet(t+1, &key) && PlGet(t+2, &value))) continue; lviKey.iItem = i; lviKey.iSubItem = 0; - lviKey.pszText = key.p; + lviKey.pszText = key; ListView_InsertItem(hWnd, &lviKey); lviValue.iItem = i; lviValue.iSubItem = 1; - lviValue.pszText = value.p; + lviValue.pszText = value; ListView_SetItem(hWnd, &lviValue); } -- cgit v1.2.3