From 9ad6f6af79fbafff6148cacb89fbc2089dca4985 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 8 Jun 2007 15:49:37 +0000 Subject: [PATCH] - fixes #237 - current BM fails to build with wxWidgets unicode variant (Applied Frank Thomas's patch) clientgui/ SkinManager.cpp svn path=/trunk/boinc/; revision=12859 --- checkin_notes | 7 +++++++ clientgui/SkinManager.cpp | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/checkin_notes b/checkin_notes index d463512dd5..b8d02bd658 100755 --- a/checkin_notes +++ b/checkin_notes @@ -5975,3 +5975,10 @@ Charlie 8 June 2007 make_GridRepublic.sh release_GridRepublic.sh +Rom 8 June 2007 + - fixes #237 - current BM fails to build with wxWidgets + unicode variant + (Applied Frank Thomas's patch) + + clientgui/ + SkinManager.cpp diff --git a/clientgui/SkinManager.cpp b/clientgui/SkinManager.cpp index 2bef100e19..317aa9a0ef 100644 --- a/clientgui/SkinManager.cpp +++ b/clientgui/SkinManager.cpp @@ -1207,7 +1207,7 @@ bool CSkinManager::ReloadSkin(wxLocale* pLocale, wxString strSkin) { // First we try the users canonical locale resources. // i.e. en_US retval = ERR_XML_PARSE; - p = fopen(ConstructSkinFileName().c_str(), "r"); + p = fopen((const char*)ConstructSkinFileName().mb_str(wxConvUTF8), "r"); if (p) { mf.init_file(p); retval = Parse(mf, strDesiredLocale); @@ -1218,7 +1218,7 @@ bool CSkinManager::ReloadSkin(wxLocale* pLocale, wxString strSkin) { // locale. // i.e. en if (ERR_XML_PARSE == retval) { - p = fopen(ConstructSkinFileName().c_str(), "r"); + p = fopen((const char*)ConstructSkinFileName().mb_str(wxConvUTF8), "r"); if (p) { mf.init_file(p); retval = Parse(mf, strDesiredLocale.Left(2)); @@ -1229,7 +1229,7 @@ bool CSkinManager::ReloadSkin(wxLocale* pLocale, wxString strSkin) { // If we failed the second lookup try english // i.e. en if (ERR_XML_PARSE == retval) { - p = fopen(ConstructSkinFileName().c_str(), "r"); + p = fopen((const char*)ConstructSkinFileName().mb_str(wxConvUTF8), "r"); if (p) { mf.init_file(p); retval = Parse(mf, wxT("en")); @@ -1343,7 +1343,7 @@ int CSkinManager::Parse(MIOFILE& in, wxString strDesiredLocale) { // Look for the begining of the desired locale. while (in.fgets(buf, 256)) { - if (match_tag(buf, strLocaleStartTag.c_str())) { + if (match_tag(buf, (const char*)strLocaleStartTag.mb_str(wxConvUTF8))) { bLocaleFound = true; break; } @@ -1352,7 +1352,7 @@ int CSkinManager::Parse(MIOFILE& in, wxString strDesiredLocale) { if (!bLocaleFound) return ERR_XML_PARSE; while (in.fgets(buf, 256)) { - if (match_tag(buf, strLocaleEndTag.c_str())) break; + if (match_tag(buf, (const char*)strLocaleStartTag.mb_str(wxConvUTF8))) break; else if (match_tag(buf, "")) { m_SimpleSkin.Parse(in); continue;