Huw Davies : riched20: Use the text host stored in the editor structure.
Alexandre Julliard
julliard at winehq.org
Fri Mar 26 16:03:31 CDT 2021
Module: wine
Branch: master
Commit: c4acdfd3b411b8f8dee5ac4f1c5907fb4fc8035b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c4acdfd3b411b8f8dee5ac4f1c5907fb4fc8035b
Author: Huw Davies <huw at codeweavers.com>
Date: Fri Mar 26 09:08:01 2021 +0000
riched20: Use the text host stored in the editor structure.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/riched20/txtsrv.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c
index 5736964c1b1..4cd19a0d24b 100644
--- a/dlls/riched20/txtsrv.c
+++ b/dlls/riched20/txtsrv.c
@@ -38,7 +38,6 @@ struct text_services
ITextServices ITextServices_iface;
IUnknown *outer_unk;
LONG ref;
- ITextHost *host;
ME_TextEditor *editor;
char spare[256]; /* for bug #12179 */
};
@@ -150,7 +149,7 @@ static HRESULT update_client_rect( struct text_services *services, const RECT *c
if (!client)
{
if (!services->editor->in_place_active) return E_INVALIDARG;
- hr = ITextHost_TxGetClientRect( services->host, &rect );
+ hr = ITextHost_TxGetClientRect( services->editor->texthost, &rect );
if (FAILED( hr )) return hr;
}
else rect = *client;
@@ -186,7 +185,7 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxDraw( ITextServices *iface, DWORD
if (hr == S_OK) rewrap = TRUE;
if (!dc && services->editor->in_place_active)
- dc = ITextHost_TxGetDC( services->host );
+ dc = ITextHost_TxGetDC( services->editor->texthost );
if (!dc) return E_FAIL;
if (rewrap)
@@ -196,7 +195,7 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxDraw( ITextServices *iface, DWORD
}
editor_draw( services->editor, dc, update );
- if (!draw) ITextHost_TxReleaseDC( services->host, dc );
+ if (!draw) ITextHost_TxReleaseDC( services->editor->texthost, dc );
return S_OK;
}
@@ -389,7 +388,7 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetNaturalSize( ITextServices *if
if (hr == S_OK) rewrap = TRUE;
if (!dc && services->editor->in_place_active)
- dc = ITextHost_TxGetDC( services->host );
+ dc = ITextHost_TxGetDC( services->editor->texthost );
if (!dc) return E_FAIL;
if (rewrap)
@@ -401,7 +400,7 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetNaturalSize( ITextServices *if
*width = services->editor->nTotalWidth;
*height = services->editor->nTotalLength;
- if (!draw) ITextHost_TxReleaseDC( services->host, dc );
+ if (!draw) ITextHost_TxReleaseDC( services->editor->texthost, dc );
return S_OK;
}
@@ -430,14 +429,14 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxPropertyBitsChange( ITextServic
if (mask & TXTBIT_SCROLLBARCHANGE)
{
- hr = ITextHost_TxGetScrollBars( services->host, &scrollbars );
+ hr = ITextHost_TxGetScrollBars( services->editor->texthost, &scrollbars );
if (SUCCEEDED( hr ))
{
if ((services->editor->scrollbars ^ scrollbars) & WS_HSCROLL)
- ITextHost_TxShowScrollBar( services->host, SB_HORZ, (scrollbars & WS_HSCROLL) &&
+ ITextHost_TxShowScrollBar( services->editor->texthost, SB_HORZ, (scrollbars & WS_HSCROLL) &&
services->editor->nTotalWidth > services->editor->sizeWindow.cx );
if ((services->editor->scrollbars ^ scrollbars) & WS_VSCROLL)
- ITextHost_TxShowScrollBar( services->host, SB_VERT, (scrollbars & WS_VSCROLL) &&
+ ITextHost_TxShowScrollBar( services->editor->texthost, SB_VERT, (scrollbars & WS_VSCROLL) &&
services->editor->nTotalLength > services->editor->sizeWindow.cy );
services->editor->scrollbars = scrollbars;
}
@@ -449,10 +448,10 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxPropertyBitsChange( ITextServic
{
LONG width;
- hr = ITextHost_TxGetSelectionBarWidth( services->host, &width );
+ hr = ITextHost_TxGetSelectionBarWidth( services->editor->texthost, &width );
if (hr == S_OK)
{
- ITextHost_TxInvalidateRect( services->host, &services->editor->rcFormat, TRUE );
+ ITextHost_TxInvalidateRect( services->editor->texthost, &services->editor->rcFormat, TRUE );
services->editor->rcFormat.left -= services->editor->selofs;
services->editor->selofs = width ? SELECTIONBAR_WIDTH : 0; /* FIXME: convert from HIMETRIC */
services->editor->rcFormat.left += services->editor->selofs;
@@ -468,7 +467,7 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxPropertyBitsChange( ITextServic
if (mask & TXTBIT_USEPASSWORD)
{
- if (bits & TXTBIT_USEPASSWORD) ITextHost_TxGetPasswordChar( services->host, &services->editor->password_char );
+ if (bits & TXTBIT_USEPASSWORD) ITextHost_TxGetPasswordChar( services->editor->texthost, &services->editor->password_char );
else services->editor->password_char = 0;
repaint = TRUE;
}
@@ -593,7 +592,6 @@ HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **
services = CoTaskMemAlloc( sizeof(*services) );
if (services == NULL) return E_OUTOFMEMORY;
services->ref = 1;
- services->host = text_host; /* Don't take a ref of the host - this would lead to a mutual dependency */
services->IUnknown_inner.lpVtbl = &textservices_inner_vtbl;
services->ITextServices_iface.lpVtbl = &textservices_vtbl;
services->editor = ME_MakeEditor( text_host, emulate_10 );
More information about the wine-cvs
mailing list