Author: dchapyshev Date: Sun Jan 18 05:20:32 2009 New Revision: 38883
URL: http://svn.reactos.org/svn/reactos?rev=38883&view=rev Log: - Fix bug with addition of keyboard layouts
Modified: trunk/reactos/dll/cpl/input/add.c trunk/reactos/dll/cpl/input/settings.c
Modified: trunk/reactos/dll/cpl/input/add.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/add.c?rev=388... ============================================================================== --- trunk/reactos/dll/cpl/input/add.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input/add.c [iso-8859-1] Sun Jan 18 05:20:32 2009 @@ -106,14 +106,39 @@ return; }
- if (GetLayoutName(LangID, Layout)) - { - if ((SendMessage(hLayoutList, CB_SELECTSTRING, (WPARAM) -1, (LPARAM)Layout) != CB_ERR)&& - (GetLayoutCount(Lang) >= 1)) - { - wsprintf(SubPath, _T("d%03d%s"), GetLayoutCount(Lang)-1, Lang); + if (_tcscmp(LangID, pts) != 0) + { + if (!GetLayoutName(pts, Layout)) + { + RegCloseKey(hKey); + return; + } + } + else + { + if (!GetLayoutName(LangID, Layout)) + { + RegCloseKey(hKey); + return; + } + } + + if (SendMessage(hLayoutList, CB_SELECTSTRING, (WPARAM) -1, (LPARAM)Layout) != CB_ERR) + { + if (GetLayoutCount(Lang) >= 1) + { + wsprintf(SubPath, _T("d%03d%s"), GetLayoutCount(Lang), Lang); + } + else if ((_tcscmp(LangID, pts) != 0) && (GetLayoutCount(Lang) == 0)) + { + wsprintf(SubPath, _T("d%03d%s"), 0, Lang); } else SubPath[0] = '\0'; + } + else + { + RegCloseKey(hKey); + return; }
if (_tcslen(SubPath) != 0)
Modified: trunk/reactos/dll/cpl/input/settings.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/settings.c?re... ============================================================================== --- trunk/reactos/dll/cpl/input/settings.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input/settings.c [iso-8859-1] Sun Jan 18 05:20:32 2009 @@ -64,7 +64,10 @@ GetLocaleInfo(langid, LOCALE_ILANGUAGE, szTmp, sizeof(szTmp) / sizeof(TCHAR)); wsprintf(szOldLangID, _T("0000%s"), szTmp);
- if (_tcscmp(szOldLangID, szLangID) == 0) IsLangExists = TRUE; + if (_tcscmp(szOldLangID, szLangID) == 0) + IsLangExists = TRUE; + else + IsLangExists = FALSE;
if (szPreload[0] == 'd') { @@ -84,7 +87,7 @@ } else { - if (_tcscmp(szPreload, szLayoutID) == 0) + if ((_tcscmp(szPreload, szLayoutID) == 0) && (IsLangExists)) { RegCloseKey(hKey); return TRUE;