Huw Davies : riched20: Remove accesses to the editor in TxNotify.

Alexandre Julliard julliard at winehq.org
Fri Mar 26 16:03:31 CDT 2021


Module: wine
Branch: master
Commit: 6c781a1fb7da83905ad086c4c61800432c9fad30
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6c781a1fb7da83905ad086c4c61800432c9fad30

Author: Huw Davies <huw at codeweavers.com>
Date:   Fri Mar 26 09:08:03 2021 +0000

riched20: Remove accesses to the editor in TxNotify.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/riched20/txthost.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c
index 0618d6031ef..c220fe5ec57 100644
--- a/dlls/riched20/txthost.c
+++ b/dlls/riched20/txthost.c
@@ -467,12 +467,11 @@ DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxNotify,12)
 DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost2 *iface, DWORD iNotify, void *pv )
 {
     struct host *host = impl_from_ITextHost( iface );
-    HWND hwnd = host->window;
     UINT id;
 
-    if (!host->editor || !host->editor->hwndParent) return S_OK;
+    if (!host->parent) return S_OK;
 
-    id = GetWindowLongW(hwnd, GWLP_ID);
+    id = GetWindowLongW( host->window, GWLP_ID );
 
     switch (iNotify)
     {
@@ -490,16 +489,16 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost2 *iface, DW
             if (!info)
                 return E_FAIL;
 
-            info->hwndFrom = hwnd;
+            info->hwndFrom = host->window;
             info->idFrom = id;
             info->code = iNotify;
-            SendMessageW( host->editor->hwndParent, WM_NOTIFY, id, (LPARAM)info );
+            SendMessageW( host->parent, WM_NOTIFY, id, (LPARAM)info );
             break;
         }
 
         case EN_UPDATE:
             /* Only sent when the window is visible. */
-            if (!IsWindowVisible(hwnd))
+            if (!IsWindowVisible( host->window ))
                 break;
             /* Fall through */
         case EN_CHANGE:
@@ -509,7 +508,7 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost2 *iface, DW
         case EN_MAXTEXT:
         case EN_SETFOCUS:
         case EN_VSCROLL:
-            SendMessageW( host->editor->hwndParent, WM_COMMAND, MAKEWPARAM( id, iNotify ), (LPARAM)hwnd );
+            SendMessageW( host->parent, WM_COMMAND, MAKEWPARAM( id, iNotify ), (LPARAM)host->window );
             break;
 
         case EN_MSGFILTER:




More information about the wine-cvs mailing list