diff options
author | Martin Kretzschmar <martink@src.gnome.org> | 2005-06-18 22:27:04 (GMT) |
---|---|---|
committer | Martin Kretzschmar <martink@src.gnome.org> | 2005-06-18 22:27:04 (GMT) |
commit | 6c9c79f7cd5e86a5d90231f6b2f7ed2db9b7886f (patch) | |
tree | c78d920fe7bd3e0dad641f09ebec9db52bd79260 /ps | |
parent | 74ddcfcb4098d77e261b95d5ff678bd853c61e10 (diff) |
remove the locale.h include again ;-). And kill the (bogus)
setlocale/savelocale business.
Diffstat (limited to 'ps')
-rw-r--r-- | ps/ps-document.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/ps/ps-document.c b/ps/ps-document.c index 8aa9bd1..d1c5271 100644 --- a/ps/ps-document.c +++ b/ps/ps-document.c @@ -43,10 +43,6 @@ #include <stdio.h> #include <math.h> -#ifdef HAVE_LOCALE_H -#include <locale.h> -#endif - #include "ps-document.h" #include "ev-debug.h" #include "gsdefaults.h" @@ -459,32 +455,22 @@ setup_page (PSDocument *gs, int page, double scale) { char buf[1024]; int urx, ury, llx, lly, orientation; -#ifdef HAVE_LOCALE_H - char *savelocale; -#endif + char scaled_xdpi[G_ASCII_DTOSTR_BUF_SIZE]; + char scaled_ydpi[G_ASCII_DTOSTR_BUF_SIZE]; LOG ("Setup the page"); -#ifdef HAVE_LOCALE_H - /* gs needs floating point parameters with '.' as decimal point - * while some (european) locales use ',' instead, so we set the - * locale for this snprintf to "C". - */ - savelocale = setlocale (LC_NUMERIC, "C"); -#endif get_page_box (gs, page, &urx, &ury, &llx, &lly); orientation = get_page_orientation (gs, page); + g_ascii_dtostr (scaled_xdpi, G_ASCII_DTOSTR_BUF_SIZE, get_xdpi (gs) * scale); + g_ascii_dtostr (scaled_ydpi, G_ASCII_DTOSTR_BUF_SIZE, get_ydpi (gs) * scale); - g_snprintf (buf, 1024, "%ld %d %d %d %d %d %f %f %d %d %d %d", + g_snprintf (buf, 1024, "%ld %d %d %d %d %d %s %s %d %d %d %d", 0L, orientation * 90, llx, lly, urx, ury, - get_xdpi (gs) * scale, - get_ydpi (gs) * scale, + scaled_xdpi, scaled_ydpi, 0, 0, 0, 0); LOG ("GS property %s", buf); -#ifdef HAVE_LOCALE_H - setlocale(LC_NUMERIC, savelocale); -#endif gdk_property_change (gs->pstarget, gs_class->gs_atom, gs_class->string_atom, 8, GDK_PROP_MODE_REPLACE, (guchar *)buf, strlen(buf)); gdk_flush (); |