From 2c2c6484dc2eb7b3da52f9054435dc680f64b132 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Sep 2024 14:40:05 +0300 Subject: =?UTF-8?q?fixes=20#4650=20(=D0=9E=D0=BA=D0=BD=D0=BE=20=D1=81?= =?UTF-8?q?=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9:=20=D0=BA?= =?UTF-8?q?=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=82?= =?UTF-8?q?=D0=B5=D0=BA=D1=81=D1=82=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=D1=8E=D1=82=20=D0=B2=20=D0=BF=D1=80=D0=B8=D0=B2=D0=B0?= =?UTF-8?q?=D1=82=D0=B0=D1=85,=20=D0=BD=D0=BE=20=D0=BD=D0=B5=20=D0=B2=20?= =?UTF-8?q?=D0=B3=D1=80=D1=83=D0=BF=D1=87=D0=B0=D1=82=D0=B0=D1=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/TabSRMM/src/msgdlgother.cpp | 45 ++++++++++++++----------------------- 1 file changed, 17 insertions(+), 28 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index f74673c8dd..e229888c22 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -260,8 +260,6 @@ BOOL CMsgDialog::DoRtfToTags(CMStringW &pszText) const } else idx += 5; - MODULEINFO *mi = (isChat()) ? m_si->pMI : nullptr; - bool bInsideColor = false, bInsideUl = false; CMStringW res; @@ -284,14 +282,12 @@ BOOL CMsgDialog::DoRtfToTags(CMStringW &pszText) const if (iCol > 0) { if (isChat()) { - if (mi && mi->bColor) { - if (iInd >= 0) { - if (!(res.IsEmpty() && m_pContainer->m_theme.fontColors[MSGFONTID_MESSAGEAREA] == pColors[iInd])) - res.AppendFormat(L"%%c%u", iInd); - } - else if (!res.IsEmpty()) - res.Append(L"%%C"); + if (iInd >= 0) { + if (!(res.IsEmpty() && m_pContainer->m_theme.fontColors[MSGFONTID_MESSAGEAREA] == pColors[iInd])) + res.AppendFormat(L"%%c%u", iInd); } + else if (!res.IsEmpty()) + res.Append(L"%%C"); } else res.AppendFormat((iInd >= 0) ? (bInsideColor ? L"[/color][color=%s]" : L"[color=%s]") : (bInsideColor ? L"[/color]" : L""), Utils::rtf_clrs[iInd].szName); } @@ -300,16 +296,14 @@ BOOL CMsgDialog::DoRtfToTags(CMStringW &pszText) const } else if (!wcsncmp(p, L"\\highlight", 10)) { // background color if (isChat()) { - if (mi && mi->bBkgColor) { - int iInd = RtfColorToIndex(iNumColors, pIndex, _wtoi(p + 10)); - if (iInd >= 0) { - // if the entry field is empty & the color passed is the back color, skip it - if (!(res.IsEmpty() && m_pContainer->m_theme.inputbg == pColors[iInd])) - res.AppendFormat(L"%%f%u", iInd); - } - else if (!res.IsEmpty()) - res.AppendFormat(L"%%F"); + int iInd = RtfColorToIndex(iNumColors, pIndex, _wtoi(p + 10)); + if (iInd >= 0) { + // if the entry field is empty & the color passed is the back color, skip it + if (!(res.IsEmpty() && m_pContainer->m_theme.inputbg == pColors[iInd])) + res.AppendFormat(L"%%f%u", iInd); } + else if (!res.IsEmpty()) + res.AppendFormat(L"%%F"); } } else if (!wcsncmp(p, L"\\line", 5)) { // soft line break; @@ -338,8 +332,7 @@ BOOL CMsgDialog::DoRtfToTags(CMStringW &pszText) const } else if (!wcsncmp(p, L"\\b", 2)) { //bold if (isChat()) { - if (mi && mi->bBold) - res.Append((p[2] != '0') ? L"%b" : L"%B"); + res.Append((p[2] != '0') ? L"%b" : L"%B"); } else { if (!(lf.lfWeight == FW_BOLD)) // only allow bold if the font itself isn't a bold one, otherwise just strip it.. @@ -349,13 +342,10 @@ BOOL CMsgDialog::DoRtfToTags(CMStringW &pszText) const } else if (!wcsncmp(p, L"\\i", 2)) { // italics if (isChat()) { - if (mi && mi->bItalics) - res.Append((p[2] != '0') ? L"%i" : L"%I"); - } - else { - if (!lf.lfItalic && m_bSendFormat) - res.Append((p[2] != '0') ? L"[i]" : L"[/i]"); + res.Append((p[2] != '0') ? L"%i" : L"%I"); } + else if (!lf.lfItalic && m_bSendFormat) + res.Append((p[2] != '0') ? L"[i]" : L"[/i]"); } else if (!wcsncmp(p, L"\\strike", 7)) { // strike-out if (!lf.lfStrikeOut && m_bSendFormat) @@ -363,8 +353,7 @@ BOOL CMsgDialog::DoRtfToTags(CMStringW &pszText) const } else if (!wcsncmp(p, L"\\ul", 3)) { // underlined if (isChat()) { - if (mi && mi->bUnderline) - res.Append((p[3] != '0') ? L"%u" : L"%U"); + res.Append((p[3] != '0') ? L"%u" : L"%U"); } else { if (!lf.lfUnderline && m_bSendFormat) { -- cgit v1.2.3