diff --git a/dlls/wineps/ps.c b/dlls/wineps/ps.c index 759f7318981..726ca7dd7a5 100644 --- a/dlls/wineps/ps.c +++ b/dlls/wineps/ps.c @@ -22,6 +22,7 @@ #include #include #include +#include #define NONAMELESSUNION #define NONAMELESSSTRUCT @@ -469,7 +470,9 @@ BOOL PSDRV_WriteArc(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h, double a /* Make angles -ve and swap order because we're working with an upside down y-axis */ + push_lc_numeric("C"); sprintf(buf, psarc, x, y, w, h, -ang2, -ang1); + pop_lc_numeric(); return PSDRV_WriteSpool(physDev, buf, strlen(buf)); } @@ -500,12 +503,16 @@ BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color) PSDRV_CopyColor(&physDev->inkColor, color); switch(color->type) { case PSCOLOR_RGB: + push_lc_numeric("C"); sprintf(buf, pssetrgbcolor, color->value.rgb.r, color->value.rgb.g, color->value.rgb.b); + pop_lc_numeric(); return PSDRV_WriteSpool(physDev, buf, strlen(buf)); case PSCOLOR_GRAY: + push_lc_numeric("C"); sprintf(buf, pssetgray, color->value.gray.i); + pop_lc_numeric(); return PSDRV_WriteSpool(physDev, buf, strlen(buf)); default: @@ -604,7 +611,9 @@ BOOL PSDRV_WriteRotate(PSDRV_PDEVICE *physDev, float ang) { char buf[256]; + push_lc_numeric("C"); sprintf(buf, psrotate, ang); + pop_lc_numeric(); return PSDRV_WriteSpool(physDev, buf, strlen(buf)); } diff --git a/dlls/wineps/psdrv.h b/dlls/wineps/psdrv.h index 058f8967e72..cb7abbc69d2 100644 --- a/dlls/wineps/psdrv.h +++ b/dlls/wineps/psdrv.h @@ -549,4 +549,13 @@ extern void T42_free(TYPE42 *t42); extern DWORD RLE_encode(BYTE *in_buf, DWORD len, BYTE *out_buf); extern DWORD ASCII85_encode(BYTE *in_buf, DWORD len, BYTE *out_buf); +#define push_lc_numeric(x) do { \ + const char *tmplocale = setlocale(LC_NUMERIC,NULL); \ + setlocale(LC_NUMERIC,x); + +#define pop_lc_numeric() \ + setlocale(LC_NUMERIC,tmplocale); \ +} while (0) + + #endif diff --git a/dlls/wineps/type42.c b/dlls/wineps/type42.c index 2424e295e11..97119c78bda 100644 --- a/dlls/wineps/type42.c +++ b/dlls/wineps/type42.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "windef.h" #include "winbase.h" @@ -199,9 +200,11 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name, buf = HeapAlloc(GetProcessHeap(), 0, sizeof(start) + strlen(ps_name) + 100); + push_lc_numeric("C"); sprintf(buf, start, ps_name, (float)bbox->left / emsize, (float)bbox->bottom / emsize, (float)bbox->right / emsize, (float)bbox->top / emsize); + pop_lc_numeric(); PSDRV_WriteSpool(physDev, buf, strlen(buf));