diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-14 19:24:52 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-14 19:24:52 +0300 |
commit | c903fe01f85d8bbd7b5fe670d2314a6c92bfe688 (patch) | |
tree | f8d86207531ed378fa17719d4322da7a4ba6519e /libs/mTextControl/src/fancy_rtf.cpp | |
parent | 1c9faebef10ee8a8de06b31ba1cf0049be8ee6dc (diff) |
libTextControl: patch for more effective icon caching (if we need it sometimes)
Diffstat (limited to 'libs/mTextControl/src/fancy_rtf.cpp')
-rw-r--r-- | libs/mTextControl/src/fancy_rtf.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/mTextControl/src/fancy_rtf.cpp b/libs/mTextControl/src/fancy_rtf.cpp index 7c82bad0cd..e6193f63af 100644 --- a/libs/mTextControl/src/fancy_rtf.cpp +++ b/libs/mTextControl/src/fancy_rtf.cpp @@ -93,10 +93,12 @@ static bool bbCodeImageFunc(CFormattedTextDraw *ftd, CHARRANGE range, wchar_t *t if (!swscanf(txt, L"%p", &hIcon)) return false; - bool res = InsertBitmap(RichEditOle, CacheIconToEmf(hIcon)); + bool res = InsertBitmap(ftd->getParentWnd(), RichEditOle, hIcon); + if (!res) + ts->TxSendMessage(EM_REPLACESEL, 0, (LPARAM)L"!E!", &lResult); + td->Unfreeze(&cnt); - RichEditOle->Release(); - return res; + return true; } static BBCodeInfo bbCodes[] = |