From f20c5f1db8e702f072818f0c57684ee285aed18a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 23 Feb 2015 16:42:53 +0000 Subject: fix for escaping chars git-svn-id: http://svn.miranda-ng.org/main/trunk@12249 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/msgdlgutils.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 67c28e2fe4..7d78092e7e 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -912,6 +912,15 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors for (const TCHAR *p = pszText.GetString() + idx; *p;) { switch (*p) { case '\\': + if (p[1] == '\\' || p[1] == '{' || p[1] == '}') { // escaped characters + res.AppendChar(p[1]); + p += 2; break; + } + if (p[1] == '~') { // non-breaking space + res.AppendChar(0xA0); + p += 2; break; + } + if (!_tcsncmp(p, _T("\\cf"), 3)) { // foreground color int iCol = _ttoi(p + 3); int iInd = GetRtfIndex(iCol, iNumColors, pIndex); @@ -979,12 +988,6 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors else if (!_tcsncmp(p, _T("\\tab"), 4)) { // tab res.AppendChar('\t'); } - else if (p[1] == '\\' || p[1] == '{' || p[1] == '}') { // escaped characters - res.AppendChar(p[1]); - } - else if (p[1] == '~') { // non-breaking space - res.AppendChar(0xA0); - } else if (p[1] == '\'') { // special character if (p[2] != ' ' && p[2] != '\\') { TCHAR tmp[10]; -- cgit v1.2.3