mirror of
https://github.com/reactos/reactos.git
synced 2024-08-03 10:00:56 +00:00
- Fix bug with addition of keyboard layouts
svn path=/trunk/; revision=38883
This commit is contained in:
parent
667636f08a
commit
88cd4628a0
|
@ -106,15 +106,40 @@ AddNewLayout(HWND hwndDlg)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetLayoutName(LangID, Layout))
|
if (_tcscmp(LangID, pts) != 0)
|
||||||
{
|
{
|
||||||
if ((SendMessage(hLayoutList, CB_SELECTSTRING, (WPARAM) -1, (LPARAM)Layout) != CB_ERR)&&
|
if (!GetLayoutName(pts, Layout))
|
||||||
(GetLayoutCount(Lang) >= 1))
|
|
||||||
{
|
{
|
||||||
wsprintf(SubPath, _T("d%03d%s"), GetLayoutCount(Lang)-1, Lang);
|
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 SubPath[0] = '\0';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_tcslen(SubPath) != 0)
|
if (_tcslen(SubPath) != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,7 +64,10 @@ IsLayoutExists(LPTSTR szLayoutID, LPTSTR szLangID)
|
||||||
GetLocaleInfo(langid, LOCALE_ILANGUAGE, szTmp, sizeof(szTmp) / sizeof(TCHAR));
|
GetLocaleInfo(langid, LOCALE_ILANGUAGE, szTmp, sizeof(szTmp) / sizeof(TCHAR));
|
||||||
wsprintf(szOldLangID, _T("0000%s"), szTmp);
|
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')
|
if (szPreload[0] == 'd')
|
||||||
{
|
{
|
||||||
|
@ -84,7 +87,7 @@ IsLayoutExists(LPTSTR szLayoutID, LPTSTR szLangID)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_tcscmp(szPreload, szLayoutID) == 0)
|
if ((_tcscmp(szPreload, szLayoutID) == 0) && (IsLangExists))
|
||||||
{
|
{
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue