[REGEDIT] Code formatting 949/head
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Mon, 15 Oct 2018 14:13:06 +0000 (23:13 +0900)
committerMark Jansen <mark.jansen@reactos.org>
Sun, 21 Oct 2018 11:07:43 +0000 (13:07 +0200)
base/applications/regedit/childwnd.c

index d3a6cd0..3afe53a 100644 (file)
@@ -43,6 +43,7 @@ extern void ResizeWnd(int cx, int cy)
     HDWP hdwp = BeginDeferWindowPos(4);
     RECT rt, rs, rb;
     const int tHeight = 22;
     HDWP hdwp = BeginDeferWindowPos(4);
     RECT rt, rs, rb;
     const int tHeight = 22;
+    const UINT uFlags = SWP_NOZORDER | SWP_NOACTIVATE;
     SetRect(&rt, 0, 0, cx, cy);
     cy = 0;
     if (hStatusBar != NULL)
     SetRect(&rt, 0, 0, cx, cy);
     cy = 0;
     if (hStatusBar != NULL)
@@ -51,12 +52,29 @@ extern void ResizeWnd(int cx, int cy)
         cy = rs.bottom - rs.top;
     }
     GetWindowRect(g_pChildWnd->hAddressBtnWnd, &rb);
         cy = rs.bottom - rs.top;
     }
     GetWindowRect(g_pChildWnd->hAddressBtnWnd, &rb);
-    cx = g_pChildWnd->nSplitPos + SPLIT_WIDTH/2;
-    if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hAddressBarWnd, 0, rt.left, rt.top, rt.right-rt.left - 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE);
-    if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hAddressBtnWnd, 0, rt.right - 2*tHeight, rt.top, 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE);
-    if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hTreeWnd, 0, rt.left, rt.top + tHeight+2, g_pChildWnd->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE);
-    if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hListWnd, 0, rt.left+cx, rt.top + tHeight+2, rt.right-cx, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE);
-    if (hdwp) EndDeferWindowPos(hdwp);
+    cx = g_pChildWnd->nSplitPos + SPLIT_WIDTH / 2;
+    if (hdwp)
+        hdwp = DeferWindowPos(hdwp, g_pChildWnd->hAddressBarWnd, NULL,
+                              rt.left, rt.top,
+                              rt.right - rt.left - 2*tHeight, tHeight,
+                              uFlags);
+    if (hdwp)
+        hdwp = DeferWindowPos(hdwp, g_pChildWnd->hAddressBtnWnd, NULL,
+                              rt.right - 2*tHeight, rt.top,
+                              2*tHeight, tHeight,
+                              uFlags);
+    if (hdwp)
+        hdwp = DeferWindowPos(hdwp, g_pChildWnd->hTreeWnd, NULL,
+                              rt.left, rt.top + tHeight + 2,
+                              g_pChildWnd->nSplitPos - SPLIT_WIDTH/2 - rt.left, rt.bottom - rt.top - cy,
+                              uFlags);
+    if (hdwp)
+        hdwp = DeferWindowPos(hdwp, g_pChildWnd->hListWnd, NULL,
+                              rt.left + cx, rt.top + tHeight + 2,
+                              rt.right - cx, rt.bottom - rt.top - cy,
+                              uFlags);
+    if (hdwp)
+        EndDeferWindowPos(hdwp);
 }
 
 /*******************************************************************************
 }
 
 /*******************************************************************************
@@ -143,14 +161,14 @@ static BOOL ChildWnd_CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
         /* TODO */
         break;
     case ID_TREE_EXPANDBRANCH:
         /* TODO */
         break;
     case ID_TREE_EXPANDBRANCH:
-        (void)TreeView_Expand(g_pChildWnd->hTreeWnd, TreeView_GetSelection(g_pChildWnd->hTreeWnd), TVE_EXPAND);
+        TreeView_Expand(g_pChildWnd->hTreeWnd, TreeView_GetSelection(g_pChildWnd->hTreeWnd), TVE_EXPAND);
         break;
     case ID_TREE_COLLAPSEBRANCH:
         break;
     case ID_TREE_COLLAPSEBRANCH:
-        (void)TreeView_Expand(g_pChildWnd->hTreeWnd, TreeView_GetSelection(g_pChildWnd->hTreeWnd), TVE_COLLAPSE);
+        TreeView_Expand(g_pChildWnd->hTreeWnd, TreeView_GetSelection(g_pChildWnd->hTreeWnd), TVE_COLLAPSE);
         break;
     case ID_TREE_RENAME:
         SetFocus(g_pChildWnd->hTreeWnd);
         break;
     case ID_TREE_RENAME:
         SetFocus(g_pChildWnd->hTreeWnd);
-        (void)TreeView_EditLabel(g_pChildWnd->hTreeWnd, TreeView_GetSelection(g_pChildWnd->hTreeWnd));
+        TreeView_EditLabel(g_pChildWnd->hTreeWnd, TreeView_GetSelection(g_pChildWnd->hTreeWnd));
         break;
     case ID_TREE_DELETE:
         hSelection = TreeView_GetSelection(g_pChildWnd->hTreeWnd);
         break;
     case ID_TREE_DELETE:
         hSelection = TreeView_GetSelection(g_pChildWnd->hTreeWnd);
@@ -312,7 +330,7 @@ UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath)
     /* Wipe the listview, the status bar and the address bar if the root key was selected */
     if (TreeView_GetParent(g_pChildWnd->hTreeWnd, hItem) == NULL)
     {
     /* 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);
+        ListView_DeleteAllItems(g_pChildWnd->hListWnd);
         SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)NULL);
         SendMessageW(g_pChildWnd->hAddressBarWnd, WM_SETTEXT, 0, (LPARAM)NULL);
         return;
         SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)NULL);
         SendMessageW(g_pChildWnd->hAddressBarWnd, WM_SETTEXT, 0, (LPARAM)NULL);
         return;
@@ -610,7 +628,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                     {
                         lResult = FALSE;
                         RegCloseKey(hKey);
                     {
                         lResult = FALSE;
                         RegCloseKey(hKey);
-                        (void)TreeView_EditLabel(g_pChildWnd->hTreeWnd, ptvdi->item.hItem);
+                        TreeView_EditLabel(g_pChildWnd->hTreeWnd, ptvdi->item.hItem);
                     }
                     else
                     {
                     }
                     else
                     {
@@ -728,18 +746,18 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                 hti.pt.x = pt.x;
                 hti.pt.y = pt.y;
                 ScreenToClient(g_pChildWnd->hTreeWnd, &hti.pt);
                 hti.pt.x = pt.x;
                 hti.pt.y = pt.y;
                 ScreenToClient(g_pChildWnd->hTreeWnd, &hti.pt);
-                (void)TreeView_HitTest(g_pChildWnd->hTreeWnd, &hti);
+                TreeView_HitTest(g_pChildWnd->hTreeWnd, &hti);
             }
 
             if (hti.flags & TVHT_ONITEM)
             {
                 hContextMenu = GetSubMenu(hPopupMenus, PM_TREECONTEXT);
             }
 
             if (hti.flags & TVHT_ONITEM)
             {
                 hContextMenu = GetSubMenu(hPopupMenus, PM_TREECONTEXT);
-                (void)TreeView_SelectItem(g_pChildWnd->hTreeWnd, hti.hItem);
+                TreeView_SelectItem(g_pChildWnd->hTreeWnd, hti.hItem);
 
                 memset(&item, 0, sizeof(item));
                 item.mask = TVIF_STATE | TVIF_CHILDREN;
                 item.hItem = hti.hItem;
 
                 memset(&item, 0, sizeof(item));
                 item.mask = TVIF_STATE | TVIF_CHILDREN;
                 item.hItem = hti.hItem;
-                (void)TreeView_GetItem(g_pChildWnd->hTreeWnd, &item);
+                TreeView_GetItem(g_pChildWnd->hTreeWnd, &item);
 
                 /* Set the Expand/Collapse menu item appropriately */
                 LoadStringW(hInst, (item.state & TVIS_EXPANDED) ? IDS_COLLAPSE : IDS_EXPAND, buffer, COUNT_OF(buffer));
 
                 /* Set the Expand/Collapse menu item appropriately */
                 LoadStringW(hInst, (item.state & TVIS_EXPANDED) ? IDS_COLLAPSE : IDS_EXPAND, buffer, COUNT_OF(buffer));