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
70937bd8
Commit
70937bd8
authored
Sep 05, 2012
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Sep 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add support for legacy access keys.
parent
ebd18109
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
menu.c
dlls/user32/menu.c
+5
-2
text.c
dlls/user32/text.c
+20
-7
No files found.
dlls/user32/menu.c
View file @
70937bd8
...
...
@@ -773,15 +773,18 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
if
(
!
forceMenuChar
)
{
UINT
i
;
BOOL
cjk
=
GetSystemMetrics
(
SM_DBCSENABLED
);
for
(
i
=
0
;
i
<
menu
->
nItems
;
i
++
,
item
++
)
{
if
(
item
->
text
)
{
WCHAR
*
p
=
item
->
text
-
2
;
const
WCHAR
*
p
=
item
->
text
-
2
;
do
{
p
=
strchrW
(
p
+
2
,
'&'
);
const
WCHAR
*
q
=
p
+
2
;
p
=
strchrW
(
q
,
'&'
);
if
(
!
p
&&
cjk
)
p
=
strchrW
(
q
,
'\036'
);
/* Japanese Win16 */
}
while
(
p
!=
NULL
&&
p
[
1
]
==
'&'
);
if
(
p
&&
(
toupperW
(
p
[
1
])
==
toupperW
(
key
)))
return
i
;
...
...
dlls/user32/text.c
View file @
70937bd8
...
...
@@ -87,6 +87,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(text);
#define CR 13
#define SPACE 32
#define PREFIX 38
#define ALPHA_PREFIX 30
/* Win16: Alphabet prefix */
#define KANA_PREFIX 31
/* Win16: Katakana prefix */
#define FORWARD_SLASH '/'
#define BACK_SLASH '\\'
...
...
@@ -472,8 +474,9 @@ static void TEXT_SkipChars (int *new_count, const WCHAR **new_str,
max
-=
n
;
while
(
n
--
)
{
if
(
*
start_str
++
==
PREFIX
&&
max
--
)
if
(
(
*
start_str
==
PREFIX
||
*
start_str
==
ALPHA_PREFIX
)
&&
max
--
)
start_str
++
;
start_str
++
;
}
start_count
-=
(
start_str
-
str_on_entry
);
}
...
...
@@ -507,10 +510,10 @@ static int TEXT_Reprefix (const WCHAR *str, unsigned int ns,
const
ellipsis_data
*
pe
)
{
int
result
=
-
1
;
unsigned
int
i
=
0
;
unsigned
int
i
;
unsigned
int
n
=
pe
->
before
+
pe
->
under
+
pe
->
after
;
assert
(
n
<=
ns
);
while
(
i
<
n
)
for
(
i
=
0
;
i
<
n
;
i
++
,
str
++
)
{
if
(
i
==
pe
->
before
)
{
...
...
@@ -523,16 +526,15 @@ static int TEXT_Reprefix (const WCHAR *str, unsigned int ns,
}
if
(
!
ns
)
break
;
ns
--
;
if
(
*
str
++
==
PREFIX
)
if
(
*
str
==
PREFIX
||
*
str
==
ALPHA_
PREFIX
)
{
str
++
;
if
(
!
ns
)
break
;
if
(
*
str
!=
PREFIX
)
result
=
(
i
<
pe
->
before
||
pe
->
under
==
0
)
?
i
:
i
-
pe
->
under
+
pe
->
len
;
/* pe->len may be non-zero while pe_under is zero */
str
++
;
ns
--
;
}
i
++
;
}
return
result
;
}
...
...
@@ -631,8 +633,13 @@ static const WCHAR *TEXT_NextLineW( HDC hdc, const WCHAR *str, int *count,
(
str
[
i
]
!=
TAB
||
!
(
format
&
DT_EXPANDTABS
))
&&
((
str
[
i
]
!=
CR
&&
str
[
i
]
!=
LF
)
||
(
format
&
DT_SINGLELINE
)))
{
if
(
str
[
i
]
==
PREFIX
&&
!
(
format
&
DT_NOPREFIX
)
&&
*
count
>
1
)
if
((
format
&
DT_NOPREFIX
)
||
*
count
<=
1
)
{
(
*
count
)
--
;
if
(
j
<
maxl
)
dest
[
j
++
]
=
str
[
i
++
];
else
i
++
;
continue
;
}
if
(
str
[
i
]
==
PREFIX
||
str
[
i
]
==
ALPHA_PREFIX
)
{
(
*
count
)
--
,
i
++
;
/* Throw away the prefix itself */
if
(
str
[
i
]
==
PREFIX
)
{
...
...
@@ -648,6 +655,12 @@ static const WCHAR *TEXT_NextLineW( HDC hdc, const WCHAR *str, int *count,
* one.
*/
}
else
if
(
str
[
i
]
==
KANA_PREFIX
)
{
/* Throw away katakana access keys */
(
*
count
)
--
,
i
++
;
/* skip the prefix */
(
*
count
)
--
,
i
++
;
/* skip the letter */
}
else
{
(
*
count
)
--
;
if
(
j
<
maxl
)
dest
[
j
++
]
=
str
[
i
++
];
else
i
++
;
...
...
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