summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-15 14:33:49 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-15 14:33:49 +0300
commitd5ed49db10c48031e98e92c0a577964b0581c794 (patch)
tree299805b4940321bd25c2290523b21f460fd8e4ad /src
parent57ff99c9525a7bc381392f28f2b54e3df3c45db1 (diff)
CCtrlListView::addItem() doesn't add strings in the reverse order anymore
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/Windows/CCtrlListView.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mir_core/src/Windows/CCtrlListView.cpp b/src/mir_core/src/Windows/CCtrlListView.cpp
index 40bb1f481e..dd34ae1921 100644
--- a/src/mir_core/src/Windows/CCtrlListView.cpp
+++ b/src/mir_core/src/Windows/CCtrlListView.cpp
@@ -132,7 +132,7 @@ void CCtrlListView::AddColumn(int iSubItem, const wchar_t *name, int cx)
void CCtrlListView::AddGroup(int iGroupId, const wchar_t *name)
{
- LVGROUP lvg = { 0 };
+ LVGROUP lvg = {};
lvg.cbSize = sizeof(lvg);
lvg.mask = LVGF_HEADER | LVGF_GROUPID;
lvg.pszHeader = (LPWSTR)name;
@@ -143,8 +143,9 @@ void CCtrlListView::AddGroup(int iGroupId, const wchar_t *name)
int CCtrlListView::AddItem(const wchar_t *text, int iIcon, LPARAM lParam, int iGroupId)
{
- LVITEM lvi = { 0 };
+ LVITEM lvi = {};
lvi.mask = LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE;
+ lvi.iItem = m_iItem++;
lvi.iSubItem = 0;
lvi.pszText = (LPWSTR)text;
lvi.iImage = iIcon;
@@ -159,7 +160,7 @@ int CCtrlListView::AddItem(const wchar_t *text, int iIcon, LPARAM lParam, int iG
void CCtrlListView::SetItem(int iItem, int iSubItem, const wchar_t *text, int iIcon)
{
- LVITEM lvi = { 0 };
+ LVITEM lvi = {};
lvi.mask = LVIF_TEXT;
lvi.iItem = iItem;
lvi.iSubItem = iSubItem;
@@ -174,7 +175,7 @@ void CCtrlListView::SetItem(int iItem, int iSubItem, const wchar_t *text, int iI
LPARAM CCtrlListView::GetItemData(int iItem) const
{
- LVITEM lvi = { 0 };
+ LVITEM lvi = {};
lvi.mask = LVIF_PARAM;
lvi.iItem = iItem;
return GetItem(&lvi) ? lvi.lParam : -1;