- Timestamp:
- Dec 29, 2003, 12:54:54 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/text.cpp
r10363 r10365 1 /* $Id: text.cpp,v 1.3 6 2003-12-29 10:55:49sandervl Exp $ */1 /* $Id: text.cpp,v 1.37 2003-12-29 11:54:54 sandervl Exp $ */ 2 2 3 3 /* … … 409 409 pDCData pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc); 410 410 411 dprintf(("GDI32: GetTextExtentPointW % x %.*ls %d", hdc, cbString, lpString, cbString));411 dprintf(("GDI32: GetTextExtentPointW %ls", lpString)); 412 412 if(pHps == NULL) 413 413 { … … 460 460 lstrcpynWtoA(astring, lpString, len + 1 ); 461 461 462 rc = OSLibGpiQueryTextBox(pHps, cbString, astring, TXTBOXOS_COUNT, pts);462 rc = OSLibGpiQueryTextBox(pHps, len, astring, TXTBOXOS_COUNT, pts); 463 463 free(astring); 464 464 … … 480 480 } 481 481 482 dprintf(("GDI32: GetTextExtentPointW %x % .*ls %d returned %d (%d,%d)", hdc, cbString, lpString, cbString, rc, lpSize->cx, lpSize->cy));482 dprintf(("GDI32: GetTextExtentPointW %x %ls %d returned %d (%d,%d)", hdc, lpString, cbString, rc, lpSize->cx, lpSize->cy)); 483 483 SetLastError(ERROR_SUCCESS); 484 484 return TRUE; … … 511 511 ret = GetTextExtentExPointW( hdc, p, wlen, maxExt, lpnFit, alpDx, size); 512 512 if (lpnFit) *lpnFit = WideCharToMultiByte(CP_ACP,0,p,*lpnFit,NULL,0,NULL,NULL); 513 if( IsDBCSEnv() && alpDx ) /* index of alpDx between ansi and wide may not match in DBCS !!! */ 514 { 515 LPINT alpDxNew = ( LPINT )HeapAlloc( GetProcessHeap(), 0, *lpnFit ); 516 int i, j; 517 518 for( i = j = 0; i < *lpnFit; i++, j++ ) 519 { 520 if( IsDBCSLeadByte( str[ i ])) 521 { 522 alpDxNew[ i++ ] = alpDx[ j ] >> 1; 523 if( i < *lpnFit ) 524 alpDxNew[ i ] = alpDx[ j ] >> 1; 525 } 526 else 527 alpDxNew[ i ] = alpDx[ j ]; 528 529 } 530 531 memcpy( alpDx, alpDxNew, sizeof( alpDx[ 0 ] ) * *lpnFit ); 532 533 HeapFree( GetProcessHeap(), 0, alpDxNew ); 534 } 513 535 HeapFree( GetProcessHeap(), 0, p ); 514 536 return ret; … … 531 553 for(index = 0; index < count; index++) 532 554 { 533 555 if(!GetTextExtentPoint32W( hdc, str, 1, &tSize )) goto done; 534 556 /* GetTextExtentPoint includes intercharacter spacing. */ 535 557 /* FIXME - justification needs doing yet. Remember that the base 536 558 * data will not be in logical coordinates. 537 559 */ 538 539 560 extent += tSize.cx; 561 if( !lpnFit || extent <= maxExt ) 540 562 /* It is allowed to be equal. */ 541 563 { 542 543 564 nFit++; 565 if( alpDx ) alpDx[index] = extent; 544 566 } 545 546 567 if( tSize.cy > size->cy ) size->cy = tSize.cy; 568 str++; 547 569 } 548 570 size->cx = extent;
Note:
See TracChangeset
for help on using the changeset viewer.