Fixed weird localization issue where saves SIF files would use number in the local...
authordarco <darco@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 24 Dec 2005 23:09:09 +0000 (23:09 +0000)
committerdarco <darco@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 24 Dec 2005 23:09:09 +0000 (23:09 +0000)
git-svn-id: http://svn.voria.com/code@100 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/examples/Makefile.in
synfig-core/trunk/src/modules/mod_openexr/Makefile.am
synfig-core/trunk/src/synfig/general.h
synfig-core/trunk/src/synfig/loadcanvas.cpp
synfig-core/trunk/src/synfig/savecanvas.cpp

index b96ef0b..f0ae222 100644 (file)
@@ -209,7 +209,7 @@ sharedstatedir = @sharedstatedir@
 synfigincludedir = @synfigincludedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
-EXTRA_DIST = about_dialog.sif backdrop.sif business_card.sif candy.sif cells.sif eye.sif eyes.sif gamma.sif gradient.sif headmo.sif installer-logo.sif japan.sif logo.sif logo.tiff macwolfen.sif Makefile.am mandelbrot.sif newjulia.sif newjulia2.sif noise.sif pirates.sif preambletaffy.sif prologue_kid.sif sparkle.sif splat.sif star.sif wallpaper.sif warpcube.sif warptext.sif z_depth_test.sif
+EXTRA_DIST = about_dialog.sif backdrop.sif business_card.sif candy.sif cells.sif eye.sif eyes.sif gamma.sif gradient.sif headmo.sif installer-logo.sif japan.sif logo.sif macwolfen.sif Makefile.am mandelbrot.sif newjulia.sif newjulia2.sif noise.sif pirates.sif preambletaffy.sif prologue_kid.sif sparkle.sif splat.sif star.sif wallpaper.sif warpcube.sif warptext.sif z_depth_test.sif
 all: all-am
 
 .SUFFIXES:
index 6fd752e..e1354de 100644 (file)
@@ -10,8 +10,8 @@ if WITH_OPENEXR
 module_LTLIBRARIES = libmod_openexr.la
 libmod_openexr_la_SOURCES = main.cpp mptr_openexr.cpp mptr_openexr.h trgt_openexr.cpp trgt_openexr.h
 libmod_openexr_la_LDFLAGS = -module @PNG_LIBS@ -no-undefined
-libmod_openexr_la_LIBADD = -L../../synfig -lsynfig @SYNFIG_LIBS@
-libmod_openexr_la_CXXFLAGS = @SYNFIG_CFLAGS@
+libmod_openexr_la_LIBADD = -L../../synfig -lsynfig @SYNFIG_LIBS@ @OPENEXR_LIBS@
+libmod_openexr_la_CXXFLAGS = @SYNFIG_CFLAGS@ @OPENEXR_CFLAGS@
 else
 endif
 
index 7e8f0e3..3be6cce 100644 (file)
@@ -30,6 +30,7 @@
 #include <ETL/stringf>
 #include "string.h"
 #include "version.h"
+#include <locale.h>
 
 /* === M A C R O S ========================================================= */
 
 
 namespace synfig {
 
+class ChangeLocale {
+    const char *previous;
+    int category;
+public:
+    ChangeLocale(int category, const char *locale):
+        previous(setlocale(category,NULL)),category(category)
+    {
+            setlocale(category,locale);
+    }
+    ~ChangeLocale() {
+        setlocale(category,previous);
+    }
+};
+
 /*!    \class ProgressCallback
 **     \todo writeme
 */
index b370158..49ee884 100644 (file)
@@ -2260,6 +2260,7 @@ CanvasParser::parse_from_file_as(const String &file_,const String &as_)
        CHECK_EXPIRE_TIME();
        try
        {
+        ChangeLocale change_locale(LC_NUMERIC, "C");
                String file(unix_to_local_path(file_));
                String as(unix_to_local_path(as_));
 
@@ -2321,6 +2322,7 @@ CanvasParser::parse_from_string(const String &data)
 
        try
        {
+        ChangeLocale change_locale(LC_NUMERIC, "C");
                filename=_("<INTERNAL>");
                total_warnings_=0;
                xmlpp::DomParser parser;
index 2638147..6bb025a 100644 (file)
@@ -710,6 +710,8 @@ xmlpp::Element* encode_canvas(xmlpp::Element* root,Canvas::ConstHandle canvas)
 bool
 synfig::save_canvas(const String &filename, Canvas::ConstHandle canvas)
 {
+    ChangeLocale change_locale(LC_NUMERIC, "C");
+
        synfig::String tmp_filename(filename+".TMP");
 
        try
@@ -750,6 +752,7 @@ synfig::save_canvas(const String &filename, Canvas::ConstHandle canvas)
 String
 synfig::canvas_to_string(Canvas::ConstHandle canvas)
 {
+    ChangeLocale change_locale(LC_NUMERIC, "C");
        assert(canvas);
 
        xmlpp::Document document;