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
2007e17d
Commit
2007e17d
authored
Jan 23, 2019
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Jan 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/autocomplete: Always expand if the enumerator was reset.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b9224c21
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
autocomplete.c
dlls/shell32/autocomplete.c
+7
-1
autocomplete.c
dlls/shell32/tests/autocomplete.c
+17
-2
No files found.
dlls/shell32/autocomplete.c
View file @
2007e17d
...
...
@@ -435,12 +435,18 @@ static BOOL aclist_expand(IAutoCompleteImpl *ac, WCHAR *txt)
{
/* call IACList::Expand only when needed, if the
new txt and old_txt require different expansions */
WCHAR
c
,
*
p
,
*
last_delim
,
*
old_txt
=
ac
->
txtbackup
;
static
const
WCHAR
empty
[]
=
{
0
};
const
WCHAR
*
old_txt
=
ac
->
txtbackup
;
WCHAR
c
,
*
p
,
*
last_delim
;
size_t
i
=
0
;
/* '/' is allowed as a delim for unix paths */
static
const
WCHAR
delims
[]
=
{
'\\'
,
'/'
,
0
};
/* always expand if the enumerator was reset */
if
(
!
ac
->
enum_strs
)
old_txt
=
empty
;
/* skip the shared prefix */
while
((
c
=
tolowerW
(
txt
[
i
]))
==
tolowerW
(
old_txt
[
i
]))
{
...
...
dlls/shell32/tests/autocomplete.c
View file @
2007e17d
...
...
@@ -494,7 +494,7 @@ static void check_dropdown_(const char *file, UINT line, IAutoCompleteDropDown *
}
}
static
void
test_aclist_expand
(
HWND
hwnd_edit
,
void
*
enumerator
)
static
void
test_aclist_expand
(
HWND
hwnd_edit
,
void
*
enumerator
,
IAutoCompleteDropDown
*
acdropdown
)
{
struct
string_enumerator
*
obj
=
(
struct
string_enumerator
*
)
enumerator
;
static
WCHAR
str1
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
...
...
@@ -502,6 +502,7 @@ static void test_aclist_expand(HWND hwnd_edit, void *enumerator)
static
WCHAR
str2
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'\\'
,
'f'
,
'o'
,
'o'
,
'\\'
,
'b'
,
'a'
,
'r'
,
'\\'
,
'b'
,
'a'
,
0
};
static
WCHAR
str2a
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'\\'
,
'f'
,
'o'
,
'o'
,
'\\'
,
'b'
,
'a'
,
'r'
,
'\\'
,
0
};
static
WCHAR
str2b
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'\\'
,
'f'
,
'o'
,
'o'
,
'\\'
,
'b'
,
'a'
,
'r'
,
'\\'
,
'b'
,
'a'
,
'z'
,
'_'
,
'b'
,
'b'
,
'q'
,
'\\'
,
0
};
HRESULT
hr
;
obj
->
num_resets
=
0
;
ok
(
obj
->
num_expand
==
0
,
"Expected 0 expansions, got %u
\n
"
,
obj
->
num_expand
);
...
...
@@ -546,6 +547,20 @@ static void test_aclist_expand(HWND hwnd_edit, void *enumerator)
dispatch_messages
();
ok
(
obj
->
num_expand
==
4
,
"Expected 4 expansions, got %u
\n
"
,
obj
->
num_expand
);
ok
(
obj
->
num_resets
==
5
,
"Expected 5 resets, got %u
\n
"
,
obj
->
num_resets
);
SendMessageW
(
hwnd_edit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
str1a
);
SendMessageW
(
hwnd_edit
,
EM_SETSEL
,
ARRAY_SIZE
(
str1a
)
-
1
,
ARRAY_SIZE
(
str1a
)
-
1
);
SendMessageW
(
hwnd_edit
,
WM_CHAR
,
'f'
,
1
);
dispatch_messages
();
ok
(
obj
->
num_expand
==
5
,
"Expected 5 expansions, got %u
\n
"
,
obj
->
num_expand
);
ok
(
lstrcmpW
(
obj
->
last_expand
,
str1a
)
==
0
,
"Expected %s, got %s
\n
"
,
wine_dbgstr_w
(
str1a
),
wine_dbgstr_w
(
obj
->
last_expand
));
ok
(
obj
->
num_resets
==
6
,
"Expected 6 resets, got %u
\n
"
,
obj
->
num_resets
);
hr
=
IAutoCompleteDropDown_ResetEnumerator
(
acdropdown
);
ok
(
hr
==
S_OK
,
"IAutoCompleteDropDown_ResetEnumerator failed: %x
\n
"
,
hr
);
SendMessageW
(
hwnd_edit
,
WM_CHAR
,
'o'
,
1
);
dispatch_messages
();
ok
(
obj
->
num_expand
==
6
,
"Expected 6 expansions, got %u
\n
"
,
obj
->
num_expand
);
ok
(
lstrcmpW
(
obj
->
last_expand
,
str1a
)
==
0
,
"Expected %s, got %s
\n
"
,
wine_dbgstr_w
(
str1a
),
wine_dbgstr_w
(
obj
->
last_expand
));
ok
(
obj
->
num_resets
==
7
,
"Expected 7 resets, got %u
\n
"
,
obj
->
num_resets
);
}
static
void
test_prefix_filtering
(
HWND
hwnd_edit
)
...
...
@@ -775,7 +790,7 @@ static void test_custom_source(void)
SendMessageW
(
hwnd_edit
,
WM_GETTEXT
,
ARRAY_SIZE
(
buffer
),
(
LPARAM
)
buffer
);
ok
(
lstrcmpW
(
str_aut
,
buffer
)
==
0
,
"Expected %s, got %s
\n
"
,
wine_dbgstr_w
(
str_aut
),
wine_dbgstr_w
(
buffer
));
test_aclist_expand
(
hwnd_edit
,
enumerator
);
test_aclist_expand
(
hwnd_edit
,
enumerator
,
acdropdown
);
obj
->
num_resets
=
0
;
hr
=
IAutoCompleteDropDown_ResetEnumerator
(
acdropdown
);
...
...
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