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
f0e350d6
Commit
f0e350d6
authored
Mar 24, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Mar 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Remove direct accesses to the editor from the window proc.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7ebe1aec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
txthost.c
dlls/riched20/txthost.c
+20
-20
No files found.
dlls/riched20/txthost.c
View file @
f0e350d6
...
...
@@ -970,7 +970,6 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
LPARAM
lparam
,
BOOL
unicode
)
{
struct
host
*
host
;
ME_TextEditor
*
editor
;
HRESULT
hr
=
S_OK
;
LRESULT
res
=
0
;
...
...
@@ -999,7 +998,6 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
return
res
;
}
editor
=
host
->
editor
;
switch
(
msg
)
{
case
WM_CHAR
:
...
...
@@ -1042,7 +1040,7 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
RECT
rc
;
HBRUSH
brush
;
if
(
GetUpdateRect
(
editor
->
hW
nd
,
&
rc
,
TRUE
))
if
(
GetUpdateRect
(
hw
nd
,
&
rc
,
TRUE
))
{
brush
=
CreateSolidBrush
(
ITextHost_TxGetSysColor
(
&
host
->
ITextHost_iface
,
COLOR_WINDOW
)
);
FillRect
(
hdc
,
&
rc
,
brush
);
...
...
@@ -1182,47 +1180,49 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
case
WM_PAINT
:
{
HDC
hdc
;
RECT
rc
;
RECT
rc
,
client
;
PAINTSTRUCT
ps
;
HBRUSH
brush
=
CreateSolidBrush
(
ITextHost_TxGetSysColor
(
&
host
->
ITextHost_iface
,
COLOR_WINDOW
)
);
hdc
=
BeginPaint
(
editor
->
hWnd
,
&
ps
);
ITextHostImpl_TxGetClientRect
(
&
host
->
ITextHost_iface
,
&
client
);
hdc
=
BeginPaint
(
hwnd
,
&
ps
);
brush
=
SelectObject
(
hdc
,
brush
);
/* Erase area outside of the formatting rectangle */
if
(
ps
.
rcPaint
.
top
<
editor
->
rcForma
t
.
top
)
if
(
ps
.
rcPaint
.
top
<
clien
t
.
top
)
{
rc
=
ps
.
rcPaint
;
rc
.
bottom
=
editor
->
rcForma
t
.
top
;
rc
.
bottom
=
clien
t
.
top
;
PatBlt
(
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
ps
.
rcPaint
.
top
=
editor
->
rcForma
t
.
top
;
ps
.
rcPaint
.
top
=
clien
t
.
top
;
}
if
(
ps
.
rcPaint
.
bottom
>
editor
->
rcForma
t
.
bottom
)
if
(
ps
.
rcPaint
.
bottom
>
clien
t
.
bottom
)
{
rc
=
ps
.
rcPaint
;
rc
.
top
=
editor
->
rcForma
t
.
bottom
;
rc
.
top
=
clien
t
.
bottom
;
PatBlt
(
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
ps
.
rcPaint
.
bottom
=
editor
->
rcForma
t
.
bottom
;
ps
.
rcPaint
.
bottom
=
clien
t
.
bottom
;
}
if
(
ps
.
rcPaint
.
left
<
editor
->
rcForma
t
.
left
)
if
(
ps
.
rcPaint
.
left
<
clien
t
.
left
)
{
rc
=
ps
.
rcPaint
;
rc
.
right
=
editor
->
rcForma
t
.
left
;
rc
.
right
=
clien
t
.
left
;
PatBlt
(
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
ps
.
rcPaint
.
left
=
editor
->
rcForma
t
.
left
;
ps
.
rcPaint
.
left
=
clien
t
.
left
;
}
if
(
ps
.
rcPaint
.
right
>
editor
->
rcForma
t
.
right
)
if
(
ps
.
rcPaint
.
right
>
clien
t
.
right
)
{
rc
=
ps
.
rcPaint
;
rc
.
left
=
editor
->
rcForma
t
.
right
;
rc
.
left
=
clien
t
.
right
;
PatBlt
(
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
ps
.
rcPaint
.
right
=
editor
->
rcForma
t
.
right
;
ps
.
rcPaint
.
right
=
clien
t
.
right
;
}
ITextServices_TxDraw
(
host
->
text_srv
,
DVASPECT_CONTENT
,
0
,
NULL
,
NULL
,
hdc
,
NULL
,
NULL
,
NULL
,
&
ps
.
rcPaint
,
NULL
,
0
,
TXTVIEW_ACTIVE
);
DeleteObject
(
SelectObject
(
hdc
,
brush
)
);
EndPaint
(
editor
->
hW
nd
,
&
ps
);
EndPaint
(
hw
nd
,
&
ps
);
return
0
;
}
case
EM_REPLACESEL
:
...
...
@@ -1473,7 +1473,7 @@ static BOOL register_classes( HINSTANCE instance )
wcW
.
style
=
CS_DBLCLKS
|
CS_HREDRAW
|
CS_VREDRAW
|
CS_GLOBALCLASS
;
wcW
.
lpfnWndProc
=
RichEditWndProcW
;
wcW
.
cbClsExtra
=
0
;
wcW
.
cbWndExtra
=
sizeof
(
ME_TextEditor
*
);
wcW
.
cbWndExtra
=
sizeof
(
struct
host
*
);
wcW
.
hInstance
=
NULL
;
/* hInstance would register DLL-local class */
wcW
.
hIcon
=
NULL
;
wcW
.
hCursor
=
LoadCursorW
(
NULL
,
(
LPWSTR
)
IDC_IBEAM
);
...
...
@@ -1499,7 +1499,7 @@ static BOOL register_classes( HINSTANCE instance )
wcA
.
style
=
CS_DBLCLKS
|
CS_HREDRAW
|
CS_VREDRAW
|
CS_GLOBALCLASS
;
wcA
.
lpfnWndProc
=
RichEditWndProcA
;
wcA
.
cbClsExtra
=
0
;
wcA
.
cbWndExtra
=
sizeof
(
ME_TextEditor
*
);
wcA
.
cbWndExtra
=
sizeof
(
struct
host
*
);
wcA
.
hInstance
=
NULL
;
/* hInstance would register DLL-local class */
wcA
.
hIcon
=
NULL
;
wcA
.
hCursor
=
LoadCursorW
(
NULL
,
(
LPWSTR
)
IDC_IBEAM
);
...
...
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