Changeset 236 for trunk/src/comctl32/status.c
- Timestamp:
- Jun 28, 1999, 5:46:28 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/status.c
r164 r236 1 /* $Id: status.c,v 1. 5 1999-06-23 19:45:01 achimhaExp $ */1 /* $Id: status.c,v 1.6 1999-06-28 15:46:26 cbratschi Exp $ */ 2 2 /* 3 3 * Interface code to StatusWindow widget/control … … 192 192 else { 193 193 for (i = 0; i < infoPtr->numParts; i++) { 194 194 if (infoPtr->parts[i].style & SBT_OWNERDRAW) { 195 195 DRAWITEMSTRUCT dis; 196 196 … … 441 441 442 442 if (ti.lpszText) 443 lstrcpynA ((LPSTR)lParam, ti.lpszText, HIWORD(wParam));443 lstrcpynA ((LPSTR)lParam, ti.lpszText, MIN(HIWORD(wParam),lstrlenA(ti.lpszText))); 444 444 } 445 445 … … 461 461 462 462 if (ti.lpszText) 463 lstrcpynW ((LPWSTR)lParam, ti.lpszText, HIWORD(wParam));463 lstrcpynW ((LPWSTR)lParam, ti.lpszText, MIN(HIWORD(wParam),lstrlenW(ti.lpszText))); 464 464 } 465 465 … … 571 571 if (oldNumParts > self->numParts) { 572 572 for (i = self->numParts ; i < oldNumParts; i++) { 573 573 if (self->parts[i].text && !(self->parts[i].style & SBT_OWNERDRAW)) 574 574 COMCTL32_Free (self->parts[i].text); 575 575 } … … 635 635 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd); 636 636 STATUSWINDOWPART *part; 637 int 638 int 637 int part_num; 638 int style; 639 639 LPSTR text; 640 int 640 int len; 641 641 HDC hdc; 642 642 … … 646 646 647 647 if ((self->simple) || (self->parts==NULL) || (part_num==255)) 648 648 part = &self->part0; 649 649 else 650 650 part = &self->parts[part_num]; 651 651 if (!part) return FALSE; 652 652 653 653 if (!(part->style & SBT_OWNERDRAW) && part->text) 654 654 COMCTL32_Free (part->text); 655 655 part->text = 0; 656 656 657 657 if (style & SBT_OWNERDRAW) { 658 658 part->text = (LPWSTR)text; 659 659 } 660 660 else { 661 662 663 664 665 661 /* duplicate string */ 662 if (text && (len = lstrlenA(text))) { 663 part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); 664 lstrcpyAtoW (part->text, text); 665 } 666 666 } 667 667 part->style = style; … … 689 689 690 690 if ((self->simple) || (self->parts==NULL) || (part_num==255)) 691 691 part = &self->part0; 692 692 else 693 693 part = &self->parts[part_num]; 694 694 if (!part) return FALSE; 695 695 696 696 if (!(part->style & SBT_OWNERDRAW) && part->text) 697 697 COMCTL32_Free (part->text); 698 698 part->text = 0; 699 699 700 700 if (style & SBT_OWNERDRAW) { 701 701 part->text = text; 702 702 } 703 703 else { 704 705 706 707 708 704 /* duplicate string */ 705 if (text && (len = lstrlenW(text))) { 706 part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); 707 lstrcpyW(part->text, text); 708 } 709 709 } 710 710 part->style = style; … … 896 896 { 897 897 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd); 898 int 898 int i; 899 899 900 900 for (i = 0; i < self->numParts; i++) { 901 902 901 if (self->parts[i].text && !(self->parts[i].style & SBT_OWNERDRAW)) 902 COMCTL32_Free (self->parts[i].text); 903 903 } 904 904 if (self->part0.text && !(self->part0.style & SBT_OWNERDRAW)) 905 905 COMCTL32_Free (self->part0.text); 906 906 COMCTL32_Free (self->parts); 907 907 908 908 /* delete default font */ 909 909 if (self->hDefaultFont) 910 910 DeleteObject (self->hDefaultFont); 911 911 912 912 /* delete tool tip control */ 913 913 if (self->hwndToolTip) 914 914 DestroyWindow (self->hwndToolTip); 915 915 916 916 COMCTL32_Free (self);
Note:
See TracChangeset
for help on using the changeset viewer.