Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c4acdfd3
Commit
c4acdfd3
authored
Mar 26, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Mar 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use the text host stored in the editor structure.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a15e4515
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
txtsrv.c
dlls/riched20/txtsrv.c
+11
-13
No files found.
dlls/riched20/txtsrv.c
View file @
c4acdfd3
...
...
@@ -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
->
text
host
,
&
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
->
text
host
);
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
->
text
host
,
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
->
text
host
);
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
->
text
host
,
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
->
text
host
,
&
scrollbars
);
if
(
SUCCEEDED
(
hr
))
{
if
((
services
->
editor
->
scrollbars
^
scrollbars
)
&
WS_HSCROLL
)
ITextHost_TxShowScrollBar
(
services
->
host
,
SB_HORZ
,
(
scrollbars
&
WS_HSCROLL
)
&&
ITextHost_TxShowScrollBar
(
services
->
editor
->
text
host
,
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
->
text
host
,
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
->
text
host
,
&
width
);
if
(
hr
==
S_OK
)
{
ITextHost_TxInvalidateRect
(
services
->
host
,
&
services
->
editor
->
rcFormat
,
TRUE
);
ITextHost_TxInvalidateRect
(
services
->
editor
->
text
host
,
&
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
->
text
host
,
&
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment