From 983830727db80ba8e6b1eb6c5663b1f9ab9c866d Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 7 May 2017 18:31:04 +0200 Subject: 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) --- src/file-update.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/file-update.cpp') 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) -- cgit v1.2.3