From fc7249b1a0d139ef8e225e01d6227bd915b51a16 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 14 Sep 2019 14:12:36 +0300 Subject: tabSRMM: - fixes #2055 (crash on opening template editor); - TContainerData got a constructor & destructor; - more methods moved to TContainerData class; - unused include file "templates.h" removed; - code cleaning --- plugins/TabSRMM/src/msgdlgutils.cpp | 67 ------------------------------------- 1 file changed, 67 deletions(-) (limited to 'plugins/TabSRMM/src/msgdlgutils.cpp') diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 2ee4e63c13..91c0b3840f 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -365,73 +365,6 @@ bool IsStringValidLink(wchar_t *pszText) ///////////////////////////////////////////////////////////////////////////////////////// -void TSAPI LoadThemeDefaults(TContainerData *pContainer) -{ - memset(&pContainer->m_theme, 0, sizeof(TLogTheme)); - pContainer->m_theme.bg = db_get_dw(0, FONTMODULE, SRMSGSET_BKGCOLOUR, GetSysColor(COLOR_WINDOW)); - pContainer->m_theme.statbg = PluginConfig.crStatus; - pContainer->m_theme.oldinbg = PluginConfig.crOldIncoming; - pContainer->m_theme.oldoutbg = PluginConfig.crOldOutgoing; - pContainer->m_theme.inbg = PluginConfig.crIncoming; - pContainer->m_theme.outbg = PluginConfig.crOutgoing; - pContainer->m_theme.hgrid = db_get_dw(0, FONTMODULE, "hgrid", RGB(224, 224, 224)); - pContainer->m_theme.left_indent = M.GetDword("IndentAmount", 20) * 15; - pContainer->m_theme.right_indent = M.GetDword("RightIndent", 20) * 15; - pContainer->m_theme.inputbg = db_get_dw(0, FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR); - - for (int i = 1; i <= 5; i++) { - char szTemp[40]; - mir_snprintf(szTemp, "cc%d", i); - COLORREF colour = M.GetDword(szTemp, RGB(224, 224, 224)); - if (colour == 0) - colour = RGB(1, 1, 1); - pContainer->m_theme.custom_colors[i - 1] = colour; - } - pContainer->m_theme.logFonts = logfonts; - pContainer->m_theme.fontColors = fontcolors; - pContainer->m_theme.rtfFonts = nullptr; - pContainer->m_ltr_templates = <R_Active; - pContainer->m_rtl_templates = &RTL_Active; - pContainer->m_theme.dwFlags = (M.GetDword("mwflags", MWF_LOG_DEFAULT) & MWF_LOG_ALL); - pContainer->m_theme.isPrivate = false; -} - -void TSAPI LoadOverrideTheme(TContainerData *pContainer) -{ - memset(&pContainer->m_theme, 0, sizeof(TLogTheme)); - if (mir_wstrlen(pContainer->m_szAbsThemeFile) > 1) { - if (PathFileExists(pContainer->m_szAbsThemeFile)) { - if (CheckThemeVersion(pContainer->m_szAbsThemeFile) == 0) { - LoadThemeDefaults(pContainer); - return; - } - if (pContainer->m_ltr_templates == nullptr) { - pContainer->m_ltr_templates = (TTemplateSet *)mir_alloc(sizeof(TTemplateSet)); - memcpy(pContainer->m_ltr_templates, <R_Active, sizeof(TTemplateSet)); - } - if (pContainer->m_rtl_templates == nullptr) { - pContainer->m_rtl_templates = (TTemplateSet *)mir_alloc(sizeof(TTemplateSet)); - memcpy(pContainer->m_rtl_templates, &RTL_Active, sizeof(TTemplateSet)); - } - - pContainer->m_theme.logFonts = (LOGFONTA *)mir_alloc(sizeof(LOGFONTA) * (MSGDLGFONTCOUNT + 2)); - pContainer->m_theme.fontColors = (COLORREF *)mir_alloc(sizeof(COLORREF) * (MSGDLGFONTCOUNT + 2)); - pContainer->m_theme.rtfFonts = (char *)mir_alloc((MSGDLGFONTCOUNT + 2) * RTFCACHELINESIZE); - - ReadThemeFromINI(pContainer->m_szAbsThemeFile, pContainer, 0, THEME_READ_ALL); - pContainer->m_theme.left_indent *= 15; - pContainer->m_theme.right_indent *= 15; - pContainer->m_theme.isPrivate = true; - if (CSkin::m_skinEnabled) - pContainer->m_theme.bg = SkinItems[ID_EXTBKCONTAINER].COLOR; - else - pContainer->m_theme.bg = PluginConfig.m_fillColor ? PluginConfig.m_fillColor : GetSysColor(COLOR_WINDOW); - return; - } - } - LoadThemeDefaults(pContainer); -} - LRESULT TSAPI GetSendButtonState(HWND hwnd) { HWND hwndIDok = GetDlgItem(hwnd, IDOK); -- cgit v1.2.3