summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/msglog.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-05-04 12:09:06 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-05-04 12:09:13 +0300
commit234af11634949fee3c5e16721641a046c971598a (patch)
treea6a2cddf294450de7eddd3a7449767efb54c2269 /plugins/TabSRMM/src/msglog.cpp
parent1fedd3665b5fdb1772fe6bb85e6fb686eee58fd7 (diff)
tabSRMM:
- ANSI crutch removed; - LoadMsgDlgFont: useless parameter szMod removed; - wcscpy replaced with safer call of wcsncpy_s; - useless function LoadLogfont removed;
Diffstat (limited to 'plugins/TabSRMM/src/msglog.cpp')
-rw-r--r--plugins/TabSRMM/src/msglog.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index b053d0b47e..5e05db523c 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -67,7 +67,7 @@ static wchar_t szToday[22], szYesterday[22];
char rtfFontsGlobal[MSGDLGFONTCOUNT + 2][RTFCACHELINESIZE];
char *rtfFonts;
-LOGFONTA logfonts[MSGDLGFONTCOUNT + 2];
+LOGFONTW logfonts[MSGDLGFONTCOUNT + 2];
COLORREF fontcolors[MSGDLGFONTCOUNT + 2];
#define LOGICON_MSG 0
@@ -110,13 +110,13 @@ void TSAPI CacheLogFonts()
memset(logfonts, 0, (sizeof(LOGFONTA) * (MSGDLGFONTCOUNT + 2)));
for (int i = 0; i < MSGDLGFONTCOUNT; i++) {
- LoadLogfont(FONTSECTION_IM, i, &logfonts[i], &fontcolors[i], FONTMODULE);
+ LoadMsgDlgFont(FONTSECTION_IM, i, &logfonts[i], &fontcolors[i]);
mir_snprintf(rtfFontsGlobal[i], "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic, logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
}
mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0);
- wcsncpy(szToday, TranslateT("Today"), 20);
- wcsncpy(szYesterday, TranslateT("Yesterday"), 20);
+ wcsncpy_s(szToday, TranslateT("Today"), _TRUNCATE);
+ wcsncpy_s(szYesterday, TranslateT("Yesterday"), _TRUNCATE);
szToday[19] = szYesterday[19] = 0;
// cache/create the info panel fonts
@@ -125,10 +125,10 @@ void TSAPI CacheLogFonts()
DeleteObject(CInfoPanel::m_ipConfig.hFonts[i]);
COLORREF clr;
- LOGFONTA lf;
- LoadLogfont(FONTSECTION_IP, i, &lf, &clr, FONTMODULE);
+ LOGFONTW lf;
+ LoadMsgDlgFont(FONTSECTION_IP, i, &lf, &clr);
lf.lfUnderline = 0;
- CInfoPanel::m_ipConfig.hFonts[i] = CreateFontIndirectA(&lf);
+ CInfoPanel::m_ipConfig.hFonts[i] = CreateFontIndirectW(&lf);
CInfoPanel::m_ipConfig.clrs[i] = clr;
}
@@ -309,14 +309,14 @@ static int AppendUnicodeToBuffer(CMStringA &str, const wchar_t *line, int mode)
static void Build_RTF_Header(CMStringA &str, CMsgDialog *dat)
{
int i;
- LOGFONTA *logFonts = dat->m_pContainer->m_theme.logFonts;
+ LOGFONTW *logFonts = dat->m_pContainer->m_theme.logFonts;
COLORREF *fontColors = dat->m_pContainer->m_theme.fontColors;
TLogTheme *theme = &dat->m_pContainer->m_theme;
str.Append("{\\rtf1\\ansi\\deff0{\\fonttbl");
for (i = 0; i < MSGDLGFONTCOUNT; i++)
- str.AppendFormat("{\\f%u\\fnil\\fcharset%u %s;}", i, logFonts[i].lfCharSet, logFonts[i].lfFaceName);
+ str.AppendFormat("{\\f%u\\fnil\\fcharset%u %S;}", i, logFonts[i].lfCharSet, logFonts[i].lfFaceName);
str.AppendFormat("{\\f%u\\fnil\\fcharset%u %s;}", MSGDLGFONTCOUNT, logFonts[i].lfCharSet, "Arial");
str.Append("}{\\colortbl ");