summaryrefslogtreecommitdiff
path: root/plugins/NewStory
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-10-29 19:55:01 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-10-29 19:55:01 +0300
commiteb7783cca53e945354b83aa3899ca9cdb0602dbd (patch)
treed900571248d3c761f92fae7509834882fdeeb538 /plugins/NewStory
parent54c499be356449adfba900116fb264113cbd6c7f (diff)
further investigation about RTF for ITextServices
Diffstat (limited to 'plugins/NewStory')
-rw-r--r--plugins/NewStory/src/templates.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp
index 7010ff1e85..7e6f82a0a7 100644
--- a/plugins/NewStory/src/templates.cpp
+++ b/plugins/NewStory/src/templates.cpp
@@ -60,8 +60,6 @@ CMStringW TplFormatStringEx(int tpl, wchar_t *sztpl, ItemData *item)
static void AppendUnicodeToBuffer(CMStringA &buf, const wchar_t *p)
{
- buf.Append("{\\uc1 ");
-
for (; *p; p++) {
if (*p == '\r' && p[1] == '\n') {
buf.Append("\\p ");
@@ -118,7 +116,6 @@ static void AppendUnicodeToBuffer(CMStringA &buf, const wchar_t *p)
buf.AppendFormat("\\u%d ?", *p);
}
}
- buf.AppendChar('}');
}
CMStringA NSRtfProvider::CreateRtfHeader()
@@ -127,7 +124,7 @@ CMStringA NSRtfProvider::CreateRtfHeader()
buf.Append("{\\rtf1\\ansi\\deff0");
auto &F = g_fontTable[(m_pItem->dbe.flags & DBEF_SENT) ? FONT_OUTMSG : FONT_INMSG];
- buf.AppendFormat("{\\fonttbl{\\f0\\fnil\\fcharset1 %s;}}", F.lf.lfFaceName);
+ buf.AppendFormat("{\\fonttbl{\\f0\\fnil\\fcharset0 %s;}}", F.lf.lfFaceName);
COLORREF cr = GetSysColor(COLOR_WINDOWTEXT);
buf.AppendFormat("{\\colortbl \\red%u\\green%u\\blue%u;", GetRValue(cr), GetGValue(cr), GetBValue(cr));
@@ -142,14 +139,14 @@ CMStringA NSRtfProvider::CreateRtfBody()
CMStringW wszText = TplFormatString(m_pItem->getTemplate(), m_pItem->hContact, m_pItem);
CMStringA buf;
- // buf.AppendFormat("\\f0\\cf0\\b0\\i0\\fs%d ", -F.lf.lfHeight);
+ buf.AppendFormat("\\viewkind4\\uc1\\pard \\f0\\b0\\i0\\fs%d ", F.lf.lfHeight);
AppendUnicodeToBuffer(buf, wszText);
return buf;
}
CMStringA NSRtfProvider::CreateRtfFooter()
{
- return "}";
+ return " \\par }";
}
///////////////////////////////////////////////////////////////////////////////