Changeset 672 for trunk/dll/draglist.c


Ignore:
Timestamp:
May 13, 2007, 5:57:48 AM (14 years ago)
Author:
Steven Levine
Message:

Use dcd->ulItemsToUnHilite
Sync UnHilite? calls with arg mods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/draglist.c

    r628 r672  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2002 Steven H.Levine
     9  Copyright (c) 2001, 2007 Steven H.Levine
    1010
    1111  16 Oct 02 SHL DoFileDrag: don't free stack
     
    1818  19 Apr 07 SHL Optimize DRAGITEM DRAGIMAGE array access
    1919  21 Apr 07 SHL Avoid odd first time drag failure
     20  12 May 07 SHL Use dcd->ulItemsToUnHilite
    2021
    2122***********************************************************************/
     
    9798# endif
    9899  if (!DrgFreeDraginfo(pDInfo)) {
    99     // fixme to find callers responsible for PMERR_SOURCE_SAME_AS_TARGET
    100     if ((WinGetLastError(WinQueryAnchorBlock(hwnd)) & 0xffff) != PMERR_SOURCE_SAME_AS_TARGET) {
    101       Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    102                "DrgFreeDraginfo");
     100    if ((WinGetLastError(WinQueryAnchorBlock(hwnd)) & 0xffff) == PMERR_SOURCE_SAME_AS_TARGET) {
     101      // fixme to find caller responsible for PMERR_SOURCE_SAME_AS_TARGET
     102      Win_Error_NoMsgBox(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__,
     103                         "DrgFreeDraginfo failed with PMERR_SOURCE_SAME_AS_TARGET");
    103104    }
    104105    else
    105       DbgMsg(pszSrcFile, __LINE__, "DrgFreeDraginfo PMERR_SOURCE_SAME_AS_TARGET");
     106      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, "DrgFreeDraginfo");
    106107  }
    107108}
     
    220221  BOOL ok;
    221222  UINT c;
     223  DIRCNRDATA *dcd;
    222224
    223225  static BOOL first_drag = TRUE;
    224226
    225   // fixme to be multi-drag safe - count needs to be in DCD etc. and passed to UnHilite
    226   NumItemsToUnhilite = 0;
     227  // Count items to unhilite, pass to UnHilite when partial unhilite required
     228  dcd = INSTDATA(hwndCnr);
     229  dcd->ulItemsToUnHilite = 0;
    227230  if (!pciRec && directory && *directory)
    228231    return DragOne(hwndCnr, hwndObj, directory, moveok);
     
    362365        }
    363366        // Set count to actual count + 1 to ensure count non-zero on any failure
    364         NumItemsToUnhilite = ulNumfiles + 1;
     367        dcd->ulItemsToUnHilite = ulNumfiles + 1;
    365368        break;
    366369      }
     
    424427          DrgDeleteStrHandle(pDItem->hstrTargetName);
    425428        xfree(pDItem);
    426         NumItemsToUnhilite = ulNumfiles + 1;    // +1 to ensure non-zero
     429        dcd->ulItemsToUnHilite = ulNumfiles + 1;        // +1 to ensure non-zero
    427430        break;
    428431     }
     
    480483          // Set count to actual count + 1 to ensure count non-zero on any failure
    481484          // Unhilite code will adjust this when unhighliting
    482           NumItemsToUnhilite = ulNumfiles + 1;
     485          dcd->ulItemsToUnHilite = ulNumfiles + 1;
    483486          break;
    484487        }
     
    558561
    559562  if (hDrop == NULLHANDLE ) {
    560     NumItemsToUnhilite = 0;
     563    dcd->ulItemsToUnHilite = 0;
    561564    if (pDInfo)
    562565      FreeDragInfoData(hwndCnr, pDInfo);
     
    587590  FILESTATUS3 fs3;
    588591  BOOL ok;
     592  DIRCNRDATA *dcd;
    589593
    590594  if (!list || !list[0])
    591595    return hDrop;
     596
     597  dcd = INSTDATA(hwnd);
     598
    592599  for (ulSelect = 0; list[ulSelect]; ulSelect++) {
    593600    if ((!IsRoot(list[ulSelect]) || !IsValidDrive(*list[ulSelect])) &&
     
    677684        xfree(pDItem);
    678685        // pDItem = NULL;       // Why bother, we can count - fixme to be gone
    679         NumItemsToUnhilite = ulNumfiles + 1;
     686        dcd->ulItemsToUnHilite = ulNumfiles + 1;
    680687        break;
    681688      }
     
    731738                      (PVOID) NULL);
    732739      if (hDrop == NULLHANDLE) {
    733         NumItemsToUnhilite = 0;
     740        dcd->ulItemsToUnHilite = 0;
    734741        FreeDragInfoData(hwnd, pDInfo);
    735742      }
Note: See TracChangeset for help on using the changeset viewer.