summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-02-23 16:42:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-02-23 16:42:53 +0000
commitf20c5f1db8e702f072818f0c57684ee285aed18a (patch)
treebee7805e2e4b490c0ac1a59181341112cad89446
parentcfeedda129cdff51be9122bacd2f07f31ad7c99a (diff)
fix for escaping chars
git-svn-id: http://svn.miranda-ng.org/main/trunk@12249 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp15
1 files 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];