Changeset 10372 for trunk/src/gdi32
- Timestamp:
- Jan 8, 2004, 12:11:55 PM (22 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 2 edited
-
font.cpp (modified) (4 diffs)
-
oslibgpi.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/font.cpp
r10350 r10372 1 /* $Id: font.cpp,v 1.3 3 2003-12-01 13:28:10sandervl Exp $ */1 /* $Id: font.cpp,v 1.34 2004-01-08 11:11:55 sandervl Exp $ */ 2 2 3 3 /* … … 167 167 int charset = GetTextCharset(hdc); 168 168 169 if( IsDBCSEnv() && ( charset == 0 )) 170 cp = CP_ACP; 171 else 169 172 /* Hmm, nicely designed api this one! */ 170 173 if(TranslateCharsetInfo((DWORD*)charset, &csi, TCI_SRCCHARSET)) … … 172 175 else { 173 176 switch(charset) { 174 case OEM_CHARSET:175 cp = GetOEMCP();176 break;177 case DEFAULT_CHARSET:178 cp = GetACP();179 break;180 181 case VISCII_CHARSET:182 case TCVN_CHARSET:183 case KOI8_CHARSET:184 case ISO3_CHARSET:185 case ISO4_CHARSET:186 /* FIXME: These have no place here, but because x11drv187 enumerates fonts with these (made up) charsets some apps188 might use them and then the FIXME below would become189 annoying. Now we could pick the intended codepage for190 each of these, but since it's broken anyway we'll just191 use CP_ACP and hope it'll go away...192 */193 cp = CP_ACP;194 break;195 196 197 default:198 dprintf(("Can't find codepage for charset %d\n", charset));199 break;200 }177 case OEM_CHARSET: 178 cp = GetOEMCP(); 179 break; 180 case DEFAULT_CHARSET: 181 cp = GetACP(); 182 break; 183 184 case VISCII_CHARSET: 185 case TCVN_CHARSET: 186 case KOI8_CHARSET: 187 case ISO3_CHARSET: 188 case ISO4_CHARSET: 189 /* FIXME: These have no place here, but because x11drv 190 enumerates fonts with these (made up) charsets some apps 191 might use them and then the FIXME below would become 192 annoying. Now we could pick the intended codepage for 193 each of these, but since it's broken anyway we'll just 194 use CP_ACP and hope it'll go away... 195 */ 196 cp = CP_ACP; 197 break; 198 199 200 default: 201 dprintf(("Can't find codepage for charset %d\n", charset)); 202 break; 203 } 201 204 } 202 205 … … 206 209 if(cp != CP_SYMBOL) { 207 210 lenW = MultiByteToWideChar(cp, 0, str, count, NULL, 0); 208 strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));209 MultiByteToWideChar(cp, 0, str, count, strW, lenW);211 strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR)); 212 MultiByteToWideChar(cp, 0, str, count, strW, lenW); 210 213 } else { 211 214 lenW = count; 212 strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));213 for(i = 0; i < count; i++) strW[i] = (BYTE)str[i];215 strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR)); 216 for(i = 0; i < count; i++) strW[i] = (BYTE)str[i]; 214 217 } 215 218 strW[lenW] = '\0'; -
trunk/src/gdi32/oslibgpi.cpp
r10349 r10372 1 /* $Id: oslibgpi.cpp,v 1.1 5 2003-12-01 13:27:39sandervl Exp $ */1 /* $Id: oslibgpi.cpp,v 1.16 2004-01-08 11:11:55 sandervl Exp $ */ 2 2 3 3 /* … … 265 265 if (box[TXTBOX_BOTTOMLEFT].y == box[TXTBOX_BOTTOMRIGHT].y) 266 266 { 267 point->y = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y) + 1;267 point->y = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y); 268 268 point->x = labs (box[TXTBOX_CONCAT].x - box[TXTBOX_BOTTOMLEFT].x); 269 269 … … 278 278 } else 279 279 { 280 cx = labs (box[TXTBOX_BOTTOMLEFT].x-box[TXTBOX_TOPLEFT].x) + 1;281 cy = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y) + 1;280 cx = labs (box[TXTBOX_BOTTOMLEFT].x-box[TXTBOX_TOPLEFT].x); 281 cy = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y); 282 282 point->y = (ULONG)hypot(cx,cy); 283 283 284 cx = labs (box[TXTBOX_TOPRIGHT].x-box[TXTBOX_TOPLEFT].x) + 1;285 cy = labs (box[TXTBOX_TOPRIGHT].y-box[TXTBOX_TOPLEFT].y) + 1;284 cx = labs (box[TXTBOX_TOPRIGHT].x-box[TXTBOX_TOPLEFT].x); 285 cy = labs (box[TXTBOX_TOPRIGHT].y-box[TXTBOX_TOPLEFT].y); 286 286 point->x = (ULONG)hypot(cx,cy); 287 287 }
Note:
See TracChangeset
for help on using the changeset viewer.
