Ignore:
Timestamp:
Jul 12, 1999, 5:58:51 PM (26 years ago)
Author:
cbratschi
Message:

wine-990704 updates, TBCUSTOMIZE implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/treeview.c

    r252 r295  
    1 /* $Id: treeview.c,v 1.7 1999-06-30 15:52:19 cbratschi Exp $ */
     1/* $Id: treeview.c,v 1.8 1999-07-12 15:58:49 cbratschi Exp $ */
    22/* Treeview control
    33 *
     
    4242 */
    4343
     44/* CB: todo
     45 - fix ffs();
     46*/
    4447
    4548#include <string.h>
     
    12681271 * This method does the chaining of the insertion of a treeview item
    12691272 * before an item.
     1273 * If parent is NULL, we're inserting at the root of the list.
    12701274 */
    12711275static void TREEVIEW_InsertBefore(
     
    13051309      upSibling->sibling = newItem->hItem;
    13061310    else
     1311    if (parent)
    13071312      /* this item is the first child of this parent, adjust parent pointers */
    13081313      parent->firstChild = newItem->hItem;
     1314    else infoPtr->TopRootItem = newItem->hItem;
    13091315  }
    13101316  else /* Insert as first child of this parent */
     1317  if (parent)
    13111318    parent->firstChild = newItem->hItem;
    13121319}
     
    13141321/***************************************************************************
    13151322 * This method does the chaining of the insertion of a treeview item
     1323 * If parent is NULL, we're inserting at the root of the list.
    13161324 * after an item.
    13171325 */
     
    13571365  }
    13581366  else /* Insert as first child of this parent */
     1367  if (parent)
    13591368    parent->firstChild = newItem->hItem;
    13601369}
     
    13901399  /* Obtain the TVSORTBC struct */
    13911400  infoPtr->pCallBackSort = (LPTVSORTCB)lParam;
     1401
     1402  /* Check for a valid handle to the parent item */
     1403  if (!TREEVIEW_ValidItem(infoPtr, infoPtr->pCallBackSort->hParent))
     1404  {
     1405//    ERR ("invalid item hParent=%d\n", (INT)infoPtr->pCallBackSort->hParent);
     1406    return FALSE;
     1407  }
    13921408
    13931409  /* Obtain the parent node to sort */
     
    16271643      else
    16281644      {
    1629         TREEVIEW_ITEM *aChild        =
    1630           &infoPtr->items[(INT)parentItem->firstChild];
     1645        TREEVIEW_ITEM *aChild;
    16311646
    16321647        TREEVIEW_ITEM *previousChild = NULL;
    16331648        BOOL bItemInserted           = FALSE;
     1649
     1650        if (parentItem)
     1651          aChild = &infoPtr->items[(INT)parentItem->firstChild];
     1652        else
     1653          aChild = &infoPtr->items[(INT)infoPtr->TopRootItem];
    16341654
    16351655        /* Iterate the parent children to see where we fit in */
Note: See TracChangeset for help on using the changeset viewer.