Changeset 3216 for trunk/src


Ignore:
Timestamp:
Mar 24, 2000, 6:16:27 PM (25 years ago)
Author:
cbratschi
Message:

* empty log message *

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/listview.cpp

    r3203 r3216  
    1 /*$Id: listview.cpp,v 1.6 2000-03-23 17:14:34 cbratschi Exp $*/
     1/*$Id: listview.cpp,v 1.7 2000-03-24 17:14:02 cbratschi Exp $*/
    22/*
    33 * Listview control
     
    1313 * TODO:
    1414 *   - Hot item handling.
     15 *   - use hdpaSelItems for multisel
    1516 *
    1617 * Notifications:
     
    158159{
    159160  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    160   DWORD dwStyle;
    161   UINT uView;
    162161
    163162  if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;
    164163
    165   dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    166   uView =  dwStyle & LVS_TYPEMASK;
    167 
    168   if (uView == LVS_REPORT)
     164  if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER))
    169165  {
    170166    LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
     
    221217  if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;
    222218  LISTVIEW_GetItemRect(hwnd,nItem,&rect,LVIR_SELECTBOUNDS);
    223 //CB: todo: clip header
     219
     220  if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER))
     221  {
     222    RECT header;
     223    INT headerH;
     224
     225    GetWindowRect(infoPtr->hwndHeader,&header);
     226    headerH = rect.bottom-rect.top;
     227    if (rect.bottom <= headerH) return;
     228    if (rect.top < headerH) rect.top = headerH;
     229  }
     230
    224231  InvalidateRect(hwnd,&rect,TRUE);
    225232}
     
    233240  if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;
    234241  LISTVIEW_GetItemRect(hwnd,nItem,&rect,LVIR_SELECTBOUNDS);
    235 //CB: todo: clip header
     242
    236243  //get header rect
    237244  Header_GetItemRect(infoPtr->hwndHeader,nSubItem,&header);
     
    239246  rect.right = max(header.left,header.right-REPORT_MARGINX);
    240247
     248  if (!(infoPtr->dwStyle & LVS_NOCOLUMNHEADER))
     249  {
     250    INT headerH;
     251
     252    GetWindowRect(infoPtr->hwndHeader,&header);
     253    headerH = rect.bottom-rect.top;
     254    if (rect.bottom <= headerH) return;
     255    if (rect.top < headerH) rect.top = headerH;
     256  }
     257
    241258  /* Offset the Scroll Bar Pos */
    242259  rect.left -= xOffset;
     
    246263}
    247264
    248 static VOID LISTVIEW_ScrollWindow(HWND hwnd,INT xScroll,INT yScroll,UINT uView)
     265static VOID LISTVIEW_ScrollWindow(HWND hwnd,INT xScroll,INT yScroll)
    249266{
    250267  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
     
    252269  if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return;
    253270
    254   if (uView == LVS_REPORT)
     271  if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER))
    255272  {
    256273    RECT rect,header;
     
    263280    { //up
    264281      INT headerH = header.bottom-header.top;
    265 
     282//CB: redraw bug with _KeySelection
     283//UpdateWindow(hwnd);
     284//CB: inconsistent lefttop.y during this call
    266285      rect.top += headerH-yScroll;
    267286      if (rect.top < rect.bottom)
     
    270289        rect.top = rect.bottom+yScroll;
    271290        if (rect.top < headerH) rect.top = headerH;
    272         InvalidateRect(hwnd,&rect,TRUE);//CB: still wrong pixels
     291        InvalidateRect(hwnd,&rect,TRUE);
    273292      } else
    274293      {
     
    339358{
    340359  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    341   DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    342   UINT uView =  dwStyle & LVS_TYPEMASK;
    343360  INT nListHeight = infoPtr->rcList.bottom - infoPtr->rcList.top;
    344361  INT nListWidth = infoPtr->rcList.right - infoPtr->rcList.left;
    345362  SCROLLINFO scrollInfo;
    346363
    347   if (dwStyle & LVS_NOSCROLL)
     364  if (infoPtr->dwStyle & LVS_NOSCROLL)
    348365  {
    349366    infoPtr->lefttop.x = 0;
     
    353370    infoPtr->scrollStep = infoPtr->lefttop;
    354371    ShowScrollBar(hwnd,SB_BOTH,FALSE);
     372    //update scroll flags
     373    infoPtr->dwStyle =  GetWindowLongA(hwnd,GWL_STYLE);
    355374    return;
    356375  }
     
    359378  scrollInfo.cbSize = sizeof(SCROLLINFO);
    360379
    361   if (uView == LVS_LIST)
     380  if (infoPtr->uView == LVS_LIST)
    362381  {
    363382    /* update horizontal scrollbar */
     
    365384    INT nCountPerRow = LISTVIEW_GetCountPerRow(hwnd);
    366385    INT nNumOfItems = GETITEMCOUNT(infoPtr);
    367 
     386//CB: wrong
    368387    infoPtr->maxScroll.x = nNumOfItems / nCountPerColumn;
    369388    if ((nNumOfItems % nCountPerColumn) == 0)
     
    380399    scrollInfo.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
    381400    SetScrollInfo(hwnd,SB_HORZ,&scrollInfo,TRUE);
    382   } else if (uView == LVS_REPORT)
     401  } else if (infoPtr->uView == LVS_REPORT)
    383402  {
    384403    /* update vertical scrollbar */
     
    397416    /* update horizontal scrollbar */
    398417    nListWidth = infoPtr->rcList.right - infoPtr->rcList.left;
    399     if (!(dwStyle & WS_HSCROLL) || !GETITEMCOUNT(infoPtr))
     418    if (!(infoPtr->dwStyle & WS_HSCROLL) || !GETITEMCOUNT(infoPtr))
    400419      infoPtr->lefttop.x = 0;
    401420
     
    423442
    424443      /* Update Horizontal Scrollbar */
    425       if (!(dwStyle & WS_HSCROLL) || !GETITEMCOUNT(infoPtr))
     444      if (!(infoPtr->dwStyle & WS_HSCROLL) || !GETITEMCOUNT(infoPtr))
    426445        infoPtr->lefttop.x = 0;
    427446      infoPtr->maxScroll.x = max(nViewWidth / LISTVIEW_SCROLL_DIV_SIZE, 0);
     
    438457      /* Update Vertical Scrollbar */
    439458      nListHeight = infoPtr->rcList.bottom - infoPtr->rcList.top;
    440       if (!(dwStyle & WS_VSCROLL) || !GETITEMCOUNT(infoPtr))
     459      if (!(infoPtr->dwStyle & WS_VSCROLL) || !GETITEMCOUNT(infoPtr))
    441460        infoPtr->lefttop.x = 0;
    442461      infoPtr->maxScroll.y = max(nViewHeight / LISTVIEW_SCROLL_DIV_SIZE,0);
     
    452471    }
    453472  }
     473  //update scroll flags
     474  infoPtr->dwStyle =  GetWindowLongA(hwnd,GWL_STYLE);
    454475}
    455476
     
    467488static VOID LISTVIEW_UnsupportedStyles(LONG lStyle)
    468489{
    469   if ((LVS_TYPEMASK & lStyle) == LVS_EDITLABELS)
    470   {
    471     //FIXME("  LVS_EDITLABELS\n");
    472   }
    473 
    474490  if ((LVS_TYPEMASK & lStyle) == LVS_NOLABELWRAP)
    475491  {
     
    511527{
    512528  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    513   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    514529  INT nListWidth = infoPtr->rcList.right - infoPtr->rcList.left;
    515530  POINT ptItem;
     
    517532  INT i;
    518533
    519   if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
     534  if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON))
    520535  {
    521536    ZeroMemory(&ptItem, sizeof(POINT));
     
    568583{
    569584  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    570   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    571585  INT nListHeight = infoPtr->rcList.bottom - infoPtr->rcList.top;
    572586  POINT ptItem;
     
    574588  INT i;
    575589
    576   if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
     590  if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON))
    577591  {
    578592    ZeroMemory(&ptItem, sizeof(POINT));
     
    724738{
    725739  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    726   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    727740  INT nHeaderItemCount;
    728741  RECT rcHeaderItem;
     
    731744  INT i;
    732745
    733   if (uView == LVS_ICON)
     746  if (infoPtr->uView == LVS_ICON)
    734747  {
    735748    nItemWidth = infoPtr->iconSpacing.cx;
    736749  }
    737   else if (uView == LVS_REPORT)
     750  else if (infoPtr->uView == LVS_REPORT)
    738751  {
    739752    /* calculate width of header */
     
    807820{
    808821  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    809   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    810822  INT nHeaderItemCount;
    811823  RECT rcHeaderItem;
     
    813825  INT i;
    814826
    815 //  TRACE("(hwnd=%x)\n", hwnd);
    816 
    817   if (uView == LVS_ICON)
     827  if (infoPtr->uView == LVS_ICON)
    818828  {
    819829    nItemWidth = infoPtr->iconSpacing.cx;
    820830  }
    821   else if (uView == LVS_REPORT)
     831  else if (infoPtr->uView == LVS_REPORT)
    822832  {
    823833    /* calculate width of header */
     
    882892{
    883893  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    884   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    885894  INT nItemHeight = 0;
    886895
    887   if (uView == LVS_ICON)
     896  if (infoPtr->uView == LVS_ICON)
    888897  {
    889898    nItemHeight = infoPtr->iconSpacing.cy;
     
    10301039{
    10311040  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    1032   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    1033 
    1034   if ((uView == LVS_LIST) || (uView == LVS_REPORT))
     1041
     1042  if ((infoPtr->uView == LVS_LIST) || (infoPtr->uView == LVS_REPORT))
    10351043  {
    10361044    INT i;
     
    11121120{
    11131121  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    1114   DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    11151122  DWORD mask = LVIS_FOCUSED;
    11161123
    1117   if (!(dwStyle & LVS_SINGLESEL))
     1124  if (!(infoPtr->dwStyle & LVS_SINGLESEL))
    11181125  {
    11191126    if (nItem > 0)
     
    11461153{
    11471154  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    1148   LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);
    11491155  WORD wShift = HIWORD(GetKeyState(VK_SHIFT));
    11501156  WORD wCtrl = HIWORD(GetKeyState(VK_CONTROL));
     
    11521158  if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr)))
    11531159  {
    1154     if (lStyle & LVS_SINGLESEL)
     1160    if (infoPtr->dwStyle & LVS_SINGLESEL)
    11551161    {
    11561162      LISTVIEW_SetSelection(hwnd, nItem);
     
    11911197{
    11921198  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    1193   DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    1194   UINT uView =  dwStyle & LVS_TYPEMASK;
    11951199  RECT rcItem;
    11961200  INT i,nFirst = LISTVIEW_GetTopIndex(hwnd),nLast = GETITEMCOUNT(infoPtr);
     
    11991203  //    remove loop
    12001204
    1201   if (uView == LVS_REPORT)
     1205  if (infoPtr->uView == LVS_REPORT)
    12021206  {
    12031207    nLast = nFirst+LISTVIEW_GetCountPerColumn(hwnd)+2;
     
    14821486static BOOL LISTVIEW_InitItem(HWND hwnd,LISTVIEW_ITEM *lpItem,LPLVITEMW lpLVItem,BOOL unicode)
    14831487{
    1484   LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);
     1488  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    14851489  BOOL bResult = FALSE;
    14861490
     
    15161520        if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW)
    15171521        {
    1518           if ((lStyle & LVS_SORTASCENDING) || (lStyle & LVS_SORTDESCENDING))
     1522          if ((infoPtr->dwStyle & LVS_SORTASCENDING) || (infoPtr->dwStyle & LVS_SORTDESCENDING))
    15191523          {
    15201524            return FALSE;
     
    15421546        if ((LPSTR)lpLVItem->pszText == LPSTR_TEXTCALLBACKA)
    15431547        {
    1544           if ((lStyle & LVS_SORTASCENDING) || (lStyle & LVS_SORTDESCENDING))
     1548          if ((infoPtr->dwStyle & LVS_SORTASCENDING) || (infoPtr->dwStyle & LVS_SORTDESCENDING))
    15451549          {
    15461550            return FALSE;
     
    15961600static BOOL LISTVIEW_InitSubItem(HWND hwnd,LISTVIEW_SUBITEM *lpSubItem,LPLVITEMW lpLVItem,BOOL unicode)
    15971601{
    1598   LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);
     1602  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    15991603  BOOL bResult = FALSE;
    16001604
     
    16171621          if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW)
    16181622          {
    1619             if ((lStyle & LVS_SORTASCENDING) || (lStyle & LVS_SORTDESCENDING))
     1623            if ((infoPtr->dwStyle & LVS_SORTASCENDING) || (infoPtr->dwStyle & LVS_SORTDESCENDING))
    16201624              return FALSE;
    16211625
     
    16351639          if ((LPSTR)lpLVItem->pszText == LPSTR_TEXTCALLBACKA)
    16361640          {
    1637             if ((lStyle & LVS_SORTASCENDING) || (lStyle & LVS_SORTDESCENDING))
     1641            if ((infoPtr->dwStyle & LVS_SORTASCENDING) || (infoPtr->dwStyle & LVS_SORTDESCENDING))
    16381642              return FALSE;
    16391643
     
    16801684static BOOL LISTVIEW_AddSubItem(HWND hwnd, LPLVITEMW lpLVItem,BOOL unicode)
    16811685{
    1682   LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
     1686  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    16831687  LISTVIEW_SUBITEM *lpSubItem = NULL;
    16841688  BOOL bResult = FALSE;
     
    17971801static INT LISTVIEW_GetTopIndex(HWND hwnd)
    17981802{
    1799   LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    1800   DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE);
    1801   UINT uView = dwStyle & LVS_TYPEMASK;
     1803  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    18021804  INT nItem = 0;
    18031805
    1804   if (uView == LVS_LIST)
    1805   {
    1806     if (dwStyle & WS_HSCROLL)
     1806  if (infoPtr->uView == LVS_LIST)
     1807  {
     1808    if (infoPtr->dwStyle & WS_HSCROLL)
    18071809      nItem = infoPtr->lefttop.x*LISTVIEW_GetCountPerColumn(hwnd);
    1808   } else if (uView == LVS_REPORT)
    1809   {
    1810     if (dwStyle & WS_VSCROLL)
     1810  } else if (infoPtr->uView == LVS_REPORT)
     1811  {
     1812    if (infoPtr->dwStyle & WS_VSCROLL)
    18111813      nItem = infoPtr->lefttop.y;
    18121814  }
     
    19251927    nMixMode = SetROP2(hdc, R2_XORPEN);
    19261928  }
    1927   else if ((GetWindowLongA(hwnd, GWL_STYLE) & LVS_SHOWSELALWAYS) &&
     1929  else if ((infoPtr->dwStyle & LVS_SHOWSELALWAYS) &&
    19281930           (lvItem.header.state & LVIS_SELECTED) && !infoPtr->bFocus)
    19291931  {
     
    20672069{
    20682070  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    2069   DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    20702071  INT nDrawPosY = infoPtr->rcList.top;
    20712072  INT nColumnCount = Header_GetItemCount(infoPtr->hwndHeader);
     
    20802081
    20812082  /* send cache hint notification */
    2082   if (dwStyle & LVS_OWNERDATA)
     2083  if (infoPtr->dwStyle & LVS_OWNERDATA)
    20832084  {
    20842085    NMLVCACHEHINT nmlv;
     
    21012102
    21022103    /* Offset the Scroll Bar Pos */
    2103     if (dwStyle & WS_HSCROLL)
     2104    if (infoPtr->dwStyle & WS_HSCROLL)
    21042105    {
    21052106      rcHeader[j].left -= xOffset;
     
    21462147{
    21472148  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    2148   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    21492149  INT nListWidth = infoPtr->rcList.right - infoPtr->rcList.left;
    21502150  INT nCountPerRow = 1;
     
    21522152  if (nListWidth > 0)
    21532153  {
    2154     if (uView == LVS_REPORT)
     2154    if (infoPtr->uView == LVS_REPORT)
    21552155    {
    21562156      nCountPerRow = 1;
     
    22102210{
    22112211  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    2212   LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);
    22132212  INT nColumnCount = 0;
    22142213
    2215   if ((lStyle & LVS_TYPEMASK) == LVS_LIST)
     2214  if (infoPtr->uView == LVS_LIST)
    22162215  {
    22172216    if (infoPtr->rcList.right % infoPtr->nItemWidth == 0)
     
    23452344{
    23462345  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    2347   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    23482346  HFONT hOldFont;
    23492347  HPEN hPen, hOldPen;
     
    23592357  SelectObject(hdc, GetStockObject(NULL_BRUSH));
    23602358
    2361   switch (uView)
     2359  switch (infoPtr->uView)
    23622360  {
    23632361    case LVS_LIST:
     
    24032401                                            WORD wWidth, WORD wHeight)
    24042402{
    2405   LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    2406   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
     2403  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    24072404  INT nItemCountPerColumn = 1;
    24082405  INT nColumnCount = 0;
     
    24142411  }
    24152412
    2416   if (uView == LVS_LIST)
     2413  if (infoPtr->uView == LVS_LIST)
    24172414  {
    24182415    if (wHeight == 0xFFFF)
     
    24542451    dwViewRect = MAKELONG(wWidth, wHeight);
    24552452  }
    2456   else if (uView == LVS_REPORT)
     2453  else if (infoPtr->uView == LVS_REPORT)
    24572454  {
    24582455    /* TO DO */
    24592456  }
    2460   else if (uView == LVS_SMALLICON)
     2457  else if (infoPtr->uView == LVS_SMALLICON)
    24612458  {
    24622459    /* TO DO */
    24632460  }
    2464   else if (uView == LVS_ICON)
     2461  else if (infoPtr->uView == LVS_ICON)
    24652462  {
    24662463    /* TO DO */
     
    24842481static LRESULT LISTVIEW_Arrange(HWND hwnd, INT nAlignCode)
    24852482{
    2486   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
     2483  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    24872484  BOOL bResult = FALSE;
    24882485
    2489   if ((uView == LVS_ICON) || (uView == LVS_SMALLICON))
     2486  if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON))
    24902487  {
    24912488    switch (nAlignCode)
     
    25252522{
    25262523  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    2527   LONG lCtrlId = GetWindowLongA(hwnd, GWL_ID);
    2528   LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);
    2529   UINT uView = lStyle & LVS_TYPEMASK;
    25302524  LISTVIEW_ITEM *lpItem;
    25312525  LISTVIEW_SUBITEM *lpSubItem;
     
    26032597
    26042598    /* align items (set position of each item) */
    2605     if ((uView == LVS_ICON) || (uView == LVS_SMALLICON))
    2606     {
    2607       if (lStyle & LVS_ALIGNLEFT)
     2599    if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON))
     2600    {
     2601      if (infoPtr->dwStyle & LVS_ALIGNLEFT)
    26082602      {
    26092603        LISTVIEW_AlignLeft(hwnd);
     
    26392633{
    26402634  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    2641   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    26422635  BOOL bResult = FALSE;
    26432636
    2644   if (Header_DeleteItem(infoPtr->hwndHeader, nColumn) != FALSE)
     2637  if (Header_DeleteItem(infoPtr->hwndHeader, nColumn))
    26452638  {
    26462639    bResult = LISTVIEW_RemoveColumn(infoPtr->hdpaItems, nColumn);
     
    26502643
    26512644    /* reset scroll parameters */
    2652     if (uView == LVS_REPORT)
     2645    if (infoPtr->uView == LVS_REPORT)
    26532646    {
    26542647      /* update scrollbar(s) */
     
    26782671{
    26792672  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    2680   LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);
    2681   UINT uView = lStyle & LVS_TYPEMASK;
    26822673  NMLISTVIEW nmlv;
    26832674  BOOL bResult = FALSE;
     
    27372728
    27382729    /* align items (set position of each item) */
    2739     if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
    2740     {
    2741       if (lStyle & LVS_ALIGNLEFT)
     2730    if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON))
     2731    {
     2732      if (infoPtr->dwStyle & LVS_ALIGNLEFT)
    27422733      {
    27432734        LISTVIEW_AlignLeft(hwnd);
     
    28842875  WCHAR* textW = NULL;
    28852876
    2886   if (!(GetWindowLongA(hwnd, GWL_STYLE) & LVS_EDITLABELS))
     2877  if (!(infoPtr->dwStyle & LVS_EDITLABELS))
    28872878    return FALSE;
    28882879
     
    29722963{
    29732964  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    2974   DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    2975   UINT uView = dwStyle & LVS_TYPEMASK;
    29762965  SCROLLINFO scrollInfo;
    29772966  INT nScrollPosHeight = 0;
     
    29912980    if (rcItem.left < infoPtr->rcList.left)
    29922981    {
    2993       if (dwStyle & WS_HSCROLL)
     2982      if (infoPtr->dwStyle & WS_HSCROLL)
    29942983      {
    29952984        /* scroll left */
    2996         if (uView == LVS_LIST)
     2985        if (infoPtr->uView == LVS_LIST)
    29972986        {
    29982987          nScrollPosWidth = infoPtr->scrollStep.x;
    29992988          rcItem.left += infoPtr->rcList.left;
    3000         } else if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
     2989        } else if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON))
    30012990        {
    30022991          nScrollPosWidth = infoPtr->scrollStep.x;
     
    30223011    } else if (rcItem.right > infoPtr->rcList.right)
    30233012    {
    3024       if (dwStyle & WS_HSCROLL)
     3013      if (infoPtr->dwStyle & WS_HSCROLL)
    30253014      {
    30263015        /* scroll right */
    3027         if (uView == LVS_LIST)
     3016        if (infoPtr->uView == LVS_LIST)
    30283017        {
    30293018          rcItem.right -= infoPtr->rcList.right;
    30303019          nScrollPosWidth = infoPtr->scrollStep.x;
    3031         } else if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
     3020        } else if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON))
    30323021        {
    30333022          rcItem.right -= infoPtr->rcList.right;
     
    30583047    {
    30593048      /* scroll up */
    3060       if (dwStyle & WS_VSCROLL)
    3061       {
    3062         if (uView == LVS_REPORT)
     3049      if (infoPtr->dwStyle & WS_VSCROLL)
     3050      {
     3051        if (infoPtr->uView == LVS_REPORT)
    30633052        {
    30643053          rcItem.top -= infoPtr->rcList.top;
    30653054          nScrollPosHeight = infoPtr->scrollStep.y;
    30663055        }
    3067         else if ((uView == LVS_ICON) || (uView == LVS_SMALLICON))
     3056        else if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON))
    30683057        {
    30693058          nScrollPosHeight = infoPtr->scrollStep.y;
     
    30853074    {
    30863075      /* scroll down */
    3087       if (dwStyle & WS_VSCROLL)
    3088       {
    3089         if (uView == LVS_REPORT)
     3076      if (infoPtr->dwStyle & WS_VSCROLL)
     3077      {
     3078        if (infoPtr->uView == LVS_REPORT)
    30903079        {
    30913080          rcItem.bottom -= infoPtr->rcList.bottom;
    30923081          nScrollPosHeight = infoPtr->scrollStep.y;
    3093         } else if ((uView == LVS_ICON) || (uView == LVS_SMALLICON))
     3082        } else if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON))
    30943083        {
    30953084          nScrollPosHeight = infoPtr->scrollStep.x;
     
    31113100
    31123101  if ((oldlefttop.x != infoPtr->lefttop.x) || (oldlefttop.y != infoPtr->lefttop.y))
    3113     LISTVIEW_ScrollWindow(hwnd,(oldlefttop.x-infoPtr->lefttop.x)*infoPtr->scrollStep.x,(oldlefttop.y-infoPtr->lefttop.y)*infoPtr->scrollStep.y,uView);
     3102    LISTVIEW_ScrollWindow(hwnd,(oldlefttop.x-infoPtr->lefttop.x)*infoPtr->scrollStep.x,(oldlefttop.y-infoPtr->lefttop.y)*infoPtr->scrollStep.y);
    31143103
    31153104  return TRUE;
     
    35243513{
    35253514  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    3526   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    35273515  INT nColumnWidth = 0;
    35283516  HDITEMA hdi;
    35293517
    3530   if (uView == LVS_LIST)
     3518  if (infoPtr->uView == LVS_LIST)
    35313519  {
    35323520    nColumnWidth = infoPtr->nItemWidth;
    35333521  }
    3534   else if (uView == LVS_REPORT)
     3522  else if (infoPtr->uView == LVS_REPORT)
    35353523  {
    35363524    /* get column width from header */
     
    35613549{
    35623550  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    3563   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    35643551  INT nItemCount = 0;
    35653552
    3566   if (uView == LVS_LIST)
     3553  if (infoPtr->uView == LVS_LIST)
    35673554  {
    35683555    if (infoPtr->rcList.right > infoPtr->nItemWidth)
     
    35723559    }
    35733560  }
    3574   else if (uView == LVS_REPORT)
     3561  else if (infoPtr->uView == LVS_REPORT)
    35753562  {
    35763563    nItemCount = LISTVIEW_GetCountPerColumn(hwnd);
     
    41234110{
    41244111  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    4125   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    41264112  BOOL bResult = FALSE;
    41274113  HDPA hdpaSubItems;
     
    41334119      (lpptPosition != NULL))
    41344120  {
    4135     if (uView == LVS_LIST)
     4121    if (infoPtr->uView == LVS_LIST)
    41364122    {
    41374123      bResult = TRUE;
     
    41584144      }
    41594145    }
    4160     else if (uView == LVS_REPORT)
     4146    else if (infoPtr->uView == LVS_REPORT)
    41614147    {
    41624148      bResult = TRUE;
     
    42074193{
    42084194  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    4209   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    42104195  BOOL bResult = FALSE;
    42114196  POINT ptOrigin;
     
    42254210      {
    42264211      case LVIR_ICON:
    4227         if (uView == LVS_ICON)
     4212        if (infoPtr->uView == LVS_ICON)
    42284213        {
    42294214          if (infoPtr->himlNormal != NULL)
     
    42404225          }
    42414226        }
    4242         else if (uView == LVS_SMALLICON)
     4227        else if (infoPtr->uView == LVS_SMALLICON)
    42434228        {
    42444229          if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE)
     
    42824267
    42834268      case LVIR_LABEL:
    4284         if (uView == LVS_ICON)
     4269        if (infoPtr->uView == LVS_ICON)
    42854270        {
    42864271          if (infoPtr->himlNormal != NULL)
     
    43134298          }
    43144299        }
    4315         else if (uView == LVS_SMALLICON)
     4300        else if (infoPtr->uView == LVS_SMALLICON)
    43164301        {
    43174302          if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE)
     
    43734358
    43744359      case LVIR_BOUNDS:
    4375         if (uView == LVS_ICON)
     4360        if (infoPtr->uView == LVS_ICON)
    43764361        {
    43774362          if (infoPtr->himlNormal != NULL)
     
    43874372          }
    43884373        }
    4389         else if (uView == LVS_SMALLICON)
     4374        else if (infoPtr->uView == LVS_SMALLICON)
    43904375        {
    43914376          if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE)
     
    44344419
    44354420      case LVIR_SELECTBOUNDS:
    4436         if (uView == LVS_ICON)
     4421        if (infoPtr->uView == LVS_ICON)
    44374422        {
    44384423          if (infoPtr->himlNormal != NULL)
     
    44484433          }
    44494434        }
    4450         else if (uView == LVS_SMALLICON)
     4435        else if (infoPtr->uView == LVS_SMALLICON)
    44514436        {
    44524437          if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE)
     
    46584643{
    46594644  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    4660   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    46614645  UINT uMask = 0;
    46624646  LVFINDINFOW lvFindInfo;
     
    46824666    if (uFlags & LVNI_ABOVE)
    46834667    {
    4684       if ((uView == LVS_LIST) || (uView == LVS_REPORT))
     4668      if ((infoPtr->uView == LVS_LIST) || (infoPtr->uView == LVS_REPORT))
    46854669      {
    46864670        while (nItem >= 0)
     
    47054689    else if (uFlags & LVNI_BELOW)
    47064690    {
    4707       if ((uView == LVS_LIST) || (uView == LVS_REPORT))
     4691      if ((infoPtr->uView == LVS_LIST) || (infoPtr->uView == LVS_REPORT))
    47084692      {
    47094693        while (nItem < GETITEMCOUNT(infoPtr))
     
    47284712    else if (uFlags & LVNI_TOLEFT)
    47294713    {
    4730       if (uView == LVS_LIST)
     4714      if (infoPtr->uView == LVS_LIST)
    47314715      {
    47324716        nCountPerColumn = LISTVIEW_GetCountPerColumn(hwnd);
     
    47384722        }
    47394723      }
    4740       else if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
     4724      else if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON))
    47414725      {
    47424726        lvFindInfo.flags = LVFI_NEARESTXY;
     
    47524736    else if (uFlags & LVNI_TORIGHT)
    47534737    {
    4754       if (uView == LVS_LIST)
     4738      if (infoPtr->uView == LVS_LIST)
    47554739      {
    47564740        nCountPerColumn = LISTVIEW_GetCountPerColumn(hwnd);
     
    47624746        }
    47634747      }
    4764       else if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
     4748      else if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON))
    47654749      {
    47664750        lvFindInfo.flags = LVFI_NEARESTXY;
     
    48074791{
    48084792  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    4809   DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE);
    4810   UINT uView = dwStyle & LVS_TYPEMASK;
    4811 
    4812   if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
    4813   {
    4814     if (dwStyle & WS_HSCROLL)
     4793
     4794  if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON))
     4795  {
     4796    if (infoPtr->dwStyle & WS_HSCROLL)
    48154797      lpptOrigin->x = -infoPtr->lefttop.x*infoPtr->scrollStep.x;
    48164798    else
    48174799      lpptOrigin->x = 0;
    48184800
    4819     if (dwStyle & WS_VSCROLL)
     4801    if (infoPtr->dwStyle & WS_VSCROLL)
    48204802      lpptOrigin->y = -infoPtr->lefttop.y*infoPtr->scrollStep.y;
    48214803    else
     
    51435125      hdi.iOrder = lpColumn->iOrder;
    51445126    }
    5145 
     5127//CB: todo: use macros
    51465128    /* insert item in header control */
    51475129    if (unicode)
     
    51825164  LISTVIEW_ITEM* lv_first = (LISTVIEW_ITEM*) DPA_GetPtr( hdpa_first, 0 );
    51835165  LISTVIEW_ITEM* lv_second = (LISTVIEW_ITEM*) DPA_GetPtr( hdpa_second, 0 );
    5184   LONG lStyle = GetWindowLongA((HWND) lParam, GWL_STYLE);
     5166  LONG dwStyle = GetWindowLongA((HWND) lParam, GWL_STYLE);
    51855167  INT  cmpv = lstrcmpW( lv_first->pszText, lv_second->pszText );
    51865168  /* if we're sorting descending, negate the return value */
    5187   return (lStyle & LVS_SORTDESCENDING) ? -cmpv : cmpv;
     5169  return (dwStyle & LVS_SORTDESCENDING) ? -cmpv : cmpv;
    51885170}
    51895171
     
    52035185{
    52045186  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    5205   DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    5206   UINT uView = dwStyle & LVS_TYPEMASK;
    5207   LONG lCtrlId = GetWindowLongA(hwnd,GWL_ID);
    52085187  NMLISTVIEW nmlv;
    52095188  INT nItem = -1;
     
    52215200      {
    52225201        ZeroMemory(lpItem, sizeof(LISTVIEW_ITEM));
    5223         if (LISTVIEW_InitItem(hwnd, lpItem, lpLVItem,unicode) != FALSE)
     5202        if (LISTVIEW_InitItem(hwnd, lpItem, lpLVItem,unicode))
    52245203        {
    52255204          /* insert item in listview control data structure */
    52265205          hdpaSubItems = DPA_Create(8);
    5227           if (hdpaSubItems != NULL)
     5206          if (hdpaSubItems)
    52285207          {
    52295208            nItem = DPA_InsertPtr(hdpaSubItems, 0, lpItem);
    52305209            if (nItem != -1)
    52315210            {
    5232               if ( ((dwStyle & LVS_SORTASCENDING) || (dwStyle & LVS_SORTDESCENDING))
    5233                       && !(dwStyle & LVS_OWNERDRAWFIXED)
     5211              if ( ((infoPtr->dwStyle & LVS_SORTASCENDING) || (infoPtr->dwStyle & LVS_SORTDESCENDING))
     5212                      && !(infoPtr->dwStyle & LVS_OWNERDRAWFIXED)
    52345213                      && (LPSTR_TEXTCALLBACKW != lpLVItem->pszText) )
    52355214              {
     
    52695248                sendNotify(hwnd,LVN_INSERTITEM,&nmlv.hdr);
    52705249
    5271                 if ((uView == LVS_SMALLICON) || (uView == LVS_LIST))
     5250                if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_LIST))
    52725251                {
    52735252                  nItemWidth = LISTVIEW_CalculateWidth(hwnd, lpLVItem->iItem);
     
    52795258
    52805259                /* align items (set position of each item) */
    5281                 if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
     5260                if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON))
    52825261                {
    5283                   if (dwStyle & LVS_ALIGNLEFT)
     5262                  if (infoPtr->dwStyle & LVS_ALIGNLEFT)
    52845263                  {
    52855264                    LISTVIEW_AlignLeft(hwnd);
     
    55485527    HDITEMA hdi;
    55495528    LRESULT lret;
    5550     LONG lStyle;
    55515529
    55525530    // set column width only if in report mode
    5553     lStyle = GetWindowLongA(hwnd, GWL_STYLE);
    5554     if ((lStyle & LVS_TYPEMASK) != LVS_REPORT)
     5531    if (infoPtr->uView != LVS_REPORT)
    55555532        return (FALSE);
    55565533
     
    57875764    return LISTVIEW_DeleteAllItems (hwnd);
    57885765
    5789   if (GetWindowLongA(hwnd, GWL_STYLE) & LVS_OWNERDATA)
     5766  if (infoPtr->dwStyle & LVS_OWNERDATA)
    57905767  {
    57915768//    FIXME("LVS_OWNERDATA is set!\n");
     
    58275804{
    58285805  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    5829   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    58305806  LISTVIEW_ITEM *lpItem;
    58315807  HDPA hdpaSubItems;
     
    58345810  if ((nItem >= 0) || (nItem < GETITEMCOUNT(infoPtr)))
    58355811  {
    5836     if ((uView == LVS_ICON) || (uView == LVS_SMALLICON))
     5812    if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON))
    58375813    {
    58385814      hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem);
     
    61316107
    61326108        DPA_Destroy(sortList);
     6109        LISTVIEW_Refresh(hwnd);
    61336110    }
    61346111
     
    61536130{
    61546131  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    6155   LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);
    61566132  BOOL bResult = FALSE;
    61576133  RECT rc;
     
    61626138
    61636139    /* rearrange with default alignment style */
    6164     if ((lStyle & LVS_AUTOARRANGE) && (((lStyle & LVS_TYPEMASK) == LVS_ICON) ||
    6165         ((lStyle & LVS_TYPEMASK)  == LVS_SMALLICON)))
     6140    if ((infoPtr->dwStyle & LVS_AUTOARRANGE) && ((infoPtr->uView == LVS_ICON) ||
     6141        (infoPtr->uView  == LVS_SMALLICON)))
    61666142    {
    61676143      LISTVIEW_Arrange(hwnd, 0);
     
    62036179
    62046180  /* set default values */
     6181  infoPtr->dwStyle = lpcs->style;
     6182  infoPtr->uView = uView;
    62056183  infoPtr->uCallbackMask = 0;
    62066184  infoPtr->nFocusedItem = -1;
     
    62516229  }
    62526230
    6253   /* display unsupported listview window styles */
    6254   LISTVIEW_UnsupportedStyles(lpcs->style);
    6255 
    62566231  /* allocate memory for the data structure */
    6257   infoPtr->hdpaItems = DPA_Create(10);
     6232  infoPtr->hdpaItems = DPA_Create(64);
     6233  infoPtr->hdpaSelItems = DPA_Create(10);
    62586234
    62596235  /* initialize size of items */
     
    63826358    SCROLLINFO scrollInfo;
    63836359    RECT rect;
    6384     DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    6385     UINT uView =  dwStyle & LVS_TYPEMASK;
    63866360    INT yScroll = (oldY-infoPtr->lefttop.y)*infoPtr->nItemHeight;
    63876361
     
    63926366    SetScrollInfo(hwnd,SB_VERT,&scrollInfo,TRUE);
    63936367
    6394     LISTVIEW_ScrollWindow(hwnd,0,yScroll,uView);
     6368    LISTVIEW_ScrollWindow(hwnd,0,yScroll);
    63956369
    63966370    return TRUE;
     
    64666440    SCROLLINFO scrollInfo;
    64676441    RECT rect;
    6468     DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    6469     UINT uView =  dwStyle & LVS_TYPEMASK;
    64706442    INT xScroll = (oldX-infoPtr->lefttop.x)*infoPtr->scrollStep.x;
    64716443
     
    64766448    SetScrollInfo(hwnd,SB_HORZ,&scrollInfo,TRUE);
    64776449
    6478     LISTVIEW_ScrollWindow(hwnd,xScroll,0,uView);
     6450    LISTVIEW_ScrollWindow(hwnd,xScroll,0);
    64796451  }
    64806452
     
    64876459    INT gcWheelDelta = 0;
    64886460    UINT pulScrollLines = 3;
    6489     DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    6490     UINT uView = dwStyle & LVS_TYPEMASK;
    64916461
    64926462    SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
    64936463    gcWheelDelta -= wheelDelta;
    64946464
    6495     switch(uView)
     6465    switch(infoPtr->uView)
    64966466    {
    64976467      case LVS_ICON:
     
    65016471        *  should be fixed in the future.
    65026472        */
    6503         if (dwStyle & WS_VSCROLL)
     6473        if (infoPtr->dwStyle & WS_VSCROLL)
    65046474          LISTVIEW_VScroll(hwnd,SB_THUMBPOSITION,infoPtr->lefttop.y+(gcWheelDelta < 0) ? 37:-37,0);
    65056475        break;
     
    65086478        if (abs(gcWheelDelta) >= WHEEL_DELTA && pulScrollLines)
    65096479        {
    6510           if (dwStyle & WS_VSCROLL)
     6480          if (infoPtr->dwStyle & WS_VSCROLL)
    65116481          {
    65126482            int cLineScroll = min(LISTVIEW_GetCountPerColumn(hwnd), pulScrollLines);
     
    69206890{
    69216891  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    6922   LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);
    69236892  static BOOL bGroupSelect = TRUE;
    69246893  POINT ptPosition;
     
    69396908  if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr)))
    69406909  {
    6941     if (lStyle & LVS_SINGLESEL)
     6910    if (infoPtr->dwStyle & LVS_SINGLESEL)
    69426911    {
    69436912      if ((LISTVIEW_GetItemState(hwnd, nItem, LVIS_SELECTED) & LVIS_SELECTED) && infoPtr->bDoEditLabel != TRUE)
     
    70717040  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    70727041
    7073   //TRACE("(hwnd=%x)\n", hwnd);
    7074 
    70757042  /* delete all items */
    70767043  LISTVIEW_DeleteAllItems(hwnd);
     
    70787045  /* destroy data structure */
    70797046  DPA_Destroy(infoPtr->hdpaItems);
     7047  DPA_Destroy(infoPtr->hdpaSelItems);
    70807048
    70817049  /* destroy font */
     
    73277295{
    73287296  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    7329   UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;
    7330 
    7331 //  TRACE("(hwnd=%x,hfont=%x,redraw=%hu)\n", hwnd, hFont, fRedraw);
    73327297
    73337298  if (hFont == 0)
     
    73407305  }
    73417306
    7342   if (uView == LVS_REPORT)
     7307  if (infoPtr->uView == LVS_REPORT)
    73437308  {
    73447309    /* set header font */
     
    74097374{
    74107375  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    7411   DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    7412   UINT uView = dwStyle & LVS_TYPEMASK;
    74137376
    74147377  LISTVIEW_UpdateSize(hwnd);
    74157378  LISTVIEW_UpdateScroll(hwnd);
    74167379
    7417   if ((uView == LVS_SMALLICON) || (uView == LVS_ICON))
    7418   {
    7419     if (dwStyle & LVS_ALIGNLEFT)
     7380  if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON))
     7381  {
     7382    if (infoPtr->dwStyle & LVS_ALIGNLEFT)
    74207383      LISTVIEW_AlignLeft(hwnd);
    74217384    else
     
    74387401{
    74397402  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    7440   LONG dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    7441   UINT uView = dwStyle & LVS_TYPEMASK;
    74427403  RECT rcList;
    74437404
     
    74487409  infoPtr->rcList.bottom = max(rcList.bottom - rcList.top, 1);
    74497410
    7450   if (uView == LVS_LIST)
    7451   {
    7452     if (!(dwStyle & WS_HSCROLL))
     7411  if (infoPtr->uView == LVS_LIST)
     7412  {
     7413    if (!(infoPtr->dwStyle & WS_HSCROLL))
    74537414    {
    74547415      INT nHScrollHeight = GetSystemMetrics(SM_CYHSCROLL);
     
    74587419      }
    74597420    }
    7460   } else if (uView == LVS_REPORT)
    7461   {
    7462     if (!(dwStyle & LVS_NOCOLUMNHEADER))
     7421  } else if (infoPtr->uView == LVS_REPORT)
     7422  {
     7423    if (!(infoPtr->dwStyle & LVS_NOCOLUMNHEADER))
    74637424    {
    74647425      HDLAYOUT hl;
     
    74967457  if (wStyleType == GWL_STYLE)
    74977458  {
     7459    infoPtr->dwStyle = lpss->styleNew;
     7460    infoPtr->uView = lpss->styleNew & LVS_TYPEMASK;
    74987461    if (uOldView == LVS_REPORT)
    74997462    {
  • trunk/src/comdlg32/comdlg32.cpp

    r3192 r3216  
    1 /* $Id: comdlg32.cpp,v 1.23 2000-03-22 16:55:00 cbratschi Exp $ */
     1/* $Id: comdlg32.cpp,v 1.24 2000-03-24 17:16:26 cbratschi Exp $ */
    22
    33/*
     
    2626ODINDEBUGCHANNEL(COMDLG32-COMDLG32)
    2727
    28 BOOL useWinFileDlg = FALSE;
     28BOOL useWinFileDlg = TRUE;
    2929
    3030#if 0
  • trunk/src/comdlg32/filedlg95.c

    r3202 r3216  
    12041204          /* Browse to the right directory */
    12051205          COMDLG32_SHGetDesktopFolder(&psfDesktop);
    1206           if((browsePidl = GetPidlFromName(psfDesktop,lpstrPathSpec)))
     1206          browsePidl = GetPidlFromName(psfDesktop,lpstrPathSpec);
     1207          if(browsePidl)
    12071208          {
    12081209              /* Browse to directory */
     
    12931294         {
    12941295             int i;
    1295              if ((lpstrExt = strchr(lpOrg, ';')))
     1296             lpstrExt = strchr(lpOrg, ';');
     1297             if (lpstrExt)
    12961298             {
    12971299                 i = lpstrExt - lpOrg;
     
    14421444          if((LPSTR)-1 != lpstrTemp)
    14431445          {
    1444               if((lpstrExt = strchr(lpstrTemp,';')))
     1446              lpstrExt = strchr(lpstrTemp,';');
     1447              if(lpstrExt)
    14451448              {
    14461449                  int i = lpstrExt - lpstrTemp;
     
    19481951    INT len;
    19491952
     1953    //CB: skip A:,B: SHGFI_DISPLAYNAME for faster handling?
     1954
    19501955    tmpFolder->ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR)tmpFolder->pidlItem,
    19511956                                                  0,
  • trunk/src/comdlg32/filedlgbrowser.c

    r2607 r3216  
    11/*
    22 *  Implementation of IShellBrowser for the File Open common dialog
    3  *
    43 *
    54 */
     
    9089*   External Prototypes
    9190*/
    92 extern const char *FileOpenDlgInfosStr; 
     91extern const char *FileOpenDlgInfosStr;
    9392
    9493extern HRESULT          GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrFileName);
     
    149148*/
    150149HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
    151                                             REFIID riid, 
     150                                            REFIID riid,
    152151                                            LPVOID *ppvObj)
    153152{
     
    159158
    160159    if(IsEqualIID(riid, &IID_IUnknown))          /*IUnknown*/
    161     { *ppvObj = This; 
     160    { *ppvObj = This;
    162161    }
    163162    else if(IsEqualIID(riid, &IID_IOleWindow))  /*IOleWindow*/
     
    201200    TRACE("(%p)\n", This);
    202201
    203     if (!--(This->ref)) 
    204     { 
     202    if (!--(This->ref))
     203    {
    205204      COMDLG32_SHFree(This);
    206205      return 0;
     
    221220*
    222221*  Note : We will never be window less in the File Open dialog
    223 * 
    224 */
    225 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface, 
     222*
     223*/
     224HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,
    226225                                           HWND * phwnd)
    227226{
     
    235234    *phwnd = This->hwndOwner;
    236235
    237     return (*phwnd) ? S_OK : E_UNEXPECTED; 
     236    return (*phwnd) ? S_OK : E_UNEXPECTED;
    238237
    239238}
     
    262261*  See Windows documentation on IShellBrowser::BrowseObject for more details
    263262*
    264 *  This function will override user specified flags and will always 
    265 *  use SBSP_DEFBROWSER and SBSP_DEFMODE. 
    266 */
    267 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, 
    268                                               LPCITEMIDLIST pidl, 
     263*  This function will override user specified flags and will always
     264*  use SBSP_DEFBROWSER and SBSP_DEFMODE.
     265*/
     266HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
     267                                              LPCITEMIDLIST pidl,
    269268                                              UINT wFlags)
    270269{
     
    284283    if(wFlags & SBSP_RELATIVE)
    285284    {
    286        
     285
    287286        /* SBSP_RELATIVE  A relative pidl (relative from the current folder) */
    288287        hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder,
     
    298297        pidlTmp = COMDLG32_PIDL_ILCombine(fodInfos->ShellInfos.pidlAbsCurrent,
    299298                                                        (LPITEMIDLIST)pidl);
    300        
     299
    301300    }
    302301    else if(wFlags & SBSP_PARENT)
    303302    {
    304303        /* Browse the parent folder (ignores the pidl) */
    305        
     304
    306305        pidlTmp = GetParentPidl(fodInfos->ShellInfos.pidlAbsCurrent);
    307306        psfTmp = GetShellFolderFromPidl(pidlTmp);
     
    315314    }
    316315
    317    
     316
    318317    /* Retrieve the IShellFolder interface of the pidl specified folder */
    319318    if(!psfTmp)
    320319        return E_FAIL;
    321320
    322     /* If the pidl to browse to is equal to the actual pidl ... 
     321    /* If the pidl to browse to is equal to the actual pidl ...
    323322       do nothing and pretend you did it*/
    324323    if(COMDLG32_PIDL_ILIsEqual(pidlTmp,fodInfos->ShellInfos.pidlAbsCurrent))
    325324    {
    326325        IShellFolder_Release(psfTmp);
    327         COMDLG32_SHFree(pidlTmp);
     326        COMDLG32_SHFree(pidlTmp);
    328327        return NOERROR;
    329328    }
     
    342341        /* Get the foldersettings from the old view */
    343342        if(fodInfos->Shell.FOIShellView)
    344         { 
    345           IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, 
     343        {
     344          IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView,
    346345                                  &fodInfos->ShellInfos.folderSettings);
    347346        }
     
    364363
    365364            /* Select the new folder in the Look In combo box of the Open file dialog */
    366            
     365
    367366            FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,pidlTmp);
    368367
     
    383382
    384383            fodInfos->ShellInfos.hwndView = hwndView;
    385            
     384
    386385            return NOERROR;
    387386        }
     
    389388
    390389    FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent);
    391     return hRes; 
     390    return hRes;
    392391}
    393392
     
    395394*  IShellBrowserImpl_EnableModelessSB
    396395*/
    397 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,   
     396HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,
    398397                                              BOOL fEnable)
    399                                              
     398
    400399{
    401400    ICOM_THIS(IShellBrowserImpl, iface);
     
    410409*  IShellBrowserImpl_GetControlWindow
    411410*/
    412 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,   
    413                                               UINT id,   
     411HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,
     412                                              UINT id,
    414413                                              HWND *lphwnd)
    415                                              
     414
    416415{
    417416    ICOM_THIS(IShellBrowserImpl, iface);
     
    426425*/
    427426HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
    428                                                 DWORD grfMode,   
     427                                                DWORD grfMode,
    429428                                                LPSTREAM *ppStrm)
    430                                              
    431 {
    432     ICOM_THIS(IShellBrowserImpl, iface);
    433 
    434     TRACE("(%p)\n", This);
    435 
    436     /* Feature not implemented */
    437     return E_NOTIMPL;
    438 }       
     429
     430{
     431    ICOM_THIS(IShellBrowserImpl, iface);
     432
     433    TRACE("(%p)\n", This);
     434
     435    /* Feature not implemented */
     436    return E_NOTIMPL;
     437}
    439438/**************************************************************************
    440439*  IShellBrowserImpl_InsertMenusSB
     
    443442                                           HMENU hmenuShared,
    444443                                           LPOLEMENUGROUPWIDTHS lpMenuWidths)
    445                                              
     444
    446445{
    447446    ICOM_THIS(IShellBrowserImpl, iface);
     
    457456HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
    458457                                                IShellView *ppshv)
    459                                              
    460 {
    461     ICOM_THIS(IShellBrowserImpl, iface);
    462 
    463     TRACE("(%p)\n", This);
    464 
    465     /* Feature not implemented */
    466     return E_NOTIMPL;
    467 }   
     458
     459{
     460    ICOM_THIS(IShellBrowserImpl, iface);
     461
     462    TRACE("(%p)\n", This);
     463
     464    /* Feature not implemented */
     465    return E_NOTIMPL;
     466}
    468467/**************************************************************************
    469468*  IShellBrowserImpl_QueryActiveShellView
     
    471470HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
    472471                                                  IShellView **ppshv)
    473                                              
     472
    474473{
    475474    ICOM_THIS(IShellBrowserImpl, iface);
     
    487486    IShellView_AddRef(fodInfos->Shell.FOIShellView);
    488487    return NOERROR;
    489 }   
     488}
    490489/**************************************************************************
    491490*  IShellBrowserImpl_RemoveMenusSB
     
    493492HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
    494493                                           HMENU hmenuShared)
    495                                              
    496 {
    497     ICOM_THIS(IShellBrowserImpl, iface);
    498 
    499     TRACE("(%p)\n", This);
    500 
    501     /* Feature not implemented */
    502     return E_NOTIMPL;
    503 }   
     494
     495{
     496    ICOM_THIS(IShellBrowserImpl, iface);
     497
     498    TRACE("(%p)\n", This);
     499
     500    /* Feature not implemented */
     501    return E_NOTIMPL;
     502}
    504503/**************************************************************************
    505504*  IShellBrowserImpl_SendControlMsg
    506505*/
    507 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,   
    508                                             UINT id,   
    509                                             UINT uMsg,   
    510                                             WPARAM wParam,   
     506HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
     507                                            UINT id,
     508                                            UINT uMsg,
     509                                            WPARAM wParam,
    511510                                            LPARAM lParam,
    512511                                            LRESULT *pret)
    513                                              
     512
    514513{
    515514    ICOM_THIS(IShellBrowserImpl, iface);
    516515    LRESULT lres;
    517    
     516
    518517    TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This, id, uMsg, wParam, lParam, pret);
    519518
     
    522521      case FCW_TOOLBAR:
    523522        lres = SendDlgItemMessageA( This->hwndOwner, IDC_TOOLBAR, uMsg, wParam, lParam);
    524         break;
     523        break;
    525524      default:
    526525        FIXME("ctrl id: %x\n", id);
     
    534533*/
    535534HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
    536                                        HMENU hmenuShared,   
     535                                       HMENU hmenuShared,
    537536                                       HOLEMENU holemenuReserved,
    538537                                       HWND hwndActiveObject)
    539                                              
    540 {
    541     ICOM_THIS(IShellBrowserImpl, iface);
    542 
    543     TRACE("(%p)\n", This);
    544 
    545     /* Feature not implemented */
    546     return E_NOTIMPL;
    547 }   
     538
     539{
     540    ICOM_THIS(IShellBrowserImpl, iface);
     541
     542    TRACE("(%p)\n", This);
     543
     544    /* Feature not implemented */
     545    return E_NOTIMPL;
     546}
    548547/**************************************************************************
    549548*  IShellBrowserImpl_SetStatusTextSB
     
    551550HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
    552551                                             LPCOLESTR lpszStatusText)
    553                                              
    554 {
    555     ICOM_THIS(IShellBrowserImpl, iface);
    556 
    557     TRACE("(%p)\n", This);
    558 
    559     /* Feature not implemented */
    560     return E_NOTIMPL;
    561 }   
     552
     553{
     554    ICOM_THIS(IShellBrowserImpl, iface);
     555
     556    TRACE("(%p)\n", This);
     557
     558    /* Feature not implemented */
     559    return E_NOTIMPL;
     560}
    562561/**************************************************************************
    563562*  IShellBrowserImpl_SetToolbarItems
    564563*/
    565564HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
    566                                              LPTBBUTTON lpButtons,   
    567                                              UINT nButtons,   
     565                                             LPTBBUTTON lpButtons,
     566                                             UINT nButtons,
    568567                                             UINT uFlags)
    569                                              
    570 {
    571     ICOM_THIS(IShellBrowserImpl, iface);
    572 
    573     TRACE("(%p)\n", This);
    574 
    575     /* Feature not implemented */
    576     return E_NOTIMPL;
    577 }   
     568
     569{
     570    ICOM_THIS(IShellBrowserImpl, iface);
     571
     572    TRACE("(%p)\n", This);
     573
     574    /* Feature not implemented */
     575    return E_NOTIMPL;
     576}
    578577/**************************************************************************
    579578*  IShellBrowserImpl_TranslateAcceleratorSB
    580579*/
    581580HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
    582                                                     LPMSG lpmsg,   
     581                                                    LPMSG lpmsg,
    583582                                                    WORD wID)
    584                                              
     583
    585584{
    586585    ICOM_THIS(IShellBrowserImpl, iface);
     
    600599*/
    601600HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(ICommDlgBrowser *iface,
    602                                             REFIID riid, 
     601                                            REFIID riid,
    603602                                            LPVOID *ppvObj)
    604603{
     
    648647    TRACE("(%p)\n", This);
    649648
    650     fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 
    651    
     649    fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
     650
    652651    /* If the selected object is not a folder, send a IDOK command to parent window */
    653     if((pidl = GetSelectedPidl(ppshv)))
     652    pidl = GetSelectedPidl(ppshv);
     653    if (pidl)
    654654    {
    655655        HRESULT hRes;
     
    657657        ULONG  ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
    658658        IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
    659         if (ulAttr)
     659        if (ulAttr)
    660660            hRes = IShellBrowser_BrowseObject((IShellBrowser *)This,pidl,SBSP_RELATIVE);
    661661        /* Tell the dialog that the user selected a file */
    662662        else
    663         {
     663        {
    664664            hRes = FILEDLG95_OnOpen(This->hwndOwner);
    665         }
     665        }
    666666
    667667        /* Free memory used by pidl */
     
    690690        case CDBOSC_SETFOCUS:
    691691            break;
    692         case CDBOSC_KILLFOCUS: 
    693             {
    694                 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
    695                 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
    696                     SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
     692        case CDBOSC_KILLFOCUS:
     693            {
     694                FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
     695                if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
     696                    SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
    697697            }
    698698            break;
     
    703703    }
    704704
    705     return NOERROR;     
     705    return NOERROR;
    706706}
    707707/**************************************************************************
    708708*  IShellBrowserImpl_ICommDlgBrowser_IncludeObject
    709709*/
    710 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, 
     710HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface,
    711711                                                               IShellView * ppshv,
    712712                                                               LPCITEMIDLIST pidl)
     
    725725    ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK;
    726726    IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
    727    
    728 
    729     if( (ulAttr & SFGAO_HIDDEN)                                         /* hidden */
    730       | !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */
     727
     728
     729    if( (ulAttr & SFGAO_HIDDEN)                                         /* hidden */
     730      | !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */
    731731        return S_FALSE;
    732732    /* always include directorys and links */
    733     if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK)) 
     733    if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK))
    734734        return S_OK;
    735735    /* Check if there is a mask to apply if not */
     
    741741    { if (SUCCEEDED(StrRetToBufW(&str, pidl,szPathW, MAX_PATH)))
    742742      {
    743           if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
     743          if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
    744744          return S_OK;
    745745      }
     
    751751/**************************************************************************
    752752*  IShellBrowserImpl_ICommDlgBrowser_OnSelChange
    753 */ 
     753*/
    754754HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv)
    755755{
     
    761761    TRACE("(%p)\n", This);
    762762
    763     if((pidl = GetSelectedPidl(ppshv)))
     763    pidl = GetSelectedPidl(ppshv);
     764    if (pidl)
    764765    {
    765766        HRESULT hRes = E_FAIL;
    766767        char lpstrFileName[MAX_PATH];
    767    
    768768        ULONG  ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
     769
    769770        IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
    770771        if (!ulAttr)
     
    772773            if(SUCCEEDED(hRes = GetName(fodInfos->Shell.FOIShellFolder,pidl,SHGDN_NORMAL,lpstrFileName)))
    773774                SetWindowTextA(fodInfos->DlgInfos.hwndFileName,lpstrFileName);
    774             if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
    775                     SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
     775            if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
     776                    SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
    776777        }
    777         else
    778             SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Open");
    779 
    780         fodInfos->DlgInfos.dwDlgProp |= FODPROP_USEVIEW;
     778        else
     779            SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Open");
     780
     781        fodInfos->DlgInfos.dwDlgProp |= FODPROP_USEVIEW;
    781782
    782783        COMDLG32_SHFree((LPVOID)pidl);
     
    785786    }
    786787    if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
    787         SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
     788        SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
    788789
    789790    fodInfos->DlgInfos.dwDlgProp &= ~FODPROP_USEVIEW;
     
    812813        STGMEDIUM medium;
    813814        FORMATETC formatetc;
    814        
     815
    815816        /* Set the FORMATETC structure*/
    816817        SETDefFormatEtc(formatetc,
     
    822823        {
    823824            LPIDA cida = GlobalLock(medium.u.hGlobal);
    824             TRACE("cida=%p\n", cida);
     825            TRACE("cida=%p\n", cida);
    825826            pidlSelected =  COMDLG32_PIDL_ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[1]]));
    826827
     
    828829                IUnknown_Release(medium.pUnkForRelease);
    829830            else
    830             {
    831               GlobalUnlock(medium.u.hGlobal);
    832               GlobalFree(medium.u.hGlobal);
    833             }
     831            {
     832              GlobalUnlock(medium.u.hGlobal);
     833              GlobalFree(medium.u.hGlobal);
     834            }
    834835        }
    835836        IDataObject_Release(doSelected);
Note: See TracChangeset for help on using the changeset viewer.