diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-28 16:46:52 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-28 16:46:52 +0000 |
commit | ba0fed41b69b73c2207f21b62879430930fe47ba (patch) | |
tree | 9b09bc638d90f38d3aa7aa4208b4ca985e8edcaf /src/modules/clist | |
parent | 8d0a7a7cda2eb520a7389bbc0d18fb3da051d66d (diff) |
fix for the default font settings for StdClist
git-svn-id: http://svn.miranda-ng.org/main/trunk@7931 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist')
-rw-r--r-- | src/modules/clist/clcutils.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index e4258c8a11..b87fc9cfa5 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -685,27 +685,28 @@ void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF* colour) void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
{
- DBVARIANT dbv;
- char idstr[20];
- BYTE style;
-
cli.pfnGetDefaultFontSetting(i, lf, colour);
+
+ char idstr[20];
mir_snprintf(idstr, SIZEOF(idstr), "Font%dName", i);
- if (!db_get_ts(NULL, "CLC", idstr, &dbv)) {
- lstrcpy(lf->lfFaceName, dbv.ptszVal);
- mir_free(dbv.pszVal);
- }
+ ptrT tszFace(db_get_tsa(NULL, "CLC", idstr));
+ if (tszFace)
+ lstrcpy(lf->lfFaceName, tszFace);
+
mir_snprintf(idstr, SIZEOF(idstr), "Font%dCol", i);
*colour = db_get_dw(NULL, "CLC", idstr, *colour);
+
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSize", i);
lf->lfHeight = (char) db_get_b(NULL, "CLC", idstr, lf->lfHeight);
+
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSty", i);
- style = (BYTE) db_get_b(NULL, "CLC", idstr, (lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0));
+ BYTE style = (BYTE)db_get_b(NULL, "CLC", idstr, (lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0));
lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0;
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = (style & DBFONTF_ITALIC) != 0;
lf->lfUnderline = (style & DBFONTF_UNDERLINE) != 0;
lf->lfStrikeOut = 0;
+
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSet", i);
lf->lfCharSet = db_get_b(NULL, "CLC", idstr, lf->lfCharSet);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
|