Ignore:
Timestamp:
Apr 4, 2001, 11:05:50 AM (24 years ago)
Author:
sandervl
Message:

compile fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/text.cpp

    r4602 r5472  
    1 /* $Id: text.cpp,v 1.14 2000-11-16 16:34:49 sandervl Exp $ */
     1/* $Id: text.cpp,v 1.15 2001-04-04 09:02:15 sandervl Exp $ */
    22
    33/*
     
    1919#include "oslibgpi.h"
    2020#include <dcdata.h>
     21#include <unicode.h>
    2122
    2223#define DBG_LOCALLOG    DBG_text
     
    450451INT SYSTEM EXPORT InternalDrawTextExW(HDC hdc,LPCWSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams,BOOL isDrawTextEx)
    451452{
    452   char *astring = (cchText == -1) ? UnicodeToAsciiString((LPWSTR)lpchText):UnicodeToAsciiStringN((LPWSTR)lpchText,cchText);
     453  char *astring;
    453454  INT  rc;
     455
     456  if(cchText == -1) {
     457     UnicodeToAsciiString((LPWSTR)lpchText);
     458  }
     459  else {
     460     astring = (char *)HEAP_malloc(cchText+1);
     461     UnicodeToAscii((LPWSTR)lpchText, astring);
     462     astring[cchText] = 0;
     463  }
    454464
    455465  dprintf(("InternalDrawTextExW %x %s %d %x", hdc, astring, cchText, dwDTFormat));
     
    508518DWORD SYSTEM EXPORT InternalGetTabbedTextExtentW(HDC hDC,LPCWSTR lpString,INT nCount,INT nTabPositions,LPINT lpnTabStopPositions)
    509519{
    510   char *astring = (nCount == -1) ? UnicodeToAsciiString((LPWSTR)lpString):UnicodeToAsciiStringN((LPWSTR)lpString,nCount);
     520  char *astring;
    511521  DWORD rc;
     522
     523  if(nCount == -1) {
     524     UnicodeToAsciiString((LPWSTR)lpString);
     525  }
     526  else {
     527     astring = (char *)HEAP_malloc(nCount+1);
     528     UnicodeToAscii((LPWSTR)lpString, astring);
     529     astring[nCount] = 0;
     530  }
    512531
    513532  rc = InternalGetTabbedTextExtentA(hDC,astring,nCount,nTabPositions,lpnTabStopPositions);
     
    587606LONG SYSTEM EXPORT InternalTabbedTextOutW(HDC hdc,INT x,INT y,LPCWSTR lpString,INT nCount,INT nTabPositions,LPINT lpnTabStopPositions,INT nTabOrigin)
    588607{
    589   char *astring = (nCount == -1) ? UnicodeToAsciiString((LPWSTR)lpString):UnicodeToAsciiStringN((LPWSTR)lpString,nCount);
     608  char *astring;
    590609  LONG rc;
     610
     611  if(nCount == -1) {
     612     UnicodeToAsciiString((LPWSTR)lpString);
     613  }
     614  else {
     615     astring = (char *)HEAP_malloc(nCount+1);
     616     UnicodeToAscii((LPWSTR)lpString, astring);
     617     astring[nCount] = 0;
     618  }
    591619
    592620  rc = InternalTabbedTextOutA(hdc,x,y,astring,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
     
    749777BOOL InternalTextOutW(HDC hdc,int X,int Y,UINT fuOptions,CONST RECT *lprc,LPCWSTR lpszString,INT cbCount,CONST INT *lpDx,BOOL IsExtTextOut)
    750778{
    751   char *astring = (cbCount == -1) ? UnicodeToAsciiString((LPWSTR)lpszString):UnicodeToAsciiStringN((LPWSTR)lpszString,cbCount);
     779  char *astring;
    752780  BOOL  rc;
    753781
     782  if(cbCount == -1) {
     783     UnicodeToAsciiString((LPWSTR)lpszString);
     784  }
     785  else {
     786     astring = (char *)HEAP_malloc(cbCount+1);
     787     UnicodeToAscii((LPWSTR)lpszString, astring);
     788     astring[cbCount] = 0;
     789  }
    754790  rc = InternalTextOutA(hdc,X,Y,fuOptions,lprc,(LPCSTR)astring,cbCount,lpDx,IsExtTextOut);
    755791  FreeAsciiString(astring);
Note: See TracChangeset for help on using the changeset viewer.