Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
4cb7578d
Commit
4cb7578d
authored
Aug 21, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Aug 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Move the editor initialization out of CreateTextHost().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
267bca1f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
17 deletions
+28
-17
editor.c
dlls/riched20/editor.c
+26
-6
txthost.c
dlls/riched20/txthost.c
+2
-11
No files found.
dlls/riched20/editor.c
View file @
4cb7578d
...
@@ -4792,6 +4792,30 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
...
@@ -4792,6 +4792,30 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
return
0L
;
return
0L
;
}
}
static
BOOL
create_windowed_editor
(
HWND
hwnd
,
CREATESTRUCTW
*
create
,
BOOL
emulate_10
)
{
ITextHost
*
host
=
ME_CreateTextHost
(
hwnd
,
create
,
emulate_10
);
ME_TextEditor
*
editor
;
if
(
!
host
)
return
FALSE
;
editor
=
ME_MakeEditor
(
host
,
emulate_10
,
create
->
style
);
if
(
!
editor
)
{
ITextHost_Release
(
host
);
return
FALSE
;
}
editor
->
exStyleFlags
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
editor
->
styleFlags
|=
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
ES_WANTRETURN
;
editor
->
hWnd
=
hwnd
;
/* FIXME: Remove editor's dependence on hWnd */
editor
->
hwndParent
=
create
->
hwndParent
;
SetWindowLongPtrW
(
hwnd
,
0
,
(
LONG_PTR
)
editor
);
return
TRUE
;
}
static
LRESULT
RichEditWndProc_common
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
static
LRESULT
RichEditWndProc_common
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
LPARAM
lParam
,
BOOL
unicode
)
{
{
...
@@ -4808,11 +4832,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
...
@@ -4808,11 +4832,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
if
(
msg
==
WM_NCCREATE
)
if
(
msg
==
WM_NCCREATE
)
{
{
CREATESTRUCTW
*
pcs
=
(
CREATESTRUCTW
*
)
lParam
;
CREATESTRUCTW
*
pcs
=
(
CREATESTRUCTW
*
)
lParam
;
ITextHost
*
texthost
;
TRACE
(
"WM_NCCREATE: hWnd %p style 0x%08x
\n
"
,
hWnd
,
pcs
->
style
);
TRACE
(
"WM_NCCREATE: hWnd %p style 0x%08x
\n
"
,
hWnd
,
pcs
->
style
);
texthost
=
ME_CreateTextHost
(
hWnd
,
pcs
,
FALSE
);
return
create_windowed_editor
(
hWnd
,
pcs
,
FALSE
);
return
texthost
!=
NULL
;
}
}
else
else
{
{
...
@@ -4938,12 +4960,10 @@ LRESULT WINAPI RichEdit10ANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
...
@@ -4938,12 +4960,10 @@ LRESULT WINAPI RichEdit10ANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
{
{
if
(
msg
==
WM_NCCREATE
&&
!
GetWindowLongPtrW
(
hWnd
,
0
))
if
(
msg
==
WM_NCCREATE
&&
!
GetWindowLongPtrW
(
hWnd
,
0
))
{
{
ITextHost
*
texthost
;
CREATESTRUCTW
*
pcs
=
(
CREATESTRUCTW
*
)
lParam
;
CREATESTRUCTW
*
pcs
=
(
CREATESTRUCTW
*
)
lParam
;
TRACE
(
"WM_NCCREATE: hWnd %p style 0x%08x
\n
"
,
hWnd
,
pcs
->
style
);
TRACE
(
"WM_NCCREATE: hWnd %p style 0x%08x
\n
"
,
hWnd
,
pcs
->
style
);
texthost
=
ME_CreateTextHost
(
hWnd
,
pcs
,
TRUE
);
return
create_windowed_editor
(
hWnd
,
pcs
,
TRUE
);
return
texthost
!=
NULL
;
}
}
return
RichEditANSIWndProc
(
hWnd
,
msg
,
wParam
,
lParam
);
return
RichEditANSIWndProc
(
hWnd
,
msg
,
wParam
,
lParam
);
}
}
...
...
dlls/riched20/txthost.c
View file @
4cb7578d
...
@@ -45,24 +45,15 @@ static const ITextHostVtbl textHostVtbl;
...
@@ -45,24 +45,15 @@ static const ITextHostVtbl textHostVtbl;
ITextHost
*
ME_CreateTextHost
(
HWND
hwnd
,
CREATESTRUCTW
*
cs
,
BOOL
bEmulateVersion10
)
ITextHost
*
ME_CreateTextHost
(
HWND
hwnd
,
CREATESTRUCTW
*
cs
,
BOOL
bEmulateVersion10
)
{
{
ITextHostImpl
*
texthost
;
ITextHostImpl
*
texthost
;
texthost
=
CoTaskMemAlloc
(
sizeof
(
*
texthost
));
texthost
=
CoTaskMemAlloc
(
sizeof
(
*
texthost
));
if
(
texthost
)
if
(
!
texthost
)
return
NULL
;
{
ME_TextEditor
*
editor
;
texthost
->
ITextHost_iface
.
lpVtbl
=
&
textHostVtbl
;
texthost
->
ITextHost_iface
.
lpVtbl
=
&
textHostVtbl
;
texthost
->
ref
=
1
;
texthost
->
ref
=
1
;
texthost
->
hWnd
=
hwnd
;
texthost
->
hWnd
=
hwnd
;
texthost
->
bEmulateVersion10
=
bEmulateVersion10
;
texthost
->
bEmulateVersion10
=
bEmulateVersion10
;
editor
=
ME_MakeEditor
(
&
texthost
->
ITextHost_iface
,
bEmulateVersion10
,
cs
->
style
);
editor
->
exStyleFlags
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
editor
->
styleFlags
|=
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
ES_WANTRETURN
;
editor
->
hWnd
=
hwnd
;
/* FIXME: Remove editor's dependence on hWnd */
editor
->
hwndParent
=
cs
->
hwndParent
;
SetWindowLongPtrW
(
hwnd
,
0
,
(
LONG_PTR
)
editor
);
}
return
&
texthost
->
ITextHost_iface
;
return
&
texthost
->
ITextHost_iface
;
}
}
...
...
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