summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-05-25 18:36:42 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-05-25 18:36:42 +0300
commitb7928747cf0f8e53a01ee4628c58559862a9a689 (patch)
tree73ce33fe7e613afdedc4cfaf5d50d1c5c249fce1 /libs
parenta30963d9f0a7561627f499b947caf78d4e6db2e2 (diff)
NewStory: small fixes
Diffstat (limited to 'libs')
-rw-r--r--libs/mTextControl/src/FormattedTextDraw.cpp2
-rw-r--r--libs/mTextControl/src/services.cpp16
-rw-r--r--libs/mTextControl/src/textusers.cpp2
3 files changed, 14 insertions, 6 deletions
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];