[PATCH 1/5] riched20: Implement ITextServices_OnTxInPlaceActivate().

Huw Davies huw at codeweavers.com
Mon Mar 22 03:55:49 CDT 2021


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 dlls/riched20/editor.c  |  1 +
 dlls/riched20/editstr.h |  3 ++-
 dlls/riched20/txtsrv.c  | 22 +++++++++++++++++-----
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 7027b148188..293ac0bad5a 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2936,6 +2936,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
   ed->texthost = texthost;
   ed->reOle = NULL;
   ed->bEmulateVersion10 = bEmulateVersion10;
+  ed->in_place_active = FALSE;
   ed->total_rows = 0;
   ITextHost_TxGetPropertyBits( texthost, TXTBIT_RICHTEXT | TXTBIT_MULTILINE | TXTBIT_READONLY |
                                TXTBIT_USEPASSWORD | TXTBIT_HIDESELECTION | TXTBIT_SAVESELECTION |
diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h
index 2d2816340bc..c0fef69547e 100644
--- a/dlls/riched20/editstr.h
+++ b/dlls/riched20/editstr.h
@@ -380,7 +380,8 @@ typedef struct tagME_TextEditor
   HWND hWnd, hwndParent;
   ITextHost *texthost;
   IUnknown *reOle;
-  BOOL bEmulateVersion10;
+  unsigned int bEmulateVersion10 : 1;
+  unsigned int in_place_active : 1;
   ME_TextBuffer *pBuffer;
   ME_Cursor *pCursors;
   DWORD props;
diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c
index d637d52ea3b..d95a3ac4c7e 100644
--- a/dlls/riched20/txtsrv.c
+++ b/dlls/riched20/txtsrv.c
@@ -233,12 +233,23 @@ static HRESULT update_client_rect( struct text_services *services, const RECT *c
 }
 
 DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxInPlaceActivate,8)
-DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxInPlaceActivate(ITextServices *iface, LPCRECT prcClient)
+DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxInPlaceActivate( ITextServices *iface, const RECT *client )
 {
     struct text_services *services = impl_from_ITextServices( iface );
+    HRESULT hr;
+    BOOL old_active = services->editor->in_place_active;
 
-    FIXME( "%p: STUB\n", services );
-    return E_NOTIMPL;
+    TRACE( "%p: %s\n", services, wine_dbgstr_rect( client ) );
+
+    services->editor->in_place_active = TRUE;
+    hr = update_client_rect( services, client );
+    if (FAILED( hr ))
+    {
+        services->editor->in_place_active = old_active;
+        return hr;
+    }
+    ME_RewrapRepaint( services->editor );
+    return S_OK;
 }
 
 DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxInPlaceDeactivate,4)
@@ -246,8 +257,9 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxInPlaceDeactivate(ITextServices
 {
     struct text_services *services = impl_from_ITextServices( iface );
 
-    FIXME( "%p: STUB\n", services );
-    return E_NOTIMPL;
+    TRACE( "%p\n", services );
+    services->editor->in_place_active = FALSE;
+    return S_OK;
 }
 
 DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxUIActivate,4)
-- 
2.23.0




More information about the wine-devel mailing list