From 3482ed97eaf398f425b4efc63d4be8035b34e8ef Mon Sep 17 00:00:00 2001 From: xomx Date: Fri, 25 Feb 2022 14:52:43 +0100 Subject: [PATCH] Fix UDL comment config input fields broken regression Which caused by commit 94154b0f0e281b4bbfad9c59f8d01c9dff305c12. Fix #11239, close #11292 --- .../src/ScintillaComponent/UserDefineDialog.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp b/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp index 5995a17ba..14d2e3e06 100644 --- a/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp +++ b/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp @@ -535,11 +535,12 @@ void CommentStyleDialog::setKeywords2List(int id) IDC_COMMENT_CLOSE_EDIT }; - for (size_t i = 0; i < sizeof(list)/sizeof(int); ++i) + TCHAR intBuffer[10] = { '0', 0 }; + for (int i = 0; static_cast(i) < sizeof(list) / sizeof(int); ++i) { - wstring intStr = std::to_wstring(i); + generic_itoa(i, intBuffer + 1, 10); ::GetDlgItemText(_hSelf, list[i], buffer, max_char); - convertTo(newList, max_char, buffer, intStr.c_str()); + convertTo(newList, max_char, buffer, intBuffer); } wcscpy_s(_pUserLang->_keywordLists[index], newList); @@ -597,11 +598,12 @@ void CommentStyleDialog::updateDlg() IDC_COMMENT_CLOSE_EDIT }; - for (size_t i=0; i(i) < sizeof(list) / sizeof(int); ++i) { - wstring intStr = std::to_wstring(i); - retrieve(buffer, _pUserLang->_keywordLists[SCE_USER_KWLIST_COMMENTS], intStr.c_str()); - ::SendDlgItemMessage(_hSelf, list[i], WM_SETTEXT, 0, reinterpret_cast(buffer)); + generic_itoa(i, intBuffer + 1, 10); + retrieve(buffer, _pUserLang->_keywordLists[SCE_USER_KWLIST_COMMENTS], intBuffer); + ::SendDlgItemMessage(_hSelf, list[i], WM_SETTEXT, 0, reinterpret_cast(buffer)); } ::SendDlgItemMessage(_hSelf, IDC_FOLDING_OF_COMMENTS, BM_SETCHECK, _pUserLang->_allowFoldOfComments, 0);