Changeset 19304


Ignore:
Timestamp:
Jun 25, 2002, 9:11:32 AM (23 years ago)
Author:
sandervl
Message:

KSO: Use %.*s and %.*ls when we have a string with a length. (Crashing in logging is awfull. Creates zombiesoslibres.cpp)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/user32/text.c

    r18255 r19304  
    5555/*********************************************************************
    5656 *  Return next line of text from a string.
    57  * 
     57 *
    5858 * hdc - handle to DC.
    5959 * str - string to parse into lines.
     
    6868 *
    6969 * FIXME:
    70  * GetTextExtentPoint is used to get the width of each character, 
     70 * GetTextExtentPoint is used to get the width of each character,
    7171 * rather than GetCharABCWidth...  So the whitespace between
    7272 * characters is ignored, and the reported len is too great.
     
    110110            }
    111111            break;
    112            
     112       
    113113        case PREFIX:
    114114            if (!(format & DT_NOPREFIX) && *count > 1)
     
    130130            }
    131131            break;
    132            
     132       
    133133        case TAB:
    134134            if (format & DT_EXPANDTABS)
     
    207207        }
    208208    }
    209    
     209
    210210    *len = j;
    211211    return NULL;
     
    253253
    254254#ifdef __WIN32OS2__
    255     dprintf(("DrawTextExW: %ls, %d , [(%d,%d),(%d,%d)]\n", str, count,
     255    dprintf(("DrawTextExW: %.*ls, %d , [(%d,%d),(%d,%d)]\n", count, str, count,
    256256            rect->left, rect->top, rect->right, rect->bottom));
    257257#else
     
    500500 * We are going to get a lot of code-duplication once this migration is
    501501 * completed...
    502  * 
     502 *
    503503 */
    504504static BOOL TEXT_GrayString(HDC hdc, HBRUSH hb, GRAYSTRINGPROC fn, LPARAM lp, INT len,
     
    522522    if(!hdc) return FALSE;
    523523#endif
    524    
     524
    525525    if(len == 0)
    526526    {
     
    740740{
    741741#ifdef __WIN32OS2__
    742     dprintf(("TabbedTextOutA: %04x %d,%d %s %d\n", hdc, x, y, lpstr, count ));
     742    dprintf(("TabbedTextOutA: %04x %d,%d %.*s %d\n", hdc, x, y, count, lpstr, count ));
    743743#else
    744744    TRACE("%04x %d,%d %s %d\n", hdc, x, y, debugstr_an(lpstr,count), count );
     
    762762    acount = WideCharToMultiByte(codepage,0,str,count,NULL,0,NULL,NULL);
    763763    p = HeapAlloc( GetProcessHeap(), 0, acount );
    764     if(p == NULL) return 0; /* FIXME: is this the correct return on failure */ 
     764    if(p == NULL) return 0; /* FIXME: is this the correct return on failure */
    765765    acount = WideCharToMultiByte(codepage,0,str,count,p,acount,NULL,NULL);
    766766    ret = TabbedTextOutA( hdc, x, y, p, acount, cTabStops, lpTabPos, nTabOrg );
     
    790790{
    791791#ifdef __WIN32OS2__
    792     dprintf(("GetTabbedTextExtentA: %04x %s %d\n", hdc, lpstr, count ));
     792    dprintf(("GetTabbedTextExtentA: %04x %.*s %d\n", hdc, count, lpstr, count ));
    793793#else
    794794    TRACE("%04x %s %d\n", hdc, debugstr_an(lpstr,count), count );
Note: See TracChangeset for help on using the changeset viewer.