diff options
author | George Hazan <george.hazan@gmail.com> | 2023-08-04 18:23:57 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-08-04 18:23:57 +0300 |
commit | 1cbdcde34f1d6fbcdb80317fa16c3dd8131f542f (patch) | |
tree | d438efaae235298c6498ad83bdfdc1cfbdb0cc82 /libs/mTextControl | |
parent | e215b9e602c3a3e4dd9ee2b9f9d1bb6bad9e4060 (diff) |
for #3530 (Bookmarks)
Diffstat (limited to 'libs/mTextControl')
-rw-r--r-- | libs/mTextControl/src/fancy_rtf.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libs/mTextControl/src/fancy_rtf.cpp b/libs/mTextControl/src/fancy_rtf.cpp index 18e1232120..d7beb7000c 100644 --- a/libs/mTextControl/src/fancy_rtf.cpp +++ b/libs/mTextControl/src/fancy_rtf.cpp @@ -88,12 +88,11 @@ static bool bbCodeImageFunc(CFormattedTextDraw *ftd, CHARRANGE range, wchar_t *t ts->TxSendMessage(EM_GETOLEINTERFACE, 0, (LPARAM)&RichEditOle, &lResult); td->Freeze(&cnt); - #ifdef _WIN64 - bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_wtoi64(txt))); - #else - bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_wtoi(txt))); - #endif + HICON hIcon; + if (!swscanf(txt, L"%p", &hIcon)) + return false; + bool res = InsertBitmap(RichEditOle, CacheIconToEmf(hIcon)); td->Unfreeze(&cnt); RichEditOle->Release(); return res; |