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>
|
#include <glad/glad.h>
|
||||||
|
|
||||||
// standalone image loader
|
// standalone image loader
|
||||||
#include "stb_image.h"
|
#include <stb_image.h>
|
||||||
|
|
||||||
// CMake Ressource Compiler
|
// CMake Ressource Compiler
|
||||||
#include <cmrc/cmrc.hpp>
|
#include <cmrc/cmrc.hpp>
|
||||||
|
|||||||
@@ -120,7 +120,8 @@ void SessionCreator::loadConfig(XMLElement *viewsNode)
|
|||||||
SessionLoader::SessionLoader(Session *session, int recursion): Visitor(),
|
SessionLoader::SessionLoader(Session *session, int recursion): Visitor(),
|
||||||
session_(session), xmlCurrent_(nullptr), recursion_(recursion)
|
session_(session), xmlCurrent_(nullptr), recursion_(recursion)
|
||||||
{
|
{
|
||||||
|
// impose C locale
|
||||||
|
std::setlocale(LC_ALL, "C");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "SystemToolkit.h"
|
#include "SystemToolkit.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <locale>
|
||||||
|
|
||||||
#include <tinyxml2.h>
|
#include <tinyxml2.h>
|
||||||
using namespace tinyxml2;
|
using namespace tinyxml2;
|
||||||
@@ -25,6 +26,9 @@ using namespace tinyxml2;
|
|||||||
|
|
||||||
bool SessionVisitor::saveSession(const std::string& filename, Session *session)
|
bool SessionVisitor::saveSession(const std::string& filename, Session *session)
|
||||||
{
|
{
|
||||||
|
// impose C locale
|
||||||
|
std::setlocale(LC_ALL, "C");
|
||||||
|
|
||||||
// creation of XML doc
|
// creation of XML doc
|
||||||
XMLDocument xmlDoc;
|
XMLDocument xmlDoc;
|
||||||
|
|
||||||
@@ -77,6 +81,9 @@ SessionVisitor::SessionVisitor(tinyxml2::XMLDocument *doc,
|
|||||||
tinyxml2::XMLElement *root,
|
tinyxml2::XMLElement *root,
|
||||||
bool recursive) : Visitor(), recursive_(recursive), xmlCurrent_(root)
|
bool recursive) : Visitor(), recursive_(recursive), xmlCurrent_(root)
|
||||||
{
|
{
|
||||||
|
// impose C locale
|
||||||
|
std::setlocale(LC_ALL, "C");
|
||||||
|
|
||||||
if (doc == nullptr)
|
if (doc == nullptr)
|
||||||
xmlDoc_ = new XMLDocument;
|
xmlDoc_ = new XMLDocument;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <locale>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include <tinyxml2.h>
|
#include <tinyxml2.h>
|
||||||
@@ -17,6 +18,9 @@ static string settingsFilename = "";
|
|||||||
|
|
||||||
void Settings::Save()
|
void Settings::Save()
|
||||||
{
|
{
|
||||||
|
// impose C locale for all app
|
||||||
|
std::setlocale(LC_ALL, "C");
|
||||||
|
|
||||||
XMLDocument xmlDoc;
|
XMLDocument xmlDoc;
|
||||||
XMLDeclaration *pDec = xmlDoc.NewDeclaration();
|
XMLDeclaration *pDec = xmlDoc.NewDeclaration();
|
||||||
xmlDoc.InsertFirstChild(pDec);
|
xmlDoc.InsertFirstChild(pDec);
|
||||||
@@ -216,6 +220,9 @@ void Settings::Save()
|
|||||||
|
|
||||||
void Settings::Load()
|
void Settings::Load()
|
||||||
{
|
{
|
||||||
|
// impose C locale for all app
|
||||||
|
std::setlocale(LC_ALL, "C");
|
||||||
|
|
||||||
XMLDocument xmlDoc;
|
XMLDocument xmlDoc;
|
||||||
if (settingsFilename.empty())
|
if (settingsFilename.empty())
|
||||||
settingsFilename = SystemToolkit::full_filename(SystemToolkit::settings_path(), APP_SETTINGS);
|
settingsFilename = SystemToolkit::full_filename(SystemToolkit::settings_path(), APP_SETTINGS);
|
||||||
|
|||||||
Reference in New Issue
Block a user