From d154673f93ad95197bce8cadb995daa5bc39f5d8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 21 Jan 2014 20:04:48 +0000 Subject: minor code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@7820 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/fonts/FontOptions.cpp | 26 +++++++++++++------------- src/modules/fonts/services.cpp | 30 +++++++++++++++--------------- 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src/modules/fonts') diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp index 3ab3696249..4b471ee47b 100644 --- a/src/modules/fonts/FontOptions.cpp +++ b/src/modules/fonts/FontOptions.cpp @@ -329,7 +329,7 @@ static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TC else tvi.hItem = TreeView_GetRoot(hwndTree); - if ( !name) + if (!name) return tvi.hItem; tvi.mask = TVIF_TEXT; @@ -340,7 +340,7 @@ static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TC { TreeView_GetItem(hwndTree, &tvi); - if ( !lstrcmp(tvi.pszText, name)) + if (!lstrcmp(tvi.pszText, name)) return tvi.hItem; tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem); @@ -370,8 +370,8 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const TCHAR *groupName, pItemName = TranslateTH(hLangpack, pItemName); hItem = sttFindNamedTreeItemAt(hwndTree, hSection, pItemName); - if ( !sectionName || !hItem) { - if ( !hItem) { + if (!sectionName || !hItem) { + if (!hItem) { TVINSERTSTRUCT tvis = {0}; TreeItem *treeItem = (TreeItem *)mir_alloc(sizeof(TreeItem)); treeItem->groupName = sectionName ? NULL : mir_tstrdup(groupName); @@ -675,7 +675,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, if (first_colour_index == -1) first_colour_index = colourId; - if ( !sttFsuiBindColourIdToFonts( GetDlgItem(hwndDlg, IDC_FONTLIST), C.name, C.group, C.name, colourId)) { + if (!sttFsuiBindColourIdToFonts( GetDlgItem(hwndDlg, IDC_FONTLIST), C.name, C.group, C.name, colourId)) { itemData = (FSUIListItemData*)mir_alloc(sizeof(FSUIListItemData)); itemData->colour_id = colourId; itemData->font_id = -1; @@ -689,7 +689,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, } } - if ( !hBkgColourBrush) + if (!hBkgColourBrush) hBkgColourBrush = CreateSolidBrush(GetSysColor(COLOR_WINDOW)); for (effectId = 0; effectId < effect_id_list_w2.getCount(); effectId++) { @@ -699,7 +699,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, if (first_effect_index == -1) first_effect_index = effectId; - if ( !sttFsuiBindEffectIdToFonts( GetDlgItem(hwndDlg, IDC_FONTLIST), E.name, effectId)) { + if (!sttFsuiBindEffectIdToFonts( GetDlgItem(hwndDlg, IDC_FONTLIST), E.name, effectId)) { itemData = (FSUIListItemData*)mir_alloc(sizeof(FSUIListItemData)); itemData->effect_id = effectId; itemData->font_id = -1; @@ -749,7 +749,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, if (itemData->colour_id >= 0) { int iItem = itemData->colour_id; - if ( !itemName) + if (!itemName) itemName = colour_id_list_w2[iItem].getName(); } @@ -786,7 +786,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, if (dis->CtlID != IDC_FONTLIST) break; - if ( !itemData) return FALSE; + if (!itemData) return FALSE; if (itemData->font_id >= 0) { int iItem = itemData->font_id; @@ -936,7 +936,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, bEnableEffect = 0; if (bEnableFont && (itemData->font_id < 0)) bEnableFont = 0; - if ( !bEnableFont || bEnableClText && (itemData->font_id < 0)) + if (!bEnableFont || bEnableClText && (itemData->font_id < 0)) bEnableClText = 0; if (bEnableReset && (itemData->font_id >= 0) && !(font_id_list_w2[itemData->font_id].flags&FIDF_DEFAULTVALID)) bEnableReset = 0; @@ -1156,7 +1156,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, ofn.lpstrDefExt = _T("ini"); if (GetSaveFileName(&ofn) == TRUE) - if ( !ExportSettings(hwndDlg, ofn.lpstrFile, font_id_list, colour_id_list, effect_id_list)) + if (!ExportSettings(hwndDlg, ofn.lpstrFile, font_id_list, colour_id_list, effect_id_list)) MessageBox(hwndDlg, TranslateT("Error writing file"), TranslateT("Error"), MB_ICONWARNING | MB_OK); } return TRUE; @@ -1275,7 +1275,7 @@ static FontInternal *sttFindFont(OBJLIST &fonts, char *module, cha for (int i=0; i < fonts.getCount(); i++) { FontInternal& F = fonts[i]; - if ( !lstrcmpA(F.dbSettingsGroup, module) && !lstrcmpA(F.prefix, prefix)) + if (!lstrcmpA(F.dbSettingsGroup, module) && !lstrcmpA(F.prefix, prefix)) return &F; } @@ -1318,7 +1318,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar break; } - if ( !pf) + if (!pf) break; HFONT hFont = NULL, hoFont = NULL; diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp index e74b8a92f0..56b3300ede 100644 --- a/src/modules/fonts/services.cpp +++ b/src/modules/fonts/services.cpp @@ -145,7 +145,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR if (flags & FIDF_APPENDNAME) mir_snprintf(idstr, SIZEOF(idstr), "%sName", prefix); else mir_snprintf(idstr, SIZEOF(idstr), "%s", prefix); - if ( !db_get_ts(NULL, settings_group, idstr, &dbv)) { + if (!db_get_ts(NULL, settings_group, idstr, &dbv)) { _tcscpy(lf->lfFaceName, dbv.ptszVal); db_free(&dbv); } @@ -290,7 +290,7 @@ static int sttRegisterFontWorker(FontIDW* font_id, int hLangpack) for (int i=0; i < font_id_list.getCount(); i++) { FontInternal& F = font_id_list[i]; - if ( !lstrcmp(F.group, font_id->group) && !lstrcmp(F.name, font_id->name) && !(F.flags & FIDF_ALLOWREREGISTER)) + if (!lstrcmp(F.group, font_id->group) && !lstrcmp(F.name, font_id->name) && !(F.flags & FIDF_ALLOWREREGISTER)) return 1; } @@ -303,11 +303,11 @@ static int sttRegisterFontWorker(FontIDW* font_id, int hLangpack) memcpy(newItem, font_id, font_id->cbSize); newItem->hLangpack = hLangpack; - if ( !lstrcmp(newItem->deffontsettings.szFace, _T("MS Shell Dlg"))) { + if (!lstrcmp(newItem->deffontsettings.szFace, _T("MS Shell Dlg"))) { LOGFONT lf; SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, FALSE); lstrcpyn(newItem->deffontsettings.szFace, lf.lfFaceName, SIZEOF(newItem->deffontsettings.szFace)); - if ( !newItem->deffontsettings.size) + if (!newItem->deffontsettings.size) newItem->deffontsettings.size = lf.lfHeight; } @@ -324,7 +324,7 @@ INT_PTR RegisterFontW(WPARAM wParam, LPARAM lParam) INT_PTR RegisterFont(WPARAM wParam, LPARAM lParam) { FontIDW temp; - if ( !ConvertFontID((FontID*)wParam, &temp)) return -1; + if (!ConvertFontID((FontID*)wParam, &temp)) return -1; return sttRegisterFontWorker(&temp, (int)lParam); } @@ -337,7 +337,7 @@ static INT_PTR sttGetFontWorker(FontIDW* font_id, LOGFONT* lf) for (int i=0; i < font_id_list.getCount(); i++) { FontInternal& F = font_id_list[i]; - if ( !_tcsncmp(F.name, font_id->name, SIZEOF(F.name)) && !_tcsncmp(F.group, font_id->group, SIZEOF(F.group))) { + if (!_tcsncmp(F.name, font_id->name, SIZEOF(F.name)) && !_tcsncmp(F.group, font_id->group, SIZEOF(F.group))) { if (GetFontSettingFromDB(F.dbSettingsGroup, F.prefix, lf, &colour, F.flags) && (F.flags & FIDF_DEFAULTVALID)) { CreateFromFontSettings(&F.deffontsettings, lf); colour = GetColorFromDefault(F.deffontsettings.colour); @@ -359,7 +359,7 @@ INT_PTR GetFontW(WPARAM wParam, LPARAM lParam) INT_PTR GetFont(WPARAM wParam, LPARAM lParam) { FontIDW temp; - if ( !ConvertFontID((FontID*)wParam, &temp)) + if (!ConvertFontID((FontID*)wParam, &temp)) return -1; LOGFONT lftemp; @@ -392,7 +392,7 @@ static INT_PTR sttRegisterColourWorker(ColourIDW* colour_id, int hLangpack) for (int i=0; i < colour_id_list.getCount(); i++) { ColourInternal& C = colour_id_list[i]; - if ( !_tcscmp(C.group, colour_id->group) && !_tcscmp(C.name, colour_id->name)) + if (!_tcscmp(C.group, colour_id->group) && !_tcscmp(C.name, colour_id->name)) return 1; } @@ -413,7 +413,7 @@ INT_PTR RegisterColourW(WPARAM wParam, LPARAM lParam) INT_PTR RegisterColour(WPARAM wParam, LPARAM lParam) { ColourIDW temp; - if ( !ConvertColourID((ColourID*)wParam, &temp)) return -1; + if (!ConvertColourID((ColourID*)wParam, &temp)) return -1; return sttRegisterColourWorker(&temp, (int)lParam); } @@ -424,7 +424,7 @@ static INT_PTR sttGetColourWorker(ColourIDW* colour_id) { for (int i=0; i < colour_id_list.getCount(); i++) { ColourInternal& C = colour_id_list[i]; - if ( !_tcscmp(C.group, colour_id->group) && !_tcscmp(C.name, colour_id->name)) + if (!_tcscmp(C.group, colour_id->group) && !_tcscmp(C.name, colour_id->name)) return db_get_dw(NULL, C.dbSettingsGroup, C.setting, GetColorFromDefault(C.defcolour)); } @@ -439,7 +439,7 @@ INT_PTR GetColourW(WPARAM wParam, LPARAM) INT_PTR GetColour(WPARAM wParam, LPARAM) { ColourIDW temp; - if ( !ConvertColourID((ColourID*)wParam, &temp)) return -1; + if (!ConvertColourID((ColourID*)wParam, &temp)) return -1; return sttGetColourWorker(&temp); } @@ -478,7 +478,7 @@ static INT_PTR sttRegisterEffectWorker(EffectIDW* effect_id, int hLangpack) for (int i=0; i < effect_id_list.getCount(); i++) { EffectInternal& E = effect_id_list[i]; - if ( !_tcscmp(E.group, effect_id->group) && !_tcscmp(E.name, effect_id->name)) + if (!_tcscmp(E.group, effect_id->group) && !_tcscmp(E.name, effect_id->name)) return 1; } @@ -499,7 +499,7 @@ INT_PTR RegisterEffectW(WPARAM wParam, LPARAM lParam) INT_PTR RegisterEffect(WPARAM wParam, LPARAM lParam) { EffectIDW temp; - if ( !ConvertEffectID((EffectID*)wParam, &temp)) return -1; + if (!ConvertEffectID((EffectID*)wParam, &temp)) return -1; return sttRegisterEffectWorker(&temp, (int)lParam); } @@ -510,7 +510,7 @@ static INT_PTR sttGetEffectWorker(EffectIDW* effect_id, FONTEFFECT* effect) { for (int i=0; i < effect_id_list.getCount(); i++) { EffectInternal& E = effect_id_list[i]; - if ( !_tcsncmp(E.name, effect_id->name, SIZEOF(E.name)) && !_tcsncmp(E.group, effect_id->group, SIZEOF(E.group))) { + if (!_tcsncmp(E.name, effect_id->name, SIZEOF(E.name)) && !_tcsncmp(E.group, effect_id->group, SIZEOF(E.group))) { FONTEFFECT temp; UpdateEffectSettings(effect_id, &temp); @@ -532,7 +532,7 @@ INT_PTR GetEffectW(WPARAM wParam, LPARAM lParam) INT_PTR GetEffect(WPARAM wParam, LPARAM lParam) { EffectIDW temp; - if ( !ConvertEffectID((EffectID*)wParam, &temp)) return -1; + if (!ConvertEffectID((EffectID*)wParam, &temp)) return -1; return sttGetEffectWorker(&temp, (FONTEFFECT*)lParam); } -- cgit v1.2.3