Ignore:
Timestamp:
Jun 29, 1999, 5:54:10 PM (26 years ago)
Author:
cbratschi
Message:

UnicodeToAsciiN-fixes + TemplateID-Fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comdlg32/comdlg32.cpp

    r181 r243  
    1 /* $Id: comdlg32.cpp,v 1.6 1999-06-24 16:54:24 achimha Exp $ */
     1/* $Id: comdlg32.cpp,v 1.7 1999-06-29 15:54:10 cbratschi Exp $ */
    22
    33/*
     
    222222 *
    223223 * Author    : Patrick Haller [Tue, 1998/02/10 01:55]
     224 *             Edgar Buerkle  [Mon, 1999/06/28 19:35]
    224225 *****************************************************************************/
    225226
     
    247248  asciicf.lpLogFont = &asciilf; // update pointer
    248249
    249 
    250   // now translate the strings
     250  // lpTemplatenName bug in open32 ?  This doesn't work.
     251  // TODO: CF_ENABLETEMPLATEHANDLE
    251252  if (lpcf->Flags & CF_ENABLETEMPLATE)
    252     asciicf.lpTemplateName = UnicodeToAsciiString((LPWSTR)lpcf->lpTemplateName);
    253   else
    254     asciicf.lpTemplateName = NULL;
     253    if((int)asciicf.lpTemplateName >> 16 != 0)
     254      asciicf.lpTemplateName = UnicodeToAsciiString((LPWSTR)lpcf->lpTemplateName);
    255255
    256256  UnicodeToAsciiN(lpcf->lpszStyle,
    257257                  szAsciiStyle,
    258                   sizeof(szAsciiStyle));
     258                  sizeof(szAsciiStyle) - 1);
    259259  asciicf.lpszStyle = szAsciiStyle;
    260260
    261261  UnicodeToAsciiN(lpcf->lpLogFont->lfFaceName,
    262262                  asciilf.lfFaceName,
    263                   LF_FACESIZE);
     263                  LF_FACESIZE-1);
    264264
    265265  // LPCFHOOKPROC != WNDPROC ?
     
    272272  AsciiToUnicodeN(asciicf.lpLogFont->lfFaceName,
    273273                  lpcf->lpLogFont->lfFaceName,
    274                   LF_FACESIZE);
     274                  LF_FACESIZE-1);
    275275
    276276  AsciiToUnicode(asciicf.lpszStyle,
    277277                 lpcf->lpszStyle);
    278278
    279   if(asciicf.lpTemplateName != NULL)
    280     FreeAsciiString((char*)asciicf.lpTemplateName);
     279  if (lpcf->Flags & CF_ENABLETEMPLATE)
     280    if((int)asciicf.lpTemplateName >> 16 != 0)
     281      FreeAsciiString((char*)asciicf.lpTemplateName);
    281282
    282283  // copy back fields
Note: See TracChangeset for help on using the changeset viewer.