summaryrefslogtreecommitdiff
path: root/src/core/stdmsg
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp16
-rw-r--r--src/core/stdmsg/src/msgs.h1
2 files changed, 8 insertions, 9 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 1699b3a74c..9e72a86f62 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -1042,15 +1042,12 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
InvalidateRect(GetDlgItem(hwndDlg, IDC_MESSAGE), NULL, FALSE);
{
- HFONT hFont;
LOGFONT lf;
CHARFORMAT cf = { 0 };
- hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_GETFONT, 0, 0);
- if (hFont != NULL && hFont != (HFONT)SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0))
- DeleteObject(hFont);
+ if (dat->hFont) DeleteObject(dat->hFont);
LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, &lf, &cf.crTextColor);
- hFont = CreateFontIndirect(&lf);
- SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
+ dat->hFont = CreateFontIndirect(&lf);
+ SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM)dat->hFont, MAKELPARAM(TRUE, 0));
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_COLOR;
@@ -1713,9 +1710,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
WindowList_Remove(g_dat.hMessageWindowList, hwndDlg);
db_set_dw(bSavePerContact ? dat->hContact : NULL, SRMMMOD, "splitterPos", dat->splitterPos);
- HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_GETFONT, 0, 0);
- if (hFont != NULL && hFont != (HFONT)SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0))
- DeleteObject(hFont);
+ if (dat->hFont) {
+ DeleteObject(dat->hFont);
+ dat->hFont = NULL;
+ }
MCONTACT hContact = (bSavePerContact) ? dat->hContact : NULL;
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h
index e59175c0d2..940e242e27 100644
--- a/src/core/stdmsg/src/msgs.h
+++ b/src/core/stdmsg/src/msgs.h
@@ -42,6 +42,7 @@ struct SrmmWindowData : public MZeroedObject
MCONTACT hContact;
MEVENT hDbEventFirst, hDbEventLast;
HBRUSH hBkgBrush;
+ HFONT hFont;
int splitterPos, originalSplitterPos;
SIZE minEditBoxSize;
RECT minEditInit;