mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
BugFix: mixed-up Locale for XML I/O caused by GTK Dialogs
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include <glad/glad.h>
|
||||
|
||||
// standalone image loader
|
||||
#include "stb_image.h"
|
||||
#include <stb_image.h>
|
||||
|
||||
// CMake Ressource Compiler
|
||||
#include <cmrc/cmrc.hpp>
|
||||
|
||||
@@ -120,7 +120,8 @@ void SessionCreator::loadConfig(XMLElement *viewsNode)
|
||||
SessionLoader::SessionLoader(Session *session, int recursion): Visitor(),
|
||||
session_(session), xmlCurrent_(nullptr), recursion_(recursion)
|
||||
{
|
||||
|
||||
// impose C locale
|
||||
std::setlocale(LC_ALL, "C");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "SystemToolkit.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <locale>
|
||||
|
||||
#include <tinyxml2.h>
|
||||
using namespace tinyxml2;
|
||||
@@ -25,6 +26,9 @@ using namespace tinyxml2;
|
||||
|
||||
bool SessionVisitor::saveSession(const std::string& filename, Session *session)
|
||||
{
|
||||
// impose C locale
|
||||
std::setlocale(LC_ALL, "C");
|
||||
|
||||
// creation of XML doc
|
||||
XMLDocument xmlDoc;
|
||||
|
||||
@@ -77,6 +81,9 @@ SessionVisitor::SessionVisitor(tinyxml2::XMLDocument *doc,
|
||||
tinyxml2::XMLElement *root,
|
||||
bool recursive) : Visitor(), recursive_(recursive), xmlCurrent_(root)
|
||||
{
|
||||
// impose C locale
|
||||
std::setlocale(LC_ALL, "C");
|
||||
|
||||
if (doc == nullptr)
|
||||
xmlDoc_ = new XMLDocument;
|
||||
else
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <locale>
|
||||
using namespace std;
|
||||
|
||||
#include <tinyxml2.h>
|
||||
@@ -17,6 +18,9 @@ static string settingsFilename = "";
|
||||
|
||||
void Settings::Save()
|
||||
{
|
||||
// impose C locale for all app
|
||||
std::setlocale(LC_ALL, "C");
|
||||
|
||||
XMLDocument xmlDoc;
|
||||
XMLDeclaration *pDec = xmlDoc.NewDeclaration();
|
||||
xmlDoc.InsertFirstChild(pDec);
|
||||
@@ -216,6 +220,9 @@ void Settings::Save()
|
||||
|
||||
void Settings::Load()
|
||||
{
|
||||
// impose C locale for all app
|
||||
std::setlocale(LC_ALL, "C");
|
||||
|
||||
XMLDocument xmlDoc;
|
||||
if (settingsFilename.empty())
|
||||
settingsFilename = SystemToolkit::full_filename(SystemToolkit::settings_path(), APP_SETTINGS);
|
||||
|
||||
Reference in New Issue
Block a user