diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
commit | 78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch) | |
tree | 8512c50df70b8dd80c919e88ade3419207c95956 /plugins/TabSRMM/chat | |
parent | ce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff) |
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/chat')
-rw-r--r-- | plugins/TabSRMM/chat/clist.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/chat/muchighlight.cpp | 24 | ||||
-rw-r--r-- | plugins/TabSRMM/chat/options.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/chat/services.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/chat/tools.cpp | 14 | ||||
-rw-r--r-- | plugins/TabSRMM/chat/window.cpp | 28 |
6 files changed, 37 insertions, 37 deletions
diff --git a/plugins/TabSRMM/chat/clist.cpp b/plugins/TabSRMM/chat/clist.cpp index d321c4d017..18f1eba4e4 100644 --- a/plugins/TabSRMM/chat/clist.cpp +++ b/plugins/TabSRMM/chat/clist.cpp @@ -52,7 +52,7 @@ static HANDLE Clist_GroupExists(TCHAR *tszGroup) do {
_itoa(i, str, 10);
result = M->GetTString(0, "CListGroups", str, &dbv);
- if(!result) {
+ if (!result) {
match = (!_tcscmp(tszGroup, &dbv.ptszVal[1]) && (lstrlen(tszGroup) == lstrlen(&dbv.ptszVal[1])));
DBFreeVariant(&dbv);
if(match)
diff --git a/plugins/TabSRMM/chat/muchighlight.cpp b/plugins/TabSRMM/chat/muchighlight.cpp index d790cc1d2b..80709d863a 100644 --- a/plugins/TabSRMM/chat/muchighlight.cpp +++ b/plugins/TabSRMM/chat/muchighlight.cpp @@ -91,20 +91,20 @@ void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr) TCHAR *p = tszString;
- if(*p == 0)
+ if (*p == 0)
return;
nr = 0;
- if(*p != ' ')
+ if (*p != ' ')
nr++;
while(*p) {
- if(*p == ' ') {
+ if (*p == ' ') {
p++;
while(*p && _istspace(*p))
p++;
- if(*p)
+ if (*p)
nr++;
}
p++;
@@ -114,15 +114,15 @@ void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr) p = tszString;
nr = 0;
- if(*p != ' ')
+ if (*p != ' ')
patterns[nr++] = p;
while(*p) {
- if(*p == ' ') {
+ if (*p == ' ') {
*p++ = 0;
while(*p && _istspace(*p))
p++;
- if(*p)
+ if (*p)
patterns[nr++] = p;
}
p++;
@@ -137,7 +137,7 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF return(0);
__try {
- if((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) {
+ if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) {
#ifdef __HLT_PERFSTATS
int words = 0;
M->startTimer();
@@ -162,12 +162,12 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF while(*p && (*p == ' ' || *p == ',' || *p == '.' || *p == ':' || *p == ';' || *p == '?' || *p == '!'))
p++;
- if(*p) {
+ if (*p) {
p1 = p;
while(*p1 && *p1 != ' ' && *p1 != ',' && *p1 != '.' && *p1 != ':' && *p1 != ';' && *p1 != '?' && *p1 != '!')
p1++;
- if(*p1)
+ if (*p1)
*p1 = 0;
else
p1 = 0;
@@ -205,11 +205,11 @@ skip_textpatterns: /*
* optinally, match the nickname against the list of nicks to highlight
*/
- if((m_dwFlags & MATCH_NICKNAME) && (dwFlags & MATCH_NICKNAME) && pgce->ptszNick && m_iNickPatterns > 0) {
+ if ((m_dwFlags & MATCH_NICKNAME) && (dwFlags & MATCH_NICKNAME) && pgce->ptszNick && m_iNickPatterns > 0) {
for(UINT i = 0; i < m_iNickPatterns && !nResult; i++) {
if(pgce->ptszNick)
nResult = wildmatch(m_NickPatterns[i], pgce->ptszNick) ? MATCH_NICKNAME : 0;
- if((m_dwFlags & MATCH_UIN) && pgce->ptszUserInfo)
+ if ((m_dwFlags & MATCH_UIN) && pgce->ptszUserInfo)
nResult = wildmatch(m_NickPatterns[i], pgce->ptszUserInfo) ? MATCH_NICKNAME : 0;
}
}
diff --git a/plugins/TabSRMM/chat/options.cpp b/plugins/TabSRMM/chat/options.cpp index b2b6d9c63c..d50ed5ecbb 100644 --- a/plugins/TabSRMM/chat/options.cpp +++ b/plugins/TabSRMM/chat/options.cpp @@ -1023,8 +1023,8 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM while(*p && (*p == '\\' || *p == '.'))
p++;
- if(*p) {
- if((p1 = _tcschr(p, '\\')))
+ if (*p) {
+ if ((p1 = _tcschr(p, '\\')))
*p1 = 0;
}
diff --git a/plugins/TabSRMM/chat/services.cpp b/plugins/TabSRMM/chat/services.cpp index e165763861..5e241823b7 100644 --- a/plugins/TabSRMM/chat/services.cpp +++ b/plugins/TabSRMM/chat/services.cpp @@ -555,7 +555,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT }
}
if (bActivateTab) {
- if (PluginConfig.m_HideOnClose && !IsWindowVisible(pContainer->hwnd)){
+ if (PluginConfig.m_HideOnClose && !IsWindowVisible(pContainer->hwnd)) {
WINDOWPLACEMENT wp={0};
wp.length = sizeof(wp);
GetWindowPlacement(pContainer->hwnd, &wp);
diff --git a/plugins/TabSRMM/chat/tools.cpp b/plugins/TabSRMM/chat/tools.cpp index 0726a01869..c7ad91cc4c 100644 --- a/plugins/TabSRMM/chat/tools.cpp +++ b/plugins/TabSRMM/chat/tools.cpp @@ -337,7 +337,7 @@ static BOOL DoPopup(SESSION_INFO* si, GCEVENT* gce, struct TWindowData* dat) }
if (dat && pContainer != 0) { // message window is open, need to check the container config if we want to see a popup nonetheless
if (nen_options.bWindowCheck) { // no popups at all for open windows... no exceptions
- if(!PluginConfig.m_HideOnClose)
+ if (!PluginConfig.m_HideOnClose)
return(0);
if(pContainer->fHidden)
goto passed;
@@ -364,7 +364,7 @@ passed: int iNewEvent = iEvent;
COLORREF clr = 0;
- if((iNewEvent & GC_EVENT_HIGHLIGHT)) {
+ if ((iNewEvent & GC_EVENT_HIGHLIGHT)) {
clr = aFonts[16].color;
iNewEvent &= ~GC_EVENT_HIGHLIGHT;
}
@@ -541,7 +541,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh params->bInactive = TRUE;
if(si->hWnd && si->dat) {
dat = si->dat;
- if((si->hWnd == si->dat->pContainer->hwndActive) && GetForegroundWindow() == si->dat->pContainer->hwnd)
+ if ((si->hWnd == si->dat->pContainer->hwndActive) && GetForegroundWindow() == si->dat->pContainer->hwnd)
params->bInactive = FALSE;
}
params->bActiveTab = params->bMustFlash = params->bMustAutoswitch = FALSE;
@@ -776,7 +776,7 @@ BOOL LogToFile(SESSION_INFO* si, GCEVENT * gce) /*
* check whether we have to log this event
*/
- if(!(gce->pDest->iType & si->iDiskLogFlags))
+ if (!(gce->pDest->iType & si->iDiskLogFlags))
return FALSE;
szBuffer[0] = '\0';
@@ -919,7 +919,7 @@ BOOL LogToFile(SESSION_INFO* si, GCEVENT * gce) mir_sntprintf(tszNewName, _MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20, _T("%s%s-%s%s"), tszNewPath, tszName, tszTimestamp, tszExt);
fclose(hFile);
hFile = 0;
- if(!PathFileExists(tszNewName))
+ if (!PathFileExists(tszNewName))
CopyFile(si->pszLogFileName, tszNewName, TRUE);
DeleteFile(si->pszLogFileName);
}
@@ -1272,7 +1272,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) int i;
bool fReparse = false;
- if(!tTime)
+ if (!tTime)
time(&tTime);
/*
@@ -1331,7 +1331,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) dat.variables = rva;
tszParsedName = (TCHAR*) CallService(MS_UTILS_REPLACEVARS, (WPARAM)g_Settings.pszLogDir, (LPARAM)&dat);
- if(!M->pathIsAbsolute(tszParsedName))
+ if (!M->pathIsAbsolute(tszParsedName))
mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s%s"), M->getChatLogPath(), tszParsedName);
else
mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s"), tszParsedName);
diff --git a/plugins/TabSRMM/chat/window.cpp b/plugins/TabSRMM/chat/window.cpp index 0c7d3c8f99..61913f04b5 100644 --- a/plugins/TabSRMM/chat/window.cpp +++ b/plugins/TabSRMM/chat/window.cpp @@ -268,7 +268,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg) GetCursorPos(&pt);
GetWindowRect(si->hwndFilter, &rcFilter);
- if(!PtInRect(&rcFilter, pt)) {
+ if (!PtInRect(&rcFilter, pt)) {
SendMessage(si->hwndFilter, WM_CLOSE, 1, 1);
si->hwndFilter = 0;
}
@@ -972,8 +972,8 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, }
SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE);
- if(!fCompleted && !PluginConfig.m_AllowTab) {
- if((GetSendButtonState(mwdat->hwnd) != PBS_DISABLED))
+ if (!fCompleted && !PluginConfig.m_AllowTab) {
+ if ((GetSendButtonState(mwdat->hwnd) != PBS_DISABLED))
SetFocus(GetDlgItem(mwdat->hwnd, IDOK));
else
SetFocus(GetDlgItem(mwdat->hwnd, IDC_CHAT_LOG));
@@ -1984,7 +1984,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar dat->fIsAutosizingInput = IsAutoSplitEnabled(dat);
dat->fLimitedUpdate = false;
dat->iInputAreaHeight = -1;
- if(!dat->pContainer->settings->fPrivate)
+ if (!dat->pContainer->settings->fPrivate)
psi->iSplitterY = g_Settings.iSplitterY;
else {
if(M->GetByte("Chat", "SyncSplitter", 0))
@@ -2198,10 +2198,10 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar //Mad: strange rare crash here...
mi = MM_FindModule(si->pszModule);
- if(!mi)
+ if (!mi)
break;
- if(!mi->ptszModDispName)
+ if (!mi->ptszModDispName)
break;
x += GetTextPixelSize(mi->ptszModDispName, (HFONT)SendMessage(dat->pContainer->hwndStatus, WM_GETFONT, 0, 0), TRUE);
@@ -2211,7 +2211,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar time_t now = time(0);
DWORD diff = (now - mi->idleTimeStamp) / 60;
- if((diff >= 1 && diff != mi->lastIdleCheck) || lParam) {
+ if ((diff >= 1 && diff != mi->lastIdleCheck) || lParam) {
mi->lastIdleCheck = diff;
if(diff == 0)
mi->tszIdleMsg[0] = 0;
@@ -2720,7 +2720,7 @@ LABEL_SHOWWINDOW: if(msg == WM_SYSKEYUP) {
if(wp == VK_MENU) {
- if(!dat->fkeyProcessed && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000) && !(lp & (1 << 24)))
+ if (!dat->fkeyProcessed && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000) && !(lp & (1 << 24)))
dat->pContainer->MenuBar->autoShow();
}
return(_dlgReturn(hwndDlg, 0));
@@ -2777,7 +2777,7 @@ LABEL_SHOWWINDOW: }
if(msg == WM_KEYDOWN && wp == VK_TAB) {
- if(((NMHDR *)lParam)->idFrom == IDC_CHAT_LOG) {
+ if (((NMHDR *)lParam)->idFrom == IDC_CHAT_LOG) {
SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
return(_dlgReturn(hwndDlg, 1));
}
@@ -3072,7 +3072,7 @@ LABEL_SHOWWINDOW: POINT tmp; //+ Protogenes
POINTS cur; //+ Protogenes
GetCursorPos(&tmp); //+ Protogenes
- if(!dat->Panel->isHovered()) {
+ if (!dat->Panel->isHovered()) {
cur.x = (SHORT)tmp.x; //+ Protogenes
cur.y = (SHORT)tmp.y; //+ Protogenes
SendMessage(dat->pContainer->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, *((LPARAM*)(&cur))); //+ Protogenes
@@ -3446,7 +3446,7 @@ LABEL_SHOWWINDOW: dat->Panel->renderContent(hdcMem);
- if(!CSkin::m_skinEnabled)
+ if (!CSkin::m_skinEnabled)
CSkin::RenderToolbarBG(dat, hdcMem, rcClient);
if(hbp)
@@ -3457,7 +3457,7 @@ LABEL_SHOWWINDOW: DeleteObject(hbm);
DeleteDC(hdcMem);
}
- if(!dat->fLimitedUpdate)
+ if (!dat->fLimitedUpdate)
SetAeroMargins(dat->pContainer);
return(1);
}
@@ -3540,7 +3540,7 @@ LABEL_SHOWWINDOW: case DM_CONTAINERSELECTED: {
struct TContainerData *pNewContainer = 0;
TCHAR *szNewName = (TCHAR *)lParam;
- if(!_tcscmp(szNewName, CTranslator::get(CTranslator::GEN_DEFAULT_CONTAINER_NAME)))
+ if (!_tcscmp(szNewName, CTranslator::get(CTranslator::GEN_DEFAULT_CONTAINER_NAME)))
szNewName = CGlobals::m_default_container_name;
int iOldItems = TabCtrl_GetItemCount(hwndTab);
if (!_tcsncmp(dat->pContainer->szName, szNewName, CONTAINER_NAMELEN))
@@ -3797,7 +3797,7 @@ LABEL_SHOWWINDOW: TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSING, 0);
- if(!dat->fIsAutosizingInput)
+ if (!dat->fIsAutosizingInput)
DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
if(dat->pContainer->settings->fPrivate && !IsAutoSplitEnabled(dat))
|