From a4f31a97e407280dc7e306a6c96948b53f9c0cab Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 3 Apr 2013 18:05:17 +0000 Subject: SmileyAdd: - array indexes totally unborkred; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@4296 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SmileyAdd/src/dlgboxsubclass.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'plugins/SmileyAdd/src/dlgboxsubclass.cpp') diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index d10d8f9246..554258dee7 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -114,7 +114,7 @@ public: if (OldButtonPlace) { - if (isSplit && DBGetContactSettingByte(NULL, "SRMsg", "ShowQuote", FALSE)) + if (isSplit && db_get_b(NULL, "SRMsg", "ShowQuote", FALSE)) { GetWindowRect(QuoteB, &rect); pt.x = rect.right + 12; @@ -199,17 +199,17 @@ public: bool showButtonLine; if (IsOldSrmm()) { - isSplit = DBGetContactSettingByte(NULL,"SRMsg","Split", TRUE) != 0; + isSplit = db_get_b(NULL,"SRMsg","Split", TRUE) != 0; doSmileyReplace = (isSplit || !isSend); doSmileyButton &= isSplit || isSend; - showButtonLine = DBGetContactSettingByte(NULL, "SRMsg", "ShowButtonLine", TRUE) != 0; + showButtonLine = db_get_b(NULL, "SRMsg", "ShowButtonLine", TRUE) != 0; } else { doSmileyReplace = true; OldButtonPlace = false; - showButtonLine = DBGetContactSettingByte(NULL, "SRMM", "ShowButtonLine", TRUE) != 0; + showButtonLine = db_get_b(NULL, "SRMM", "ShowButtonLine", TRUE) != 0; } doSmileyButton &= OldButtonPlace || showButtonLine; @@ -275,10 +275,8 @@ bool IsOldSrmm(void) int UpdateSrmmDlg(WPARAM wParam, LPARAM /* lParam */) { WaitForSingleObject(g_hMutex, 2000); - for (int i=0; ihContact == (HANDLE)wParam) - { + for (int i=0; i < g_MsgWndList.getCount(); ++i) { + if (wParam == 0 || g_MsgWndList[i]->hContact == (HANDLE)wParam) { SendMessage(g_MsgWndList[i]->hwnd, WM_SETREDRAW, FALSE, 0); SendMessage(g_MsgWndList[i]->hwnd, DM_OPTIONSAPPLIED, 0, 0); SendMessage(g_MsgWndList[i]->hwnd, WM_SETREDRAW, TRUE, 0); @@ -541,7 +539,7 @@ void RemoveDialogBoxHook(void) if (g_hMessageHookPre) UnhookWindowsHookEx(g_hMessageHookPre); WaitForSingleObject(g_hMutex, 2000); - for (int i=0; i