summaryrefslogtreecommitdiff
path: root/src/modules/fonts
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-06 13:58:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-06 13:58:20 +0000
commit46a53191c1ad11a41c948594e972568e62d155b4 (patch)
tree7e57e6f7093fb0de766fe13a933d2f9231433e4d /src/modules/fonts
parent1fe5acae909ea64a1de9ac9f58cae5a3c2d3ad1f (diff)
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@332 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/fonts')
-rw-r--r--src/modules/fonts/FontOptions.cpp22
-rw-r--r--src/modules/fonts/services.cpp8
2 files changed, 15 insertions, 15 deletions
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index 801f023141..b38936f8c6 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -140,7 +140,7 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<TFontID>& flist, OBJL
char header[512], buff[1024], abuff[1024];
HANDLE fhand = CreateFile(filename, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);
- if(fhand == INVALID_HANDLE_VALUE) {
+ if (fhand == INVALID_HANDLE_VALUE) {
MessageBox(hwndDlg, filename, TranslateT("Failed to create file"), MB_ICONWARNING | MB_OK);
return FALSE;
}
@@ -191,7 +191,7 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<TFontID>& flist, OBJL
strcat(buff, _itoa((BYTE)size.cy, abuff, 10));
}
- else if(F.flags & FIDF_SAVEPOINTSIZE) {
+ else if (F.flags & FIDF_SAVEPOINTSIZE) {
HDC hdc = GetDC(hwndDlg);
strcat(buff, _itoa((BYTE)-MulDiv(F.value.size, 72, GetDeviceCaps(hdc, LOGPIXELSY)), abuff, 10));
ReleaseDC(hwndDlg, hdc);
@@ -206,7 +206,7 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<TFontID>& flist, OBJL
WriteLine(fhand, buff);
mir_snprintf(buff, SIZEOF(buff), "%sCol=d%d", F.prefix, (DWORD)F.value.colour);
WriteLine(fhand, buff);
- if(F.flags & FIDF_NOAS) {
+ if (F.flags & FIDF_NOAS) {
mir_snprintf(buff, SIZEOF(buff), "%sAs=w%d", F.prefix, (WORD)0x00FF);
WriteLine(fhand, buff);
}
@@ -219,7 +219,7 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<TFontID>& flist, OBJL
TColourID& C = clist[i];
mir_snprintf(buff, SIZEOF(buff), "\r\n[%s]", C.dbSettingsGroup );
- if(strcmp(buff, header) != 0) {
+ if (strcmp(buff, header) != 0) {
strcpy(header, buff);
WriteLine(fhand, buff);
}
@@ -232,7 +232,7 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<TFontID>& flist, OBJL
TEffectID& E = elist[i];
mir_snprintf(buff, SIZEOF(buff), "\r\n[%s]", E.dbSettingsGroup );
- if(strcmp(buff, header) != 0) {
+ if (strcmp(buff, header) != 0) {
strcpy(header, buff);
WriteLine(fhand, buff);
}
@@ -265,7 +265,7 @@ UINT_PTR CALLBACK CFHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam
TranslateDialogDefault(hdlg);
ShowWindow(GetDlgItem(hdlg, 1095), SW_HIDE);
- if(cf && (cf->lCustData & FIDF_DISABLESTYLES)) {
+ if (cf && (cf->lCustData & FIDF_DISABLESTYLES)) {
EnableWindow(GetDlgItem(hdlg, 1137), FALSE);
ShowWindow(GetDlgItem(hdlg, 1137), SW_HIDE);
ShowWindow(GetDlgItem(hdlg, 1095), SW_SHOW);
@@ -428,7 +428,7 @@ static void sttSaveCollapseState( HWND hwndTree )
tvi.stateMask = (DWORD)-1;
TreeView_GetItem( hwndTree, &tvi );
- if( tvi.cChildren > 0 ) {
+ if ( tvi.cChildren > 0 ) {
treeItem = (TreeItem *)tvi.lParam;
if ( tvi.state & TVIS_EXPANDED )
DBWriteContactSettingByte(NULL, "FontServiceUI", treeItem->paramName, TVIS_EXPANDED );
@@ -437,11 +437,11 @@ static void sttSaveCollapseState( HWND hwndTree )
}
ht = TreeView_GetChild( hwndTree, hti );
- if( ht == NULL ) {
+ if ( ht == NULL ) {
ht = TreeView_GetNextSibling( hwndTree, hti );
while( ht == NULL ) {
hti = TreeView_GetParent( hwndTree, hti );
- if( hti == NULL ) break;
+ if ( hti == NULL ) break;
ht = TreeView_GetNextSibling( hwndTree, hti );
} }
@@ -810,7 +810,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
FONTEFFECT Effect;
FONTEFFECT * pEffect = NULL;
- if(dis->CtlID != IDC_FONTLIST)
+ if (dis->CtlID != IDC_FONTLIST)
break;
if (!itemData) return FALSE;
@@ -1156,7 +1156,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
FSUIListItemData *itemData = (FSUIListItemData *)SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETITEMDATA, selItems[i], 0);
if (IsBadReadPtr(itemData, sizeof(FSUIListItemData))) continue; // prevent possible problems with corrupted itemData
- if((itemData->font_id >= 0) && (font_id_list_w2[itemData->font_id].flags & FIDF_DEFAULTVALID)) {
+ if ((itemData->font_id >= 0) && (font_id_list_w2[itemData->font_id].flags & FIDF_DEFAULTVALID)) {
font_id_list_w2[itemData->font_id].value = font_id_list_w2[itemData->font_id].deffontsettings;
MEASUREITEMSTRUCT mis = { 0 };
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp
index 2681855c90..09e465c59a 100644
--- a/src/modules/fonts/services.cpp
+++ b/src/modules/fonts/services.cpp
@@ -128,7 +128,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR
GetDefaultFontSetting(lf, colour);
- if(flags & FIDF_APPENDNAME) mir_snprintf(idstr, SIZEOF(idstr), "%sName", prefix);
+ if (flags & FIDF_APPENDNAME) mir_snprintf(idstr, SIZEOF(idstr), "%sName", prefix);
else mir_snprintf(idstr, SIZEOF(idstr), "%s", prefix);
if ( !DBGetContactSettingTString(NULL, settings_group, idstr, &dbv )) {
@@ -147,7 +147,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR
//wsprintf(idstr, "%sFlags", prefix);
- //if(DBGetContactSettingDword(NULL, settings_group, idstr, 0) & FIDF_SAVEACTUALHEIGHT) {
+ //if (DBGetContactSettingDword(NULL, settings_group, idstr, 0) & FIDF_SAVEACTUALHEIGHT) {
// HDC hdc = GetDC(0);
// lf->lfHeight = -lf->lfHeight;
// ReleaseDC(0, hdc);
@@ -171,9 +171,9 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- if(lf->lfHeight > 0) {
+ if (lf->lfHeight > 0) {
HDC hdc = GetDC(0);
- if(flags & FIDF_SAVEPOINTSIZE) {
+ if (flags & FIDF_SAVEPOINTSIZE) {
lf->lfHeight = -MulDiv(lf->lfHeight,GetDeviceCaps(hdc, LOGPIXELSY), 72);
} else { // assume SAVEACTUALHEIGHT
TEXTMETRIC tm;