From 6b3e562d6aa0b1087268d4b387c425f05af970ee Mon Sep 17 00:00:00 2001 From: Don Ho Date: Thu, 1 Sep 2016 02:53:43 +0200 Subject: [PATCH] Fix crash issue in x64 version while launching Styler Configurator --- PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h index 2123cc384..f9aa379c8 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h @@ -123,8 +123,8 @@ private : ColourPicker *_pFgColour = nullptr; ColourPicker *_pBgColour = nullptr; - int _currentLexerIndex = -1; - int _currentThemeIndex = -1; + int _currentLexerIndex = 0; + int _currentThemeIndex = 0; HWND _hCheckBold; HWND _hCheckItalic; @@ -159,8 +159,9 @@ private : Style & getCurrentStyler() { - auto styleIndex = ::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_GETCURSEL, 0, 0); - if (styleIndex == LB_ERR) styleIndex = 0; + int32_t styleIndex = static_cast(::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_GETCURSEL, 0, 0)); + if (styleIndex == LB_ERR) + styleIndex = 0; if (_currentLexerIndex == 0) {