Skip to content

Commit

Permalink
Merge branch 'npp_official_svn' into jl/LH-45/integrate-npp-svn
Browse files Browse the repository at this point in the history
[BUG_FIXED] Fix the bug while changing the language list in Style Configurator,
the "Save and close" button is enabled.

[#45]

Signed-off-by: Jocelyn Legault <jocelynlegault@gmail.com>
  • Loading branch information
joce committed Sep 30, 2010
2 parents 965d19f + ad8dee5 commit a4e07b9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,17 @@ void WordStyleDlg::setStyleListFromLexer(int index)
const TCHAR *ext = NppParameters::getInstance()->getLangExtFromName(langName);
const TCHAR *userExt = (_lsArray.getLexerStylerByName(langName))->getLexerUserExt();
::SendDlgItemMessage(_hSelf, IDC_DEF_EXT_EDIT, WM_SETTEXT, 0, (LPARAM)(ext));

// WM_SETTEXT cause sending WM_COMMAND message with EN_CHANGE.
// That makes status dirty, even it shouldn't in this case.
// The walk around solution is get the current status before sending WM_SETTEXT,
// then restore the status after sending this message.
bool isDirty = _isDirty;
bool isThemeDirty = _isThemeDirty;
::SendDlgItemMessage(_hSelf, IDC_USER_EXT_EDIT, WM_SETTEXT, 0, (LPARAM)(userExt));
_isDirty = isDirty;
_isThemeDirty = isThemeDirty;
::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), isDirty || isThemeDirty);
}
::ShowWindow(::GetDlgItem(_hSelf, IDC_DEF_EXT_EDIT), index?SW_SHOW:SW_HIDE);
::ShowWindow(::GetDlgItem(_hSelf, IDC_DEF_EXT_STATIC), index?SW_SHOW:SW_HIDE);
Expand Down

0 comments on commit a4e07b9

Please sign in to comment.