Changeset 10163 for trunk/src/gdi32/text.cpp
- Timestamp:
- Jul 14, 2003, 3:43:33 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/text.cpp
r9886 r10163 1 /* $Id: text.cpp,v 1.3 3 2003-03-03 16:33:35 sandervl Exp $ */1 /* $Id: text.cpp,v 1.34 2003-07-14 13:43:15 sandervl Exp $ */ 2 2 3 3 /* … … 107 107 if(pHps->yInvert > 0) { 108 108 Y = pHps->yInvert - Y; 109 } 109 } 110 110 #endif 111 111 … … 139 139 pmRect.yTop = pHps->yInvert - pmRect.yBottom; 140 140 pmRect.yBottom = temp; 141 } 141 } 142 142 #endif 143 143 #endif … … 210 210 BOOL rc; 211 211 PPOINTLOS2 pts = (PPOINTLOS2)malloc((cbCount+1)*sizeof(POINTLOS2)); 212 212 213 213 rc = OSLibGpiQueryCharStringPosAt(pHps,&ptl,flOptions & CHSOS_VECTOR,cbCount,lpszString,lpDx,pts); 214 214 if(rc) { … … 236 236 237 237 int vertAdjust = 0; 238 if ((pHps->taMode & 0x18) != TA_TOP) 238 if ((pHps->taMode & 0x18) != TA_TOP) 239 239 { 240 240 vertAdjust = OSLibGpiQueryFontMaxHeight(pHps->hps); … … 281 281 astring = UnicodeToAsciiString((LPWSTR)lpszString); 282 282 } 283 else 284 if(cbCount) { 285 astring = (char *)HEAP_malloc(cbCount+1); 286 UnicodeToAsciiN((LPWSTR)lpszString, astring, cbCount+1); 287 astring[cbCount] = 0; 288 } 289 rc = InternalTextOutA(hdc,X,Y,fuOptions,lprc,(LPCSTR)astring,cbCount,lpDx,IsExtTextOut); 283 else 284 if(cbCount >= 0) { 285 int n = WideCharToMultiByte( CP_ACP, 0, lpszString, cbCount, 0, 0, NULL, NULL ) + 1; 286 287 astring = (char *)HEAP_malloc( n ); 288 UnicodeToAsciiN((LPWSTR)lpszString, astring, n ); 289 } 290 291 rc = InternalTextOutA(hdc,X,Y,fuOptions,lprc,(LPCSTR)astring, strlen( astring ),lpDx,IsExtTextOut); 290 292 if(astring) { 291 293 FreeAsciiString(astring); … … 320 322 if(astring) 321 323 free(astring); 322 324 323 325 return(rc); 324 326 } … … 443 445 return TRUE; 444 446 } 445 if(cbString > 512) 447 if(cbString > 512) 446 448 { 447 449 DWORD cbStringNew; … … 468 470 if(rc == FALSE) 469 471 { 470 SetLastError(ERROR_INVALID_PARAMETER); 472 SetLastError(ERROR_INVALID_PARAMETER); //todo wrong error 471 473 return FALSE; 472 474 } … … 496 498 { 497 499 char *astring; 498 BOOL rc; 500 int len; 501 BOOL rc; 499 502 500 503 if(lpString == NULL || cbString < 0 || lpSize == NULL) … … 518 521 dprintf(("GDI32: GetTextExtentPointW %x %.*ls %d %x", hdc, cbString, lpString, cbString, lpSize)); 519 522 520 astring = (char *)malloc((cbString+1)*sizeof(WCHAR));521 UnicodeToAsciiN(lpString, astring, cbString+1);522 523 len = WideCharToMultiByte( CP_ACP, 0, lpString, cbString, 0, 0, NULL, NULL ); 524 astring = (char *)malloc( len + 1 ); 525 UnicodeToAsciiN(lpString, astring, len + 1 ); 523 526 rc = GetTextExtentPointA(hdc, astring, 524 cbString, lpSize);527 len, lpSize); 525 528 526 529 free(astring);
Note:
See TracChangeset
for help on using the changeset viewer.