Ignore:
Timestamp:
Nov 4, 2000, 8:55:45 PM (25 years ago)
Author:
umoeller
Message:

Updated string helpers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/textview.c

    r8 r12  
    269269    lstInit(&pxfd->llWords,
    270270            TRUE);      // auto-free items
     271    xstrInit(&pxfd->strViewText, 0);
    271272}
    272273
     
    10881089    pxfd->ulViewportCY = 0;
    10891090
    1090     if (pxfd->pszViewText)
     1091    if (pxfd->strViewText.cbAllocated)
    10911092    {
    1092         ULONG   ulTextLen = strlen(pxfd->pszViewText);
     1093        ULONG   ulTextLen = pxfd->strViewText.ulLength;
    10931094
    10941095        FORMATLINEBUF   flbuf;
     
    11021103        flbuf.pfmtc = &pxfd->fmtcStandard;
    11031104        flbuf.lPointSize = pxfd->fmtcStandard.lPointSize;
    1104         flbuf.pLastChar = pxfd->pszViewText + ulTextLen;
     1105        flbuf.pLastChar = pxfd->strViewText.psz + ulTextLen;
    11051106
    11061107        if (ulTextLen)
     
    11151116                 */
    11161117
    1117                 PSZ     pCurrent = pxfd->pszViewText;
     1118                PSZ     pCurrent = pxfd->strViewText.psz;
    11181119
    11191120                // loop until null terminator
     
    23942395                if (pwndParams->fsStatus & WPM_TEXT)
    23952396                {
    2396                     xstrcpy(&ptxvd->xfd.pszViewText, pwndParams->pszText);
     2397                    xstrcpy(&ptxvd->xfd.strViewText, pwndParams->pszText);
    23972398                    ptxvd->lViewXOfs = 0;
    23982399                    ptxvd->lViewYOfs = 0;
     
    30613062
    30623063        case WM_DESTROY:
    3063             if (ptxvd->xfd.pszViewText)
    3064                 free(ptxvd->xfd.pszViewText);
     3064            xstrClear(&ptxvd->xfd.strViewText);
    30653065            lstClear(&ptxvd->xfd.llRectangles);
    30663066            lstClear(&ptxvd->xfd.llWords);
     
    34723472
    34733473    // use text from window
    3474     xfd.pszViewText = pszViewText;
     3474    xstrcpy(&xfd.strViewText, pszViewText);
    34753475
    34763476    // setup page
     
    36213621                             hdc,
    36223622                             hps,
    3623                              ptxvd->xfd.pszViewText,
     3623                             ptxvd->xfd.strViewText.psz,
    36243624                             ulSize,
    36253625                             pszFaceName,
Note: See TracChangeset for help on using the changeset viewer.