From a142fcc92966e515775871f6edea813e2d9d4735 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 5 Mar 2017 21:43:39 +0000 Subject: [PATCH] [RICHED20] Sync with Wine Staging 2.2. CORE-12823 440b921 riched20: Return proper interface pointers. e63cea5 riched20: A spelling fix in a comment. 9f37f6a riched20: Check for NULL in fnTextSrv_TxSetText and add test. svn path=/trunk/; revision=74108 --- reactos/dll/win32/riched20/clipboard.c | 4 ++-- reactos/dll/win32/riched20/style.c | 2 +- reactos/dll/win32/riched20/txthost.c | 2 +- reactos/dll/win32/riched20/txtsrv.c | 7 +++---- reactos/media/doc/README.WINE | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/reactos/dll/win32/riched20/clipboard.c b/reactos/dll/win32/riched20/clipboard.c index c7d850a30b2..53287305613 100644 --- a/reactos/dll/win32/riched20/clipboard.c +++ b/reactos/dll/win32/riched20/clipboard.c @@ -64,7 +64,7 @@ static HRESULT WINAPI EnumFormatImpl_QueryInterface(IEnumFORMATETC *iface, REFII if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumFORMATETC)) { IEnumFORMATETC_AddRef(iface); - *ppvObj = This; + *ppvObj = &This->IEnumFORMATETC_iface; return S_OK; } *ppvObj = NULL; @@ -181,7 +181,7 @@ static HRESULT WINAPI DataObjectImpl_QueryInterface(IDataObject *iface, REFIID r if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDataObject)) { IDataObject_AddRef(iface); - *ppvObj = This; + *ppvObj = &This->IDataObject_iface; return S_OK; } *ppvObj = NULL; diff --git a/reactos/dll/win32/riched20/style.c b/reactos/dll/win32/riched20/style.c index 1a944cbb798..4f08b3b1333 100644 --- a/reactos/dll/win32/riched20/style.c +++ b/reactos/dll/win32/riched20/style.c @@ -183,7 +183,7 @@ ME_Style *ME_ApplyStyle(ME_TextEditor *editor, ME_Style *sSrc, CHARFORMAT2W *mod } COPY_STYLE_ITEM(CFM_UNDERLINETYPE, bUnderlineType); - /* If the CFM_UNDERLINE effect is not specified set it appropiately */ + /* If the CFM_UNDERLINE effect is not specified, set it appropriately */ if ((mod->dwMask & CFM_UNDERLINETYPE) && !(mod->dwMask & CFM_UNDERLINE)) { fmt.dwMask |= CFM_UNDERLINE; diff --git a/reactos/dll/win32/riched20/txthost.c b/reactos/dll/win32/riched20/txthost.c index 04e61ab9a2b..112295ad963 100644 --- a/reactos/dll/win32/riched20/txthost.c +++ b/reactos/dll/win32/riched20/txthost.c @@ -65,7 +65,7 @@ static HRESULT WINAPI ITextHostImpl_QueryInterface(ITextHost *iface, REFIID riid ITextHostImpl *This = impl_from_ITextHost(iface); if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextHost)) { - *ppvObject = This; + *ppvObject = &This->ITextHost_iface; ITextHost_AddRef((ITextHost *)*ppvObject); return S_OK; } diff --git a/reactos/dll/win32/riched20/txtsrv.c b/reactos/dll/win32/riched20/txtsrv.c index 45f8aaa87af..8e0ef388297 100644 --- a/reactos/dll/win32/riched20/txtsrv.c +++ b/reactos/dll/win32/riched20/txtsrv.c @@ -274,10 +274,9 @@ DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSetText(ITextServices *iface, LPCWSTR ME_Cursor cursor; ME_SetCursorToStart(This->editor, &cursor); - ME_InternalDeleteText(This->editor, &cursor, - ME_GetTextLength(This->editor), FALSE); - ME_InsertTextFromCursor(This->editor, 0, pszText, -1, - This->editor->pBuffer->pDefaultStyle); + ME_InternalDeleteText(This->editor, &cursor, ME_GetTextLength(This->editor), FALSE); + if(pszText) + ME_InsertTextFromCursor(This->editor, 0, pszText, -1, This->editor->pBuffer->pDefaultStyle); ME_SetSelection(This->editor, 0, 0); This->editor->nModifyStep = 0; OleFlushClipboard(); diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 37e5f435fb3..8cc644dccd9 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -158,7 +158,7 @@ reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.9.11 reactos/dll/win32/query # Synced to WineStaging-1.9.11 reactos/dll/win32/rasapi32 # Synced to WineStaging-1.9.11 reactos/dll/win32/resutils # Synced to WineStaging-1.9.11 -reactos/dll/win32/riched20 # Synced to WineStaging-1.9.23 +reactos/dll/win32/riched20 # Synced to WineStaging-2.2 reactos/dll/win32/riched32 # Synced to WineStaging-1.9.11 reactos/dll/win32/rpcrt4 # Synced to WineStaging-2.2 reactos/dll/win32/rsabase # Synced to WineStaging-1.9.11