From ee1d2a2874e759518444f4e2fb807b7959ad88fd Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Thu, 4 Feb 2016 23:50:36 +0000 Subject: [PATCH] Used a better check for the root item of the treeview. The listview, status bar and address bar should only get wiped when the user selects the root item of the treeview. CORE-10803 #comment Retest please! svn path=/trunk/; revision=70691 --- reactos/base/applications/regedit/childwnd.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/reactos/base/applications/regedit/childwnd.c b/reactos/base/applications/regedit/childwnd.c index 06dab532290..dd63ba72a87 100644 --- a/reactos/base/applications/regedit/childwnd.c +++ b/reactos/base/applications/regedit/childwnd.c @@ -309,6 +309,15 @@ UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath) LPCWSTR keyPath, rootName; LPWSTR fullPath; + /* Wipe the listview, the status bar and the address bar if the root key was selected */ + if (TreeView_GetParent(g_pChildWnd->hTreeWnd, hItem) == NULL) + { + (void)ListView_DeleteAllItems(g_pChildWnd->hListWnd); + SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)NULL); + SendMessageW(g_pChildWnd->hAddressBarWnd, WM_SETTEXT, 0, (LPARAM)NULL); + return; + } + if (pszPath == NULL) keyPath = GetItemPath(g_pChildWnd->hTreeWnd, hItem, &hRootKey); else @@ -348,12 +357,6 @@ UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath) } } } - else - { - (void)ListView_DeleteAllItems(g_pChildWnd->hListWnd); - SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)NULL); - SendMessageW(g_pChildWnd->hAddressBarWnd, WM_SETTEXT, 0, (LPARAM)NULL); - } } /*******************************************************************************