[REGEDIT] Deduplication and other formatting changes (#7193)

- Deduplicates unused IDC_REGEDIT MENU vs. actually used IDR_REGEDIT_MENU
- shrinks the binary size, GCC8.4.0dbg build shrinks from 1.052.672 -> 1.049.600 bytes
- that also solves a few FIXME's, e.g. in hu-HU, pl-PL, sl-SI, sq-AL, tr-TR, uk-UA
- translates the help-popup string in th-TH.rc
- slightly tweak some headers to be a bit closer to newstyle without going all the way
- also link to LPGL2.1+ in the source files to reduce the wall-of-text, also some other whitespace tweaks in those, but no functional change
- security.c: vertical-compactness-whitespace-changes aim to get HeapAlloc closer to HeapFree
- id-ID.rc: "&Data nilai" and "&Nama nilai" does exist in 4 dialogs, Harmonize them
- pt-PT.rc: add 2 missing accels in IDD_EDIT_STRING
- edit.c: 3x ARRAY_SIZE
- the most review-worthy change in the actual .h/.c files is clb.c the change from ClbWndClass.hInstance = hinstDLL, ClbWndClass.hIcon = NULL; to ClbWndClass.hInstance = hinstDLL; ClbWndClass.hIcon = NULL;
- clb.c the stripped INT_PTR-cast for EndDialog() was Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
This commit is contained in:
Joachim Henze 2024-07-29 21:19:10 +02:00 committed by GitHub
parent d7ab15dcb4
commit 470cef7bfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 152 additions and 869 deletions

View file

@ -2,35 +2,20 @@
* Regedit treeview
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
*/
#include "regedit.h"
/* Global variables and constants */
/* Image_Open, Image_Closed, and Image_Root - integer variables for indexes of the images. */
/* CX_ICON and CY_ICON - width and height of an icon. */
/* NUM_ICON - number of icons to add to the image list. */
static int Image_Open = 0;
static int Image_Closed = 0;
static int Image_Root = 0;
/* Global variables and constants */
/* Image_Open, Image_Closed, and Image_Root - integer variables for indexes of the images */
static int Image_Open;
static int Image_Closed;
static int Image_Root;
static LPWSTR pathBuffer;
#define NUM_ICONS 3
#define NUM_ICONS 3 /* number of icons to add to the image list */
/* External resources in shell32.dll */
#define IDI_SHELL_FOLDER 4
@ -92,17 +77,13 @@ LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey)
*phRootKey = NULL;
if (!pathBuffer)
{
pathBuffer = HeapAlloc(GetProcessHeap(), 0, 1024);
}
if (!pathBuffer)
{
return NULL;
}
*pathBuffer = UNICODE_NULL;
maxLen = (int) HeapSize(GetProcessHeap(), 0, pathBuffer);
maxLen = (int)HeapSize(GetProcessHeap(), 0, pathBuffer);
if (!hItem)
{
@ -444,7 +425,6 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPWSTR pHostName)
return TRUE;
}
/*
* InitTreeViewImageLists - creates an image list, adds three bitmaps
* to it, and associates the image list with a tree view control.
@ -580,7 +560,6 @@ done:
return TRUE;
}
BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem)
{
WCHAR szNewKeyFormat[128];