Changeset 3182 for trunk/src/comctl32/header.cpp
- Timestamp:
- Mar 21, 2000, 6:30:46 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/header.cpp
r3154 r3182 1 /* $Id: header.cpp,v 1. 3 2000-03-18 16:17:23cbratschi Exp $ */1 /* $Id: header.cpp,v 1.4 2000-03-21 17:30:41 cbratschi Exp $ */ 2 2 /* 3 3 * Header control … … 252 252 { 253 253 UINT uTextJustify; 254 WCHAR * pszText = phdi->pszText;254 WCHAR *pszText = phdi->pszText,*orgPtr; 255 255 256 256 if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_CENTER) … … 269 269 if (isUnicodeNotify(&infoPtr->header)) 270 270 { 271 nmhdr.pszText = (WCHAR*)COMCTL32_Alloc(phdi->cchTextMax*sizeof(WCHAR)); 271 orgPtr = (WCHAR*)COMCTL32_Alloc(phdi->cchTextMax*sizeof(WCHAR)); 272 nmhdr.pszText = orgPtr; 272 273 if (nmhdr.pszText) nmhdr.pszText[0] = 0; 273 274 } else 274 275 { 275 nmhdr.pszText = (WCHAR*)COMCTL32_Alloc(phdi->cchTextMax*sizeof(CHAR)); 276 orgPtr = (WCHAR*)COMCTL32_Alloc(phdi->cchTextMax*sizeof(CHAR)); 277 nmhdr.pszText = orgPtr; 276 278 if (nmhdr.pszText) ((LPSTR)nmhdr.pszText)[0] = 0; 277 279 } … … 291 293 lstrcpyW(phdi->pszText,pszText); 292 294 } else phdi->pszText = NULL; 293 COMCTL32_Free(pszText);295 if (pszText == orgPtr) COMCTL32_Free(pszText); 294 296 pszText = phdi->pszText; 295 297 } else … … 302 304 lstrcpyAtoW(pszText,(LPSTR)nmhdr.pszText); 303 305 } else pszText = NULL; 304 COMCTL32_Free(nmhdr.pszText); 305 306 if (nmhdr.mask & HDI_DI_SETITEM) 307 phdi->pszText = pszText; 306 if (nmhdr.pszText == orgPtr) COMCTL32_Free(nmhdr.pszText); 307 308 phdi->pszText = pszText; 308 309 } 309 310 } … … 329 330 } 330 331 } 331 if ( phdi->pszText == LPSTR_TEXTCALLBACKW) COMCTL32_Free(pszText);332 if ((phdi->pszText == LPSTR_TEXTCALLBACKW) && (pszText == orgPtr)) COMCTL32_Free(pszText); 332 333 } 333 334 … … 1642 1643 HEADER_SendItemClick(hwnd,infoPtr->iMoveItem,0); 1643 1644 } 1644 // TRACE (header, "Released item %d!\n", infoPtr->iMoveItem);1645 1645 infoPtr->bPressed = FALSE; 1646 1646 } else if (infoPtr->bTracking) 1647 1647 { 1648 // TRACE (header, "End tracking item %d!\n", infoPtr->iMoveItem);1649 1648 infoPtr->bTracking = FALSE; 1650 1649 … … 1666 1665 { 1667 1666 infoPtr->items[infoPtr->iMoveItem].cxy = nWidth; 1667 1668 HEADER_SetItemBounds (hwnd,infoPtr->iMoveItem); 1669 HEADER_Refresh(hwnd); 1668 1670 HEADER_SendItemChanged(hwnd,infoPtr->iMoveItem); 1669 1670 HEADER_SetItemBounds (hwnd,infoPtr->iMoveItem);1671 1672 HEADER_Refresh(hwnd);1673 1671 } 1674 1672 } … … 1816 1814 1817 1815 HEADER_SendTrack(hwnd,infoPtr->iMoveItem); 1818 // TRACE (header, "Tracking item %d!\n", infoPtr->iMoveItem);1819 1816 } 1820 1817 }
Note:
See TracChangeset
for help on using the changeset viewer.