https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2a2df969b0ad0ff5c8fe72ba97aa73858a06998b
commit 2a2df969b0ad0ff5c8fe72ba97aa73858a06998b Author: Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org> AuthorDate: Mon Sep 16 22:47:42 2024 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org> CommitDate: Wed Sep 18 12:31:43 2024 +0200 [RAPPS] Simplify CAppsListView::SetCheckboxesVisible() into ShowCheckboxes() --- base/applications/rapps/appview.cpp | 26 +++++++++----------------- base/applications/rapps/include/appview.h | 7 ++++--- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/base/applications/rapps/appview.cpp b/base/applications/rapps/appview.cpp index fb7515d5cfc..03a4fd436fa 100644 --- a/base/applications/rapps/appview.cpp +++ b/base/applications/rapps/appview.cpp @@ -1109,19 +1109,11 @@ CAppsListView::SetWatermark(const CStringW &Text) m_Watermark = Text; } -VOID -CAppsListView::SetCheckboxesVisible(BOOL bIsVisible) +void +CAppsListView::ShowCheckboxes(bool bShow) { - if (bIsVisible) - { - SetExtendedListViewStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT); - } - else - { - SetExtendedListViewStyle(LVS_EX_FULLROWSELECT); - } - - bHasCheckboxes = bIsVisible; + SetExtendedListViewStyle((bShow ? LVS_EX_CHECKBOXES : 0) | LVS_EX_FULLROWSELECT); + bHasCheckboxes = bShow; } VOID @@ -1254,7 +1246,7 @@ CAppsListView::Create(HWND hwndParent) if (hwnd) { - SetCheckboxesVisible(FALSE); + ShowCheckboxes(false); } #pragma push_macro("SubclassWindow") @@ -1363,8 +1355,8 @@ CAppsListView::SetDisplayAppType(APPLICATION_VIEW_TYPE AppType) szText.LoadStringW(IDS_APP_DESCRIPTION); AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT); - // disable checkboxes - SetCheckboxesVisible(FALSE); + // Disable checkboxes + ShowCheckboxes(false); break; case AppViewTypeAvailableApps: @@ -1379,8 +1371,8 @@ CAppsListView::SetDisplayAppType(APPLICATION_VIEW_TYPE AppType) szText.LoadStringW(IDS_APP_DESCRIPTION); AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT); - // enable checkboxes - SetCheckboxesVisible(TRUE); + // Enable checkboxes + ShowCheckboxes(true); break; default: diff --git a/base/applications/rapps/include/appview.h b/base/applications/rapps/include/appview.h index 46a3a583092..0c9aa29a733 100644 --- a/base/applications/rapps/include/appview.h +++ b/base/applications/rapps/include/appview.h @@ -195,7 +195,7 @@ class CAppsListView : public CUiWindow<CWindowImpl<CAppsListView, CListView>> }; BOOL bIsAscending = TRUE; - BOOL bHasCheckboxes = FALSE; + bool bHasCheckboxes = false; INT ItemCount = 0; INT CheckedItemCount = 0; @@ -224,8 +224,9 @@ class CAppsListView : public CUiWindow<CWindowImpl<CAppsListView, CListView>> VOID SetWatermark(const CStringW &Text); - VOID - SetCheckboxesVisible(BOOL bIsVisible); + + void + ShowCheckboxes(bool bShow); VOID ColumnClick(LPNMLISTVIEW pnmv);