From 0976190894d653d5062f8ef6befabf46218f2d24 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 3 Oct 2016 16:48:12 +0000 Subject: - 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 --- plugins/TooltipNotify/src/TooltipNotify.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'plugins/TooltipNotify/src') diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 3008beffb2..864fad80c1 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -95,11 +95,11 @@ void CTooltipNotify::RegisterFonts() wcsncpy(fontId.name, s_fontTable[i].name, _countof(fontId.name) - 1); strncpy(fontId.prefix, s_fontTable[i].fontPrefix, _countof(fontId.prefix) - 1); wcsncpy(fontId.backgroundName, s_fontTable[i].name, _countof(fontId.backgroundName) - 1); - ::FontRegisterW(&fontId); + ::Font_RegisterW(&fontId); wcsncpy(colorId.name, s_fontTable[i].name, _countof(colorId.name) - 1); strncpy(colorId.setting, s_fontTable[i].clrPrefix, _countof(colorId.setting) - 1); - ::ColourRegisterW(&colorId); + ::Colour_RegisterW(&colorId); } } @@ -111,17 +111,12 @@ void CTooltipNotify::GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* fontName = s_fontTable[i].name; } } - if (fontName == 0) { + if (fontName == 0) fontName = s_fontTable[_countof(s_fontTable) - 1].name; - } // name and group only - FontIDW fontId = { sizeof(fontId), FONTSERV_GROUP, 0 }; - wcsncpy(fontId.name, fontName, _countof(fontId.name) - 1); - *text = (COLORREF)::CallService(MS_FONT_GETW, (WPARAM)&fontId, (LPARAM)lf); - ColourIDW colorId = { sizeof(colorId), FONTSERV_GROUP, 0 }; - wcsncpy(colorId.name, fontName, _countof(colorId.name) - 1); - *bg = (COLORREF)::CallService(MS_COLOUR_GETW, (WPARAM)&colorId, 0); + *text = ::Font_GetW(FONTSERV_GROUP, fontName, lf); + *bg = ::Colour_GetW(FONTSERV_GROUP, fontName); } int CTooltipNotify::ModulesLoaded(WPARAM, LPARAM) -- cgit v1.2.3