Changeset 295 for trunk/src/comctl32/treeview.c
- Timestamp:
- Jul 12, 1999, 5:58:51 PM (26 years ago)
- 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 $ */ 2 2 /* Treeview control 3 3 * … … 42 42 */ 43 43 44 /* CB: todo 45 - fix ffs(); 46 */ 44 47 45 48 #include <string.h> … … 1268 1271 * This method does the chaining of the insertion of a treeview item 1269 1272 * before an item. 1273 * If parent is NULL, we're inserting at the root of the list. 1270 1274 */ 1271 1275 static void TREEVIEW_InsertBefore( … … 1305 1309 upSibling->sibling = newItem->hItem; 1306 1310 else 1311 if (parent) 1307 1312 /* this item is the first child of this parent, adjust parent pointers */ 1308 1313 parent->firstChild = newItem->hItem; 1314 else infoPtr->TopRootItem = newItem->hItem; 1309 1315 } 1310 1316 else /* Insert as first child of this parent */ 1317 if (parent) 1311 1318 parent->firstChild = newItem->hItem; 1312 1319 } … … 1314 1321 /*************************************************************************** 1315 1322 * 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. 1316 1324 * after an item. 1317 1325 */ … … 1357 1365 } 1358 1366 else /* Insert as first child of this parent */ 1367 if (parent) 1359 1368 parent->firstChild = newItem->hItem; 1360 1369 } … … 1390 1399 /* Obtain the TVSORTBC struct */ 1391 1400 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 } 1392 1408 1393 1409 /* Obtain the parent node to sort */ … … 1627 1643 else 1628 1644 { 1629 TREEVIEW_ITEM *aChild = 1630 &infoPtr->items[(INT)parentItem->firstChild]; 1645 TREEVIEW_ITEM *aChild; 1631 1646 1632 1647 TREEVIEW_ITEM *previousChild = NULL; 1633 1648 BOOL bItemInserted = FALSE; 1649 1650 if (parentItem) 1651 aChild = &infoPtr->items[(INT)parentItem->firstChild]; 1652 else 1653 aChild = &infoPtr->items[(INT)infoPtr->TopRootItem]; 1634 1654 1635 1655 /* Iterate the parent children to see where we fit in */
Note:
See TracChangeset
for help on using the changeset viewer.