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
5c765431
Commit
5c765431
authored
Jun 28, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix the listbox sorting algorithm.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
18420c24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
listbox.c
dlls/user32/listbox.c
+6
-5
No files found.
dlls/user32/listbox.c
View file @
5c765431
...
...
@@ -828,10 +828,11 @@ static INT LISTBOX_FindStringPos( LB_DESCR *descr, LPCWSTR str, BOOL exact )
{
INT
index
,
min
,
max
,
res
;
if
(
!
(
descr
->
style
&
LBS_SORT
))
return
-
1
;
/* Add it at the end */
if
(
!
descr
->
nb_items
||
!
(
descr
->
style
&
LBS_SORT
))
return
-
1
;
/* Add it at the end */
min
=
0
;
max
=
descr
->
nb_items
;
while
(
min
!
=
max
)
max
=
descr
->
nb_items
-
1
;
while
(
min
<
=
max
)
{
index
=
(
min
+
max
)
/
2
;
if
(
HAS_STRINGS
(
descr
))
...
...
@@ -854,10 +855,10 @@ static INT LISTBOX_FindStringPos( LB_DESCR *descr, LPCWSTR str, BOOL exact )
res
=
SendMessageW
(
descr
->
owner
,
WM_COMPAREITEM
,
id
,
(
LPARAM
)
&
cis
);
}
if
(
!
res
)
return
index
;
if
(
res
>
0
)
max
=
index
;
if
(
res
>
0
)
max
=
index
-
1
;
else
min
=
index
+
1
;
}
return
exact
?
-
1
:
m
ax
;
return
exact
?
-
1
:
m
in
;
}
...
...
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