Ignore:
Timestamp:
May 8, 2002, 1:26:30 PM (23 years ago)
Author:
sandervl
Message:

merge with latest Wine

File:
1 edited

Legend:

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

    r7815 r8382  
    55 *           1998 Juergen Schmied <j.schmied@metronet.de>
    66 *           2000 Eric Kohl for CodeWeavers
     7 *
     8 * This library is free software; you can redistribute it and/or
     9 * modify it under the terms of the GNU Lesser General Public
     10 * License as published by the Free Software Foundation; either
     11 * version 2.1 of the License, or (at your option) any later version.
     12 *
     13 * This library is distributed in the hope that it will be useful,
     14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     16 * Lesser General Public License for more details.
     17 *
     18 * You should have received a copy of the GNU Lesser General Public
     19 * License along with this library; if not, write to the Free Software
     20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    721 *
    822 * NOTES
     
    3448#include "comctl32.h"
    3549
    36 #include "debugtools.h"
    37 
    38 DEFAULT_DEBUG_CHANNEL(commctrl);
     50#include "wine/debug.h"
     51
     52WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
    3953
    4054
     
    206220    INT nCount;
    207221    LPVOID *pWork1, *pWork2;
    208     INT nResult;
     222    INT nResult, i;
    209223    INT nIndex;
    210224
     
    224238        return FALSE;
    225239
    226     if (dwFlags & DPAM_SORT) {
     240    if (!(dwFlags & DPAM_NOSORT)) {
    227241        TRACE("sorting dpa's!\n");
    228242        if (hdpa1->nItemCount > 0)
     
    251265    do
    252266    {
    253         if (nIndex < 0) break;
     267        if (nIndex < 0) {
     268            if ((nCount >= 0) && (dwFlags & DPAM_INSERT)) {
     269                /* Now insert the remaining new items into DPA 1 */
     270                TRACE("%d items to be inserted at start of DPA 1\n",
     271                      nCount+1);
     272                for (i=nCount; i>=0; i--) {
     273                    PVOID ptr;
     274
     275                    ptr = (pfnMerge)(3, *pWork2, NULL, lParam);
     276                    if (!ptr)
     277                        return FALSE;
     278                    DPA_InsertPtr (hdpa1, 0, ptr);
     279                    pWork2--;
     280                }
     281            }
     282            break;
     283        }
    254284        nResult = (pfnCompare)(*pWork1, *pWork2, lParam);
    255285        TRACE("compare result=%d, dpa1.cnt=%d, dpa2.cnt=%d\n",
     
    270300            pWork1--;
    271301        }
    272         else if (nResult < 0)
     302        else if (nResult > 0)
    273303        {
    274             if (!(dwFlags & 8))
     304            /* item in DPA 1 missing from DPA 2 */
     305            if (dwFlags & DPAM_DELETE)
    275306            {
     307                /* Now delete the extra item in DPA1 */
    276308                PVOID ptr;
    277309
     
    285317        else
    286318        {
    287             if (!(dwFlags & 4))
     319            /* new item in DPA 2 */
     320            if (dwFlags & DPAM_INSERT)
    288321            {
     322                /* Now insert the new item in DPA 1 */
    289323                PVOID ptr;
    290324
     
    292326                if (!ptr)
    293327                    return FALSE;
    294                 DPA_InsertPtr (hdpa1, nIndex, ptr);
     328                DPA_InsertPtr (hdpa1, nIndex+1, ptr);
    295329            }
    296330            nCount--;
     
    28002834   return TRUE;
    28012835}
    2802 
Note: See TracChangeset for help on using the changeset viewer.