From 651ff714162c191ff694f52fc7ee1f11424636b1 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Fri, 30 Nov 2012 21:02:23 +0000 Subject: fixed fonts registration git-svn-id: http://svn.miranda-ng.org/main/trunk@2571 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NotesAndReminders/src/options.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index bb9739293a..e64086f63c 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -167,7 +167,6 @@ static int CALLBACK EnumFontFamExProc(const LOGFONT *lpelfe, const TEXTMETRIC *l // get font charset according to current CP, if available for specified font static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont) { - HDC hdc; LOGFONT lf = {0}; int found = 0; @@ -175,7 +174,7 @@ static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont) lf.lfCharSet = MsgDlgGetCPDefaultCharset(); // check if the font supports specified charset - hdc = GetDC(0); + HDC hdc = GetDC(0); EnumFontFamiliesEx(hdc, &lf, &EnumFontFamExProc, (LPARAM)&found, 0); ReleaseDC(0, hdc); @@ -230,15 +229,13 @@ static int FS_ColorChanged(WPARAM wParam, LPARAM lParam) void RegisterFontServiceFonts() { - FontIDT fontid = {0}; - ColourIDT colorid = {0}; char szTemp[100]; - int i; + FontIDT fontid = {0}; fontid.cbSize = sizeof(FontIDT); - mir_sntprintf(fontid.group, SIZEOF(fontid.group), _T("%s"), LPGENT(SECTIONNAME)); - mir_sntprintf(fontid.backgroundGroup, SIZEOF(fontid.backgroundGroup), _T("%s"), LPGENT(SECTIONNAME)); + _tcsncpy(fontid.group, _T(SECTIONNAME), SIZEOF(fontid.group)); + _tcsncpy(fontid.backgroundGroup, _T(SECTIONNAME), SIZEOF(fontid.backgroundGroup) ); strncpy(fontid.dbSettingsGroup, MODULENAME, SIZEOF(fontid.dbSettingsGroup)); fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_SAVEPOINTSIZE; @@ -246,7 +243,7 @@ void RegisterFontServiceFonts() int nFontScale = GetDeviceCaps(hDC, LOGPIXELSY); ReleaseDC(NULL, hDC); - for (i = 0; i < SIZEOF(fontOptionsList); i++) + for (int i = 0; i < SIZEOF(fontOptionsList); i++) { fontid.order = i; mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i); @@ -265,13 +262,14 @@ void RegisterFontServiceFonts() FontRegisterT(&fontid); } + ColourIDT colorid = {0}; colorid.cbSize = sizeof(ColourIDT); - mir_sntprintf(colorid.group, SIZEOF(colorid.group), _T("%s"), LPGENT(SECTIONNAME)); + _tcsncpy(colorid.group, _T(SECTIONNAME), SIZEOF(colorid.group)); strncpy(colorid.dbSettingsGroup, MODULENAME, SIZEOF(fontid.dbSettingsGroup)); colorid.flags = 0; - for (i = 0; i < SIZEOF(colourOptionsList); i++) + for (int i = 0; i < SIZEOF(colourOptionsList); i++) { colorid.order = i; _tcsncpy(colorid.name, colourOptionsList[i].szName, SIZEOF(colorid.name)); -- cgit v1.2.3