summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-05-07 16:31:04 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-05-07 16:31:04 +0000
commit983830727db80ba8e6b1eb6c5663b1f9ab9c866d (patch)
treef2a928d394d51e659e977ebbe9e81ccaba75dd2d
parentFix a bug on tapper stroke detected with Ede_123 on IRC (diff)
downloadinkscape-983830727db80ba8e6b1eb6c5663b1f9ab9c866d.tar.gz
inkscape-983830727db80ba8e6b1eb6c5663b1f9ab9c866d.zip
Minor refactor: check setlocale() occurences and make sure we do not setlocale() without resetting it to the initial default)
- inkview.cpp : This occurence in fact does *not* seem to be needed anymore (despite what the comment says) - main.cpp : The (commented out) occurence is unnecessary as it is called as part of gtk_init_check() (bzr r15674)
-rw-r--r--src/file-update.cpp5
-rw-r--r--src/inkview.cpp5
-rw-r--r--src/main.cpp1
3 files changed, 4 insertions, 7 deletions
diff --git a/src/file-update.cpp b/src/file-update.cpp
index 2275ab1c3..8fb3b3111 100644
--- a/src/file-update.cpp
+++ b/src/file-update.cpp
@@ -150,12 +150,15 @@ void fix_update(SPObject *o) {
void sp_file_convert_text_baseline_spacing(SPDocument *doc)
{
+ char *oldlocale = g_strdup(setlocale(LC_NUMERIC, NULL));
setlocale(LC_NUMERIC,"C");
sp_file_text_run_recursive(fix_blank_line, doc->getRoot());
sp_file_text_run_recursive(fix_line_spacing, doc->getRoot());
sp_file_text_run_recursive(fix_font_size, doc->getRoot());
+ setlocale(LC_NUMERIC, oldlocale);
+ g_free(oldlocale);
+
sp_file_text_run_recursive(fix_update, doc->getRoot());
- setlocale(LC_NUMERIC,"");
}
void sp_file_convert_font_name(SPDocument *doc)
diff --git a/src/inkview.cpp b/src/inkview.cpp
index 7acaa83dd..4f8665a02 100644
--- a/src/inkview.cpp
+++ b/src/inkview.cpp
@@ -270,11 +270,6 @@ int main (int argc, char **argv)
sp_modulesys_init();
#endif /* WITH_MODULES */
- /* We must set LC_NUMERIC to default, or otherwise */
- /* we'll end with localised SVG files :-( */
-
- setlocale (LC_NUMERIC, "C");
-
Inkscape::Application::create(argv[0], true);
if(filenames.empty())
diff --git a/src/main.cpp b/src/main.cpp
index f23f9a9f7..3a7050f9b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1325,7 +1325,6 @@ int sp_main_console(int argc, char const **argv)
char **argv2 = const_cast<char **>(argv);
gtk_init_check( &argc, &argv2 );
- //setlocale(LC_ALL, "");
GSList *fl = NULL;
int retVal = sp_common_main( argc, argv, &fl );