From ec9b7581909991cacbcd291becdf17ccbf6194b8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 19 Oct 2023 18:15:45 +0300 Subject: mTextControl: RTF code redesign --- plugins/NewStory/src/history_array.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins/NewStory/src/history_array.cpp') diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index efd3fe9267..72d2b2e4ea 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -372,10 +372,12 @@ void ItemData::load(bool bFullLoad) void ItemData::setText() { - if (m_bRtf) - data = MTextCreateEx(htuLog, (void*)TplFormatRtf(getTemplate(), hContact, this).c_str(), MTEXT_FLG_RTF); - else - data = MTextCreateW(htuLog, Proto_GetBaseAccountName(hContact), TplFormatString(getTemplate(), hContact, this)); + if (m_bRtf) { + NSRtfProvider prov(this); + data = MTextCreateEx(htuLog, &prov, MTEXT_FLG_RTF); + } + else data = MTextCreateW(htuLog, Proto_GetBaseAccountName(hContact), TplFormatString(getTemplate(), hContact, this)); + savedHeight = -1; } -- cgit v1.2.3