зеркало из https://github.com/mozilla/pjs.git
bug 52464:
Preventing type cast to char which results loss of data. /r=ftang, /sr=scc, /a=blizzard
This commit is contained in:
Родитель
f59075592b
Коммит
b1853852ed
|
@ -245,17 +245,12 @@ nsMenuBarFrame::FindMenuWithShortcut(PRUint32 aLetter)
|
||||||
// See if it's a menu item.
|
// See if it's a menu item.
|
||||||
if (IsValidItem(current)) {
|
if (IsValidItem(current)) {
|
||||||
// Get the shortcut attribute.
|
// Get the shortcut attribute.
|
||||||
nsString shortcutKey;
|
nsAutoString shortcutKey;
|
||||||
current->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey, shortcutKey);
|
current->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey, shortcutKey);
|
||||||
shortcutKey.ToUpperCase();
|
if (!shortcutKey.IsEmpty()) {
|
||||||
if (shortcutKey.Length() > 0) {
|
|
||||||
// We've got something.
|
// We've got something.
|
||||||
char tempChar[2];
|
PRUnichar letter = PRUnichar(aLetter); // throw away the high-zero-fill
|
||||||
tempChar[0] = aLetter;
|
if ( Compare(shortcutKey, nsDependentString(&letter, 1), nsCaseInsensitiveStringComparator())==0 ) {
|
||||||
tempChar[1] = 0;
|
|
||||||
nsAutoString tempChar2; tempChar2.AssignWithConversion(tempChar);
|
|
||||||
|
|
||||||
if (shortcutKey.EqualsIgnoreCase(tempChar2)) {
|
|
||||||
// We match!
|
// We match!
|
||||||
nsCOMPtr<nsIMenuFrame> menuFrame = do_QueryInterface(currFrame);
|
nsCOMPtr<nsIMenuFrame> menuFrame = do_QueryInterface(currFrame);
|
||||||
if (menuFrame)
|
if (menuFrame)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче