Skip to content

Commit

Permalink
Fix 2 performance issue in Style Configurator
Browse files Browse the repository at this point in the history
Fix #14321
  • Loading branch information
donho committed Nov 5, 2023
1 parent 07041f4 commit 950236b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 950236b

Please sign in to comment.