From 075c7d0030e543e59adceae9e73c73cbb661482f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 10 Jun 2014 14:01:23 +0000 Subject: fix for crash in clist_nicer on startup git-svn-id: http://svn.miranda-ng.org/main/trunk@9432 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/CLCButton.cpp | 35 ++++--------------------------- plugins/Clist_nicer/src/Include/Version.h | 2 +- plugins/Clist_nicer/src/config.cpp | 22 +++++++++---------- 3 files changed, 16 insertions(+), 43 deletions(-) (limited to 'plugins/Clist_nicer') diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index c337a226e9..5cbf3fd6d6 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -43,29 +43,6 @@ struct CluiTopButton BTNS[] = static int g_index = -1; -static int getButtonIndex(HANDLE hButton) -{ - // nasty clutch. during the initial customization - // hButton isn't assigned into BNTS yet - if (g_index != -1) - return g_index; - - for (int i = 0; i < SIZEOF(BTNS); i++) - if (BTNS[i].hButton == hButton) - return i; - - return -1; -} - -static int getLastIndex() -{ - for (int i = 0; ; i++) - if (BTNS[i].pszButtonID == NULL) - return i; - - return -1; -} - static void InitDefaultButtons() { for (int i = 0; i < SIZEOF(BTNS); i++ ) { @@ -597,18 +574,14 @@ static void CustomizeToolbar(HANDLE hButton, HWND hWnd, LPARAM) mir_subclassWindow(hWnd, TSButtonWndProc); MButtonExtension *bct = (MButtonExtension*)GetWindowLongPtr(hWnd, 0); - int idx = getButtonIndex(hButton); - if (idx != -1) { // adding built-in button - BTNS[idx].hwndButton = hWnd; - if (BTNS[idx].isAction) + if (g_index != -1) { // adding built-in button + BTNS[g_index].hwndButton = hWnd; + if (BTNS[g_index].isAction) bct->bSendOnDown = true; - if (!BTNS[idx].isPush) + if (!BTNS[g_index].isPush) bct->bIsPushBtn = true; } else { - idx = getLastIndex(); - BTNS[idx].hwndButton = hWnd; - BTNS[idx].pszButtonID = "plugin"; bool bSkinned = cfg::dat.bSkinnedButtonMode != 0; CustomizeButton(hWnd, bSkinned, !bSkinned, bSkinned, true); } diff --git a/plugins/Clist_nicer/src/Include/Version.h b/plugins/Clist_nicer/src/Include/Version.h index 6e24a0cd7e..74cce7462a 100644 --- a/plugins/Clist_nicer/src/Include/Version.h +++ b/plugins/Clist_nicer/src/Include/Version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 9 #define __RELEASE_NUM 2 -#define __BUILD_NUM 2 +#define __BUILD_NUM 3 #include diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 96663f2074..2034a7d7e5 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -32,20 +32,20 @@ LIST cfg::arCache(100, LIST::FTSortFunc(NumericKeySort bool cfg::shutDown = false; -TSysConfig API::sysConfig = {0}; -TSysState API::sysState = {0}; +TSysConfig API::sysConfig = {0}; +TSysState API::sysState = {0}; -pfnDwmExtendFrameIntoClientArea_t API::pfnDwmExtendFrameIntoClientArea = 0; -pfnDwmIsCompositionEnabled_t API::pfnDwmIsCompositionEnabled = 0; +pfnDwmExtendFrameIntoClientArea_t API::pfnDwmExtendFrameIntoClientArea = 0; +pfnDwmIsCompositionEnabled_t API::pfnDwmIsCompositionEnabled = 0; EXCEPTION_RECORD API::exRecord = {0}; -CONTEXT API::exCtx = {0}; -LRESULT API::exLastResult = 0; -char API::exSzFile[MAX_PATH] = ""; -TCHAR API::exReason[256] = _T(""); -int API::exLine = 0; -bool API::exAllowContinue = false; -HMODULE API::hDwm = 0; +CONTEXT API::exCtx = {0}; +LRESULT API::exLastResult = 0; +char API::exSzFile[MAX_PATH] = ""; +TCHAR API::exReason[256] = _T(""); +int API::exLine = 0; +bool API::exAllowContinue = false; +HMODULE API::hDwm = 0; void cfg::init() { -- cgit v1.2.3