Changeset 5472 for trunk/src/gdi32/text.cpp
- Timestamp:
- Apr 4, 2001, 11:05:50 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/text.cpp
r4602 r5472 1 /* $Id: text.cpp,v 1.1 4 2000-11-16 16:34:49sandervl Exp $ */1 /* $Id: text.cpp,v 1.15 2001-04-04 09:02:15 sandervl Exp $ */ 2 2 3 3 /* … … 19 19 #include "oslibgpi.h" 20 20 #include <dcdata.h> 21 #include <unicode.h> 21 22 22 23 #define DBG_LOCALLOG DBG_text … … 450 451 INT SYSTEM EXPORT InternalDrawTextExW(HDC hdc,LPCWSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams,BOOL isDrawTextEx) 451 452 { 452 char *astring = (cchText == -1) ? UnicodeToAsciiString((LPWSTR)lpchText):UnicodeToAsciiStringN((LPWSTR)lpchText,cchText);453 char *astring; 453 454 INT rc; 455 456 if(cchText == -1) { 457 UnicodeToAsciiString((LPWSTR)lpchText); 458 } 459 else { 460 astring = (char *)HEAP_malloc(cchText+1); 461 UnicodeToAscii((LPWSTR)lpchText, astring); 462 astring[cchText] = 0; 463 } 454 464 455 465 dprintf(("InternalDrawTextExW %x %s %d %x", hdc, astring, cchText, dwDTFormat)); … … 508 518 DWORD SYSTEM EXPORT InternalGetTabbedTextExtentW(HDC hDC,LPCWSTR lpString,INT nCount,INT nTabPositions,LPINT lpnTabStopPositions) 509 519 { 510 char *astring = (nCount == -1) ? UnicodeToAsciiString((LPWSTR)lpString):UnicodeToAsciiStringN((LPWSTR)lpString,nCount);520 char *astring; 511 521 DWORD rc; 522 523 if(nCount == -1) { 524 UnicodeToAsciiString((LPWSTR)lpString); 525 } 526 else { 527 astring = (char *)HEAP_malloc(nCount+1); 528 UnicodeToAscii((LPWSTR)lpString, astring); 529 astring[nCount] = 0; 530 } 512 531 513 532 rc = InternalGetTabbedTextExtentA(hDC,astring,nCount,nTabPositions,lpnTabStopPositions); … … 587 606 LONG SYSTEM EXPORT InternalTabbedTextOutW(HDC hdc,INT x,INT y,LPCWSTR lpString,INT nCount,INT nTabPositions,LPINT lpnTabStopPositions,INT nTabOrigin) 588 607 { 589 char *astring = (nCount == -1) ? UnicodeToAsciiString((LPWSTR)lpString):UnicodeToAsciiStringN((LPWSTR)lpString,nCount);608 char *astring; 590 609 LONG rc; 610 611 if(nCount == -1) { 612 UnicodeToAsciiString((LPWSTR)lpString); 613 } 614 else { 615 astring = (char *)HEAP_malloc(nCount+1); 616 UnicodeToAscii((LPWSTR)lpString, astring); 617 astring[nCount] = 0; 618 } 591 619 592 620 rc = InternalTabbedTextOutA(hdc,x,y,astring,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin); … … 749 777 BOOL InternalTextOutW(HDC hdc,int X,int Y,UINT fuOptions,CONST RECT *lprc,LPCWSTR lpszString,INT cbCount,CONST INT *lpDx,BOOL IsExtTextOut) 750 778 { 751 char *astring = (cbCount == -1) ? UnicodeToAsciiString((LPWSTR)lpszString):UnicodeToAsciiStringN((LPWSTR)lpszString,cbCount);779 char *astring; 752 780 BOOL rc; 753 781 782 if(cbCount == -1) { 783 UnicodeToAsciiString((LPWSTR)lpszString); 784 } 785 else { 786 astring = (char *)HEAP_malloc(cbCount+1); 787 UnicodeToAscii((LPWSTR)lpszString, astring); 788 astring[cbCount] = 0; 789 } 754 790 rc = InternalTextOutA(hdc,X,Y,fuOptions,lprc,(LPCSTR)astring,cbCount,lpDx,IsExtTextOut); 755 791 FreeAsciiString(astring);
Note:
See TracChangeset
for help on using the changeset viewer.