diff options
author | George Hazan <george.hazan@gmail.com> | 2016-10-03 16:48:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-10-03 16:48:12 +0000 |
commit | 0976190894d653d5062f8ef6befabf46218f2d24 (patch) | |
tree | 4a26f4baa9a535256d7220a0c04a698390cab4e5 /utils/mir_fonts.cpp | |
parent | 3c4ccf82586be6b22380df2bc35ae4770f91651f (diff) |
- inlined helpers for fonts, colors & effects creation replaced with functions;
- services for getting fonts, colors & effects removed;
- some memory corruptions removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@17347 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'utils/mir_fonts.cpp')
-rw-r--r-- | utils/mir_fonts.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/utils/mir_fonts.cpp b/utils/mir_fonts.cpp index 9b8c32cb23..d8b7056adf 100644 --- a/utils/mir_fonts.cpp +++ b/utils/mir_fonts.cpp @@ -30,19 +30,10 @@ int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, con fid.deffontsettings.charset = plfDefault->lfCharSet; mir_wstrncpy(fid.deffontsettings.szFace, plfDefault->lfFaceName, _countof(fid.deffontsettings.szFace)); /* buffer safe */ } - FontRegisterW(&fid); + Font_RegisterW(&fid); return 0; } -int FontService_GetFont(const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF *pclr, LOGFONT *plf) -{ - FontIDW fid = { 0 }; - mir_wstrncpy(fid.group, pszSection, _countof(fid.group)); /* buffer sfae */ - mir_wstrncpy(fid.name, pszDescription, _countof(fid.name)); /* buffer safe */ - *pclr = (COLORREF)CallService(MS_FONT_GETW, (WPARAM)&fid, (LPARAM)plf); /* uses fallback font on error */ - return (int)*pclr == -1; -} - int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF clrDefault) { ColourIDW cid = { 0 }; @@ -52,16 +43,6 @@ int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, co mir_strncpy(cid.setting, pszDbName, sizeof(cid.setting)); /* buffer safe */ mir_wstrncpy(cid.group, pszSection, _countof(cid.group)); /* buffer safe */ mir_wstrncpy(cid.name, pszDescription, _countof(cid.name)); /* buffer safe */ - ColourRegisterW(&cid); + Colour_RegisterW(&cid); return 0; } - -int FontService_GetColor(const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF *pclr) -{ - ColourIDW cid = { 0 }; - cid.cbSize = sizeof(cid); - wcsncpy_s(cid.group, pszSection, _TRUNCATE); - wcsncpy_s(cid.name, pszDescription, _TRUNCATE); - *pclr = (COLORREF)CallService(MS_COLOUR_GETW, (WPARAM)&cid, 0); - return (int)*pclr == -1; -} |