Ignore:
Timestamp:
Feb 22, 2000, 6:11:41 PM (26 years ago)
Author:
cbratschi
Message:

Corel 20000212, TREEVIEW_Sort fix, CCBase

File:
1 edited

Legend:

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

    r2820 r2858  
    1 /* $Id: comctl32undoc.c,v 1.18 2000-02-18 17:13:37 cbratschi Exp $ */
     1/* $Id: comctl32undoc.c,v 1.19 2000-02-22 17:11:38 cbratschi Exp $ */
    22/*
    33 * Undocumented functions from COMCTL32.DLL
     
    1212 */
    1313
    14 /* WINE 20000130 level */
     14/*
     15 - Corel 20000212 level
     16 - WINE 20000130 level
     17*/
    1518
    1619/* CB: todo
     
    14851488    INT  i, j;
    14861489
    1487 //    TRACE (commctrl, "l=%i r=%i\n", l, r);
     1490    //TRACE("l=%i r=%i\n", l, r);
    14881491
    14891492    i = l;
    14901493    j = r;
     1494
     1495    if ( i >= j )
     1496        return;
     1497    else if ( i == (j - 1) )
     1498    {
     1499        if ( (pfnCompare)( lpPtrs[i], lpPtrs[j], lParam ) > 0 )
     1500        {
     1501            t = lpPtrs[i];
     1502            lpPtrs[i] = lpPtrs[j];
     1503            lpPtrs[j] = t;
     1504        }
     1505        return;
     1506    }
     1507
    14911508    v = lpPtrs[(int)(l+r)/2];
    1492     do {
    1493         while ((pfnCompare)(lpPtrs[i], v, lParam) < 0) i++;
    1494         while ((pfnCompare)(lpPtrs[j], v, lParam) > 0) j--;
    1495         if (i <= j)
     1509
     1510    while ( i < j)
     1511    {
     1512        while ( (pfnCompare)( lpPtrs[i], v, lParam ) <= 0 && i < j )
     1513            i++;
     1514
     1515        while ( (pfnCompare)( v, lpPtrs[j], lParam ) <= 0 && i < j )
     1516            j--;
     1517
     1518        if ( i < j )
    14961519        {
     1520            /* Swap the values; increment i and decrement j to avoid
     1521               infinite conditions where i and j swap forever */
    14971522            t = lpPtrs[i];
    14981523            lpPtrs[i++] = lpPtrs[j];
    14991524            lpPtrs[j--] = t;
    15001525        }
    1501     } while (i <= j);
    1502     if (l < j) DPA_QuickSort (lpPtrs, l, j, pfnCompare, lParam);
    1503     if (i < r) DPA_QuickSort (lpPtrs, i, r, pfnCompare, lParam);
     1526    }
     1527
     1528    if ( i - 1 > l )
     1529        DPA_QuickSort (lpPtrs, l, i - 1, pfnCompare, lParam);
     1530    if ( j + 1 < r )
     1531        DPA_QuickSort (lpPtrs, j + 1, r, pfnCompare, lParam);
    15041532}
    15051533
Note: See TracChangeset for help on using the changeset viewer.