diff options
author | George Hazan <george.hazan@gmail.com> | 2015-02-26 13:56:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-02-26 13:56:36 +0000 |
commit | b3f693c28e8574cdb99916cb417d14d238d60ca2 (patch) | |
tree | ed6dd2c21a7a368145163c8fba2d9c7d8813b103 | |
parent | 5fd72266f7483bb586679fd0ef98be526b03729b (diff) |
some rtf glitches
git-svn-id: http://svn.miranda-ng.org/main/trunk@12272 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 7 | ||||
-rw-r--r-- | plugins/TabSRMM/src/themeio.cpp | 12 | ||||
-rw-r--r-- | src/modules/chat/chat_rtf.cpp | 3 |
3 files changed, 15 insertions, 7 deletions
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 7d78092e7e..9d7e81d12e 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -925,7 +925,7 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors int iCol = _ttoi(p + 3);
int iInd = GetRtfIndex(iCol, iNumColors, pIndex);
- if (iCol)
+ if (iCol && dat->bType != SESSIONTYPE_CHAT)
res.AppendFormat((iInd > 0) ? (bInsideColor ? _T("[/color][color=%s]") : _T("[color=%s]")) : (bInsideColor ? _T("[/color]") : _T("")), Utils::rtf_ctable[iInd - 1].szName);
bInsideColor = iInd > 0;
@@ -1024,6 +1024,11 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors }
}
+ if (bInsideColor && dat->bType != SESSIONTYPE_CHAT)
+ res.Append(_T("[/color]"));
+ if (bInsideUl)
+ res.Append(_T("[/u]"));
+
pszText = res;
return TRUE;
}
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index 6783205d63..04e29e1ede 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -37,7 +37,7 @@ static struct _tagExtSettings { char* szDbModule;
char* szDbSetting;
DWORD dwDef;
-} _extSettings[12] = {
+} _extSettings[] = {
"Message Log", "BackgroundColor", FONTMODULE, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR,
"Message Log", "IncomingBG", FONTMODULE, "inbg", SRMSGDEFSET_BKGINCOLOUR,
"Message Log", "OutgoingBG", FONTMODULE, "outbg", SRMSGDEFSET_BKGOUTCOLOUR,
@@ -64,7 +64,7 @@ struct char* szDbSetting;
DWORD dwDef;
}
-static _extSettings_v5[18] =
+static _extSettings_v5[] =
{
{ "CommonClrs", "IP_High", FONTMODULE, "ipfieldsbgHigh", 0xf0f0f0 },
{ "CommonClrs", "IP_Low", FONTMODULE, "ipfieldsbg", 0x62caff },
@@ -212,13 +212,13 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat) def = SRMSGDEFSET_BKGCOLOUR;
for (i = 0; i < SIZEOF(_extSettings); i++) {
- WritePrivateProfileStringA(_extSettings[i].szIniSection, _extSettings[i].szIniName,
- _itoa(M.GetDword(_extSettings[i].szDbModule, _extSettings[i].szDbSetting, _extSettings[i].dwDef), szBuf, 10), szIniFilename);
+ auto &p = _extSettings[i];
+ WritePrivateProfileStringA(p.szIniSection, p.szIniName, _itoa(M.GetDword(p.szDbModule, p.szDbSetting, p.dwDef), szBuf, 10), szIniFilename);
}
for (i = 0; i < SIZEOF(_extSettings_v5); i++) {
- WritePrivateProfileStringA(_extSettings_v5[i].szIniSection, _extSettings_v5[i].szIniName,
- _itoa(M.GetDword(_extSettings_v5[i].szDbModule, _extSettings_v5[i].szDbSetting, _extSettings_v5[i].dwDef), szBuf, 10), szIniFilename);
+ auto &p = _extSettings_v5[i];
+ WritePrivateProfileStringA(p.szIniSection, p.szIniName, _itoa(M.GetDword(p.szDbModule, p.szDbSetting, p.dwDef), szBuf, 10), szIniFilename);
}
WritePrivateProfileStringA("Message Log", "VGrid", _itoa(M.GetByte("wantvgrid", 0), szBuf, 10), szIniFilename);
diff --git a/src/modules/chat/chat_rtf.cpp b/src/modules/chat/chat_rtf.cpp index 0758f8bff3..2cff984c84 100644 --- a/src/modules/chat/chat_rtf.cpp +++ b/src/modules/chat/chat_rtf.cpp @@ -201,6 +201,9 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) } } + if (bInsideUl)
+ res.Append(_T("[/u]"));
+ pszText = res; return TRUE; } |