mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-24 22:34:54 +02:00
Fix an eventual crash and UDL empty button issue after changing language
The bug was inserted by the following commit:
4d217387f1
Fix #13228
This commit is contained in:
parent
25be5dd3b6
commit
0b6a8e2011
@ -681,10 +681,16 @@ void NativeLangSpeaker::changeUserDefineLang(UserDefineDialog *userDefineDlg)
|
|||||||
HWND hItem = ::GetDlgItem(hDlg, id);
|
HWND hItem = ::GetDlgItem(hDlg, id);
|
||||||
if (hItem)
|
if (hItem)
|
||||||
{
|
{
|
||||||
const wchar_t *nameW = wmc.char2wchar(name, _nativeLangEncoding);
|
|
||||||
if (id == IDC_DOCK_BUTTON && userDefineDlg->isDocked())
|
if (id == IDC_DOCK_BUTTON && userDefineDlg->isDocked())
|
||||||
nameW = getAttrNameByIdStr(TEXT("Undock"), userDefineDlgNode, std::to_string(IDC_UNDOCK_BUTTON).c_str()).c_str();
|
{
|
||||||
::SetWindowText(hItem, nameW);
|
generic_string name = getAttrNameByIdStr(TEXT("Undock"), userDefineDlgNode, std::to_string(IDC_UNDOCK_BUTTON).c_str());
|
||||||
|
::SetWindowText(hItem, name.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const wchar_t *nameW = wmc.char2wchar(name, _nativeLangEncoding);
|
||||||
|
::SetWindowText(hItem, nameW);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user