summaryrefslogtreecommitdiff
path: root/src/svg/cdsvg.c
diff options
context:
space:
mode:
authorscuri <scuri>2010-10-14 18:07:59 +0000
committerscuri <scuri>2010-10-14 18:07:59 +0000
commit26ee3a10b806df99915805516567f6ad38956ac4 (patch)
tree65b9d3812776ed84b9d09c5c42e99594228cbff2 /src/svg/cdsvg.c
parent6620df9471268a72f0c58eddb99c0d612bca566e (diff)
Fixed: locale in SVG for floating point numbers, it must use dots "." for decimal separators.
Diffstat (limited to 'src/svg/cdsvg.c')
-rw-r--r--src/svg/cdsvg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/svg/cdsvg.c b/src/svg/cdsvg.c
index 0510919..46e41bf 100644
--- a/src/svg/cdsvg.c
+++ b/src/svg/cdsvg.c
@@ -31,6 +31,7 @@ struct _cdCtxCanvas
char linestyle[50];
char pattern[50];
+ char* old_locale;
char* font_weight;
char* font_style;
char* font_decoration;
@@ -57,6 +58,12 @@ static void cdtransform(cdCtxCanvas *ctxcanvas, const double* matrix);
static void cdkillcanvas(cdCtxCanvas* ctxcanvas)
{
+ if (ctxcanvas->old_locale)
+ {
+ setlocale(LC_NUMERIC, ctxcanvas->old_locale);
+ free(ctxcanvas->old_locale);
+ }
+
if (ctxcanvas->clip_control)
fprintf(ctxcanvas->file, "</g>\n"); /* close clipping container */
@@ -1235,6 +1242,10 @@ static void cdcreatecanvas(cdCanvas *canvas, void *data)
ctxcanvas = (cdCtxCanvas *)malloc(sizeof(cdCtxCanvas));
memset(ctxcanvas, 0, sizeof(cdCtxCanvas));
+ /* SVN specification states that number must use dot as decimal separator */
+ ctxcanvas->old_locale = cdStrDup(setlocale(LC_NUMERIC, NULL));
+ setlocale(LC_NUMERIC, "English");
+
ctxcanvas->file = fopen(filename, "w");
if (!ctxcanvas->file)
{