diff options
author | George Hazan <ghazan@miranda.im> | 2019-09-14 14:12:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-09-14 14:12:36 +0300 |
commit | fc7249b1a0d139ef8e225e01d6227bd915b51a16 (patch) | |
tree | 8a0048230ca5c5118b385c5827b0b6c8a8db8fe6 /plugins/TabSRMM/src/msgdlgutils.cpp | |
parent | b34a90793af54c8b7a1e84846bfb73b47c9d8365 (diff) |
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
Diffstat (limited to 'plugins/TabSRMM/src/msgdlgutils.cpp')
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 67 |
1 files changed, 0 insertions, 67 deletions
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);
|