Fix 2 performance issue in Style Configurator

Fix #14321
This commit is contained in:
Don Ho 2023-11-05 20:48:10 +01:00
parent 07041f4565
commit 950236bb8f
1 changed files with 10 additions and 2 deletions

View File

@ -284,7 +284,7 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
{
updateExtension();
notifyDataModified();
apply();
// apply(); // apply() function has no effect on adding & modifying user defined extension, but it's just time consuming
}
}
else
@ -872,7 +872,15 @@ void WordStyleDlg::setStyleListFromLexer(int index)
// then restore the status after sending this message.
bool isDirty = _isDirty;
bool isThemeDirty = _isThemeDirty;
::SendDlgItemMessage(_hSelf, IDC_USER_EXT_EDIT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(userExt));
constexpr int NB_MAX = 256;
TCHAR currentExt[NB_MAX]{};
::SendDlgItemMessage(_hSelf, IDC_USER_EXT_EDIT, WM_GETTEXT, NB_MAX, reinterpret_cast<LPARAM>(currentExt));
if (userExt && lstrcmp(currentExt, userExt) != 0)
{
::SendDlgItemMessage(_hSelf, IDC_USER_EXT_EDIT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(userExt));
}
_isDirty = isDirty;
_isThemeDirty = isThemeDirty;
::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), isDirty || isThemeDirty);