mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
change char detection to use unichar and upper case so now pressing 't' or 'T'
gets you the first item that begin with 't' ot 'T' Bug 34630
This commit is contained in:
parent
ad2f705153
commit
1e83686bb3
@ -3332,10 +3332,10 @@ nsListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
|
||||
if (optionElement) {
|
||||
nsAutoString text;
|
||||
if (NS_OK == optionElement->GetText(text)) {
|
||||
char * buf = text.ToNewCString();
|
||||
char c = buf[0];
|
||||
delete [] buf;
|
||||
if (c == (char)code) {
|
||||
text.ToUpperCase();
|
||||
PRUnichar firstChar = text.CharAt(0);
|
||||
printf("[%d][%d]\n", firstChar, (PRUnichar)code);
|
||||
if (firstChar == (PRUnichar)code) {
|
||||
mOldSelectedIndex = mSelectedIndex;
|
||||
mSelectedIndex = selectedIndex;
|
||||
SingleSelection();
|
||||
|
@ -3507,10 +3507,9 @@ nsGfxListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
|
||||
if (optionElement) {
|
||||
nsAutoString text;
|
||||
if (NS_OK == optionElement->GetText(text)) {
|
||||
char * buf = text.ToNewCString();
|
||||
char c = buf[0];
|
||||
delete [] buf;
|
||||
if (c == (char)code) {
|
||||
text.ToUpperCase();
|
||||
PRUnichar firstChar = text.CharAt(0);
|
||||
if (firstChar == (PRUnichar)code) {
|
||||
mOldSelectedIndex = mSelectedIndex;
|
||||
mSelectedIndex = selectedIndex;
|
||||
SingleSelection();
|
||||
|
@ -3332,10 +3332,10 @@ nsListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
|
||||
if (optionElement) {
|
||||
nsAutoString text;
|
||||
if (NS_OK == optionElement->GetText(text)) {
|
||||
char * buf = text.ToNewCString();
|
||||
char c = buf[0];
|
||||
delete [] buf;
|
||||
if (c == (char)code) {
|
||||
text.ToUpperCase();
|
||||
PRUnichar firstChar = text.CharAt(0);
|
||||
printf("[%d][%d]\n", firstChar, (PRUnichar)code);
|
||||
if (firstChar == (PRUnichar)code) {
|
||||
mOldSelectedIndex = mSelectedIndex;
|
||||
mSelectedIndex = selectedIndex;
|
||||
SingleSelection();
|
||||
|
Loading…
Reference in New Issue
Block a user