From b7928747cf0f8e53a01ee4628c58559862a9a689 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 25 May 2023 18:36:42 +0300 Subject: NewStory: small fixes --- libs/mTextControl/src/FormattedTextDraw.cpp | 2 +- libs/mTextControl/src/services.cpp | 16 ++++++++++++---- libs/mTextControl/src/textusers.cpp | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'libs') diff --git a/libs/mTextControl/src/FormattedTextDraw.cpp b/libs/mTextControl/src/FormattedTextDraw.cpp index db171f174e..8ae67f69a2 100644 --- a/libs/mTextControl/src/FormattedTextDraw.cpp +++ b/libs/mTextControl/src/FormattedTextDraw.cpp @@ -31,7 +31,7 @@ const IID IID_ITextDocument = { ///////////////////////////////////////////////////////////////////////////// // CallBack functions -uint32_t CALLBACK EditStreamInCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) +static DWORD CALLBACK EditStreamInCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) { COOKIE *pCookie = (COOKIE *)dwCookie; if (pCookie->isUnicode) { diff --git a/libs/mTextControl/src/services.cpp b/libs/mTextControl/src/services.cpp index 397c6b37e5..b38ef88367 100644 --- a/libs/mTextControl/src/services.cpp +++ b/libs/mTextControl/src/services.cpp @@ -92,10 +92,18 @@ MTEXTCONTROL_DLL(TextObject *) MTextCreateEx(HANDLE userHandle, void *text, uint InitRichEdit(result->ftd->getTextService()); MText_InitFormatting0(result->ftd, result->options); - if (flags & MTEXT_FLG_WCHAR) - result->ftd->putTextW((wchar_t *)text); - else - result->ftd->putTextA((char *)text); + if (flags & MTEXT_FLG_RTF) { + if (flags & MTEXT_FLG_WCHAR) + result->ftd->putRTFTextW((wchar_t *)text); + else + result->ftd->putRTFTextA((char *)text); + } + else { + if (flags & MTEXT_FLG_WCHAR) + result->ftd->putTextW((wchar_t *)text); + else + result->ftd->putTextA((char *)text); + } MText_InitFormatting1(result); delete result; diff --git a/libs/mTextControl/src/textusers.cpp b/libs/mTextControl/src/textusers.cpp index aa276183ac..ced1b93866 100644 --- a/libs/mTextControl/src/textusers.cpp +++ b/libs/mTextControl/src/textusers.cpp @@ -24,7 +24,7 @@ HANDLE htuDefault = nullptr; static TextUser *textUserFirst = nullptr; static TextUser *textUserLast = nullptr; -MTEXTCONTROL_DLL(HANDLE) MTextRegister(const char *userTitle, DWORD options) +MTEXTCONTROL_DLL(HANDLE) MTextRegister(const char *userTitle, uint32_t options) { TextUser *textUserNew = new TextUser; textUserNew->name = new char[mir_strlen(userTitle) + 1]; -- cgit v1.2.3