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
6a36990f
Commit
6a36990f
authored
May 02, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
May 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Simplify xic_preedit_draw control flow.
parent
cbe43429
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
xim.c
dlls/winex11.drv/xim.c
+10
-14
No files found.
dlls/winex11.drv/xim.c
View file @
6a36990f
...
...
@@ -170,22 +170,18 @@ static int xic_preedit_draw( XIC xic, XPointer user, XPointer arg )
{
XIMPreeditDrawCallbackStruct
*
params
=
(
void
*
)
arg
;
HWND
hwnd
=
(
HWND
)
user
;
size_t
text_len
;
XIMText
*
text
;
WCHAR
*
output
;
char
*
str
;
int
len
;
TRACE
(
"xic %p, hwnd %p, arg %p
\n
"
,
xic
,
hwnd
,
arg
);
if
(
!
params
)
return
0
;
if
(
!
(
text
=
params
->
text
))
xim_update_comp_string
(
params
->
chg_first
,
params
->
chg_length
,
NULL
,
0
);
else
{
size_t
text_len
;
WCHAR
*
output
;
char
*
str
;
int
len
;
if
(
!
text
->
encoding_is_wchar
)
str
=
text
->
string
.
multi_byte
;
if
(
!
(
text
=
params
->
text
))
str
=
NULL
;
else
if
(
!
text
->
encoding_is_wchar
)
str
=
text
->
string
.
multi_byte
;
else
if
((
len
=
wcstombs
(
NULL
,
text
->
string
.
wide_char
,
text
->
length
))
<
0
)
str
=
NULL
;
else
if
((
str
=
malloc
(
len
+
1
)))
{
...
...
@@ -193,16 +189,16 @@ static int xic_preedit_draw( XIC xic, XPointer user, XPointer arg )
str
[
len
]
=
0
;
}
text_len
=
str
?
strlen
(
str
)
:
0
;
if
((
output
=
malloc
(
text_len
*
sizeof
(
WCHAR
)
)))
if
(
!
str
||
!
(
text_len
=
strlen
(
str
))
||
!
(
output
=
malloc
(
text_len
*
sizeof
(
WCHAR
)
)))
xim_update_comp_string
(
params
->
chg_first
,
params
->
chg_length
,
NULL
,
0
);
else
{
text_len
=
ntdll_umbstowcs
(
str
,
text_len
,
output
,
text_len
);
xim_update_comp_string
(
params
->
chg_first
,
params
->
chg_length
,
output
,
text_len
);
free
(
output
);
}
if
(
str
!=
text
->
string
.
multi_byte
)
free
(
str
);
}
if
(
text
&&
str
!=
text
->
string
.
multi_byte
)
free
(
str
);
x11drv_client_call
(
client_ime_set_cursor_pos
,
params
->
caret
);
...
...
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