From 1cbdcde34f1d6fbcdb80317fa16c3dd8131f542f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 4 Aug 2023 18:23:57 +0300 Subject: for #3530 (Bookmarks) --- libs/mTextControl/src/fancy_rtf.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libs/mTextControl/src') 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; -- cgit v1.2.3