Index: src/libictranslate/ResourceManager.cpp =================================================================== diff -u -N -rd99ea57e5e78d9b2cc7d6024d9f26f2b4da7cc86 -r8379c88620bc401673c4171e729f4d15a4d5354a --- src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision d99ea57e5e78d9b2cc7d6024d9f26f2b4da7cc86) +++ src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision 8379c88620bc401673c4171e729f4d15a4d5354a) @@ -153,14 +153,11 @@ CLangData::CLangData() : m_pszFilename(NULL), m_pszLngName(NULL), - m_pszBaseFile(NULL), m_pszFontFace(NULL), - m_wLangCode(0), m_wPointSize(0), m_pszHelpName(NULL), m_pszAuthor(NULL), m_pszVersion(NULL), - m_byCharset(0), m_bRTL(false), m_uiSectionID(0), m_bUpdating(false) @@ -171,7 +168,6 @@ { delete [] m_pszFilename; delete [] m_pszLngName; - delete [] m_pszBaseFile; delete [] m_pszFontFace; delete [] m_pszHelpName; delete [] m_pszAuthor; @@ -184,8 +180,6 @@ m_pszFilename = NULL; delete [] m_pszLngName; m_pszLngName = NULL; - delete [] m_pszBaseFile; - m_pszBaseFile = NULL; delete [] m_pszFontFace; m_pszFontFace = NULL; delete [] m_pszHelpName; @@ -201,17 +195,14 @@ CLangData::CLangData(const CLangData& ld) : m_pszFilename(NULL), m_pszLngName(NULL), - m_pszBaseFile(NULL), m_pszFontFace(NULL), m_pszHelpName(NULL), m_pszAuthor(NULL), m_pszVersion(NULL) { SetFilename(ld.GetFilename(true)); SetLangName(ld.GetLangName()); - SetLangCode(ld.GetLangCode()); SetFontFace(ld.GetFontFace()); - SetCharset(ld.GetCharset()); SetPointSize(ld.GetPointSize()); SetDirection(ld.GetDirection()); SetHelpName(ld.GetHelpName()); @@ -225,9 +216,7 @@ { SetFilename(rSrc.GetFilename(true)); SetLangName(rSrc.GetLangName()); - SetLangCode(rSrc.GetLangCode()); SetFontFace(rSrc.GetFontFace()); - SetCharset(rSrc.GetCharset()); SetPointSize(rSrc.GetPointSize()); SetDirection(rSrc.GetDirection()); SetHelpName(rSrc.GetHelpName()); @@ -244,10 +233,7 @@ { icpf::config cfg(icpf::config::eIni); const uint_t uiLangName = cfg.register_string(_T("Info/Lang Name"), _t("")); - const uint_t uiLangCode = cfg.register_signed_num(_T("Info/Lang Code"), 0, 0, 0xffff); - const uint_t uiBaseLanguage = cfg.register_string(_T("Info/Base Language"), _T("")); const uint_t uiFontFace = cfg.register_string(_T("Info/Font Face"), _T("")); - const uint_t uiCharset = cfg.register_signed_num(_T("Info/Charset"), 0, 0, 0xffff); const uint_t uiSize = cfg.register_signed_num(_T("Info/Size"), 0, 0, 0xffff); const uint_t uiRTL = cfg.register_bool(_T("Info/RTL reading order"), false); const uint_t uiHelpName = cfg.register_string(_T("Info/Help name"), _T("")); @@ -260,27 +246,14 @@ return false; SetLangName(psz); - ll_t ll = cfg.get_signed_num(uiLangCode); - if(ll == 0) - return false; - SetLangCode((WORD)ll); - - psz = cfg.get_string(uiBaseLanguage); - SetBaseFile(psz); - psz = cfg.get_string(uiFontFace); if(!psz || psz[0] == _t('\0')) return false; SetFontFace(psz); - ll = cfg.get_signed_num(uiCharset); + ll_t ll = cfg.get_signed_num(uiSize); if(ll == 0) return false; - SetCharset((BYTE)ll); - - ll = cfg.get_signed_num(uiSize); - if(ll == 0) - return false; SetPointSize((WORD)ll); SetDirection(cfg.get_bool(uiRTL)); @@ -427,10 +400,7 @@ // load data from file icpf::config cfg(icpf::config::eIni); const uint_t uiLangName = cfg.register_string(_T("Info/Lang Name"), _t("")); - const uint_t uiLangCode = cfg.register_signed_num(_T("Info/Lang Code"), 0, 0, 0xffff); - const uint_t uiBaseLanguage = cfg.register_string(_T("Info/Base Language"), _T("")); const uint_t uiFontFace = cfg.register_string(_T("Info/Font Face"), _T("")); - const uint_t uiCharset = cfg.register_signed_num(_T("Info/Charset"), 0, 0, 0xffff); const uint_t uiSize = cfg.register_signed_num(_T("Info/Size"), 0, 0, 0xffff); const uint_t uiRTL = cfg.register_bool(_T("Info/RTL reading order"), false); const uint_t uiHelpName = cfg.register_string(_T("Info/Help name"), _T("")); @@ -443,27 +413,14 @@ return false; SetLangName(psz); - ll_t ll = cfg.get_signed_num(uiLangCode); - if(ll == 0) - return false; - SetLangCode((WORD)ll); - - psz = cfg.get_string(uiBaseLanguage); - SetBaseFile(psz); - psz = cfg.get_string(uiFontFace); if(!psz || psz[0] == _t('\0')) return false; SetFontFace(psz); - ll = cfg.get_signed_num(uiCharset); + ll_t ll = cfg.get_signed_num(uiSize); if(ll == 0) return false; - SetCharset((BYTE)ll); - - ll = cfg.get_signed_num(uiSize); - if(ll == 0) - return false; SetPointSize((WORD)ll); SetDirection(cfg.get_bool(uiRTL)); @@ -510,10 +467,7 @@ // load data from file icpf::config cfg(icpf::config::eIni); cfg.set_string(_t("Info/Lang Name"), m_pszLngName); - cfg.set_string(_T("Info/Lang Code"), _itot(m_wLangCode, szTemp, 10)); - cfg.set_string(_T("Info/Base Language"), _T("")); cfg.set_string(_T("Info/Font Face"), m_pszFontFace); - cfg.set_string(_T("Info/Charset"), _itot(m_byCharset, szTemp, 10)); cfg.set_string(_T("Info/Size"), _itot(m_wPointSize, szTemp, 10)); cfg.set_string(_T("Info/RTL reading order"), m_bRTL ? _T("1") : _T("0")); cfg.set_string(_T("Info/Help name"), m_pszHelpName); @@ -644,11 +598,6 @@ _tcscpy(m_pszLngName, psz); } -void CLangData::SetBaseFile(PCTSTR psz) -{ - SetFnameData(&m_pszBaseFile, psz); -} - void CLangData::SetFontFace(PCTSTR psz) { if (m_pszFontFace) @@ -745,10 +694,7 @@ bool CResourceManager::SetLanguage(PCTSTR pszPath) { - WORD wOldLang = 0; bool bRet = false; - WORD wNewLang = 0; - tchar_t szPath[_MAX_PATH]; // parse the path to allow reading the english language first @@ -776,11 +722,9 @@ EnterCriticalSection(&m_cs); try { - wOldLang=m_ld.GetLangCode(); bRet = m_ld.ReadTranslation(szPath); // base language if(bRet && pszPath) bRet=m_ld.ReadTranslation(pszPath, true); // real language - wNewLang=m_ld.GetLangCode(); } catch(...) { @@ -796,13 +740,13 @@ while (it != m_lhDialogs.end()) { if (::IsWindow((*it)->m_hWnd)) - (*it)->PostMessage(WM_RMNOTIFY, RMNT_LANGCHANGE, (LPARAM)(wOldLang << 16 | wNewLang)); + (*it)->PostMessage(WM_RMNOTIFY, RMNT_LANGCHANGE, 0); it++; } // send the notification stuff to the others if (m_pfnCallback) - (*m_pfnCallback)(RMNT_LANGCHANGE, (wOldLang << 16 | wNewLang)); + (*m_pfnCallback)(RMNT_LANGCHANGE); return bRet; }