Ignore:
Timestamp:
Feb 15, 2002, 4:07:41 PM (24 years ago)
Author:
sandervl
Message:

Wine 20020215 resync + added extended logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/oleaut32/olefont.c

    r6711 r7916  
    2626#include "olectl.h"
    2727#include "debugtools.h"
    28 #include "heap.h"
    2928#include "connpt.h" /* for CreateConnectionPoint */
    3029
     
    292291  *ppvObj = 0;
    293292
     293  if (lpFontDesc == 0)
     294    return NO_ERROR; /* MSDN Oct 2001 */
     295
    294296  /*
    295297   * Try to construct a new instance of the class.
     
    13411343  BYTE  bAttributes;
    13421344  BYTE  bStringSize;
     1345  INT len;
    13431346
    13441347  _ICOM_THIS_From_IPersistStream(OLEFontImpl, iface);
     
    13991402    return E_FAIL;
    14001403
    1401   memset(readBuffer, 0, 0x100);
    14021404  IStream_Read(pLoadStream, readBuffer, bStringSize, &cbRead);
    14031405
     
    14081410    HeapFree(GetProcessHeap(), 0, this->description.lpstrName);
    14091411
    1410   this->description.lpstrName = HEAP_strdupAtoW(GetProcessHeap(),
    1411                                                     HEAP_ZERO_MEMORY,
    1412                                                     readBuffer);
     1412  len = MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, NULL, 0 );
     1413  this->description.lpstrName = HeapAlloc( GetProcessHeap(), 0, (len+1) * sizeof(WCHAR) );
     1414  MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, this->description.lpstrName, len );
     1415  this->description.lpstrName[len] = 0;
    14131416
    14141417  return S_OK;
     
    14881491   */
    14891492  if (this->description.lpstrName!=0)
    1490     bStringSize = lstrlenW(this->description.lpstrName);
     1493    bStringSize = WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName,
     1494                                       strlenW(this->description.lpstrName), NULL, 0, NULL, NULL );
    14911495  else
    14921496    bStringSize = 0;
     
    14991503  if (bStringSize!=0)
    15001504  {
    1501     writeBuffer = HEAP_strdupWtoA(GetProcessHeap(),
    1502                                   HEAP_ZERO_MEMORY,
    1503                                   this->description.lpstrName);
    1504 
    1505     if (writeBuffer==0)
    1506       return E_OUTOFMEMORY;
     1505      if (!(writeBuffer = HeapAlloc( GetProcessHeap(), 0, bStringSize ))) return E_OUTOFMEMORY;
     1506      WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName,
     1507                           strlenW(this->description.lpstrName),
     1508                           writeBuffer, bStringSize, NULL, NULL );
    15071509
    15081510    IStream_Write(pOutStream, writeBuffer, bStringSize, &cbWritten);
    1509    
    15101511    HeapFree(GetProcessHeap(), 0, writeBuffer);
    15111512
     
    16601661        LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
    16611662) {
    1662         ICOM_THIS(IClassFactoryImpl,iface);
    1663 
    1664         if (IsEqualGUID(riid,&IID_IFont)) {
    1665             FONTDESC fd;
    1666 
    1667             WCHAR fname[] = { 'S','y','s','t','e','m',0 };
    1668 
    1669             fd.cbSizeofstruct = sizeof(fd);
    1670             fd.lpstrName      = fname;
    1671             fd.cySize.s.Lo    = 80000;
    1672             fd.cySize.s.Hi    = 0;
    1673             fd.sWeight        = 0;
    1674             fd.sCharset       = 0;
    1675             fd.fItalic        = 0;
    1676             fd.fUnderline     = 0;
    1677             fd.fStrikethrough = 0;
    1678             return OleCreateFontIndirect(&fd,riid,ppobj);
    1679         }
    1680 
    1681         FIXME("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
    1682         return E_NOINTERFACE;
     1663        FONTDESC fd;
     1664
     1665        WCHAR fname[] = { 'S','y','s','t','e','m',0 };
     1666
     1667        fd.cbSizeofstruct = sizeof(fd);
     1668        fd.lpstrName      = fname;
     1669        fd.cySize.s.Lo    = 80000;
     1670        fd.cySize.s.Hi    = 0;
     1671        fd.sWeight            = 0;
     1672        fd.sCharset       = 0;
     1673        fd.fItalic            = 0;
     1674        fd.fUnderline     = 0;
     1675        fd.fStrikethrough = 0;
     1676        return OleCreateFontIndirect(&fd,riid,ppobj);
     1677
    16831678}
    16841679
Note: See TracChangeset for help on using the changeset viewer.