Bug 1185589 - Fix unintentional assignment in PuppetWidget::ExecuteNativeKeyBinding. r=masayuki

This commit is contained in:
Birunthan Mohanathas 2015-07-21 10:21:05 -07:00
Родитель 3f6a823a05
Коммит dd92635f4d
1 изменённых файлов: 10 добавлений и 7 удалений

Просмотреть файл

@ -513,25 +513,28 @@ PuppetWidget::ExecuteNativeKeyBinding(NativeKeyBindingsType aType,
#else // #ifdef MOZ_WIDGET_GONK
MOZ_ASSERT(mNativeKeyCommandsValid);
nsTArray<mozilla::CommandInt>& commands = mSingleLineCommands;
const nsTArray<mozilla::CommandInt>* commands = nullptr;
switch (aType) {
case nsIWidget::NativeKeyBindingsForSingleLineEditor:
commands = mSingleLineCommands;
commands = &mSingleLineCommands;
break;
case nsIWidget::NativeKeyBindingsForMultiLineEditor:
commands = mMultiLineCommands;
commands = &mMultiLineCommands;
break;
case nsIWidget::NativeKeyBindingsForRichTextEditor:
commands = mRichTextCommands;
commands = &mRichTextCommands;
break;
default:
MOZ_CRASH("Invalid type");
break;
}
if (commands.IsEmpty()) {
if (commands->IsEmpty()) {
return false;
}
for (uint32_t i = 0; i < commands.Length(); i++) {
aCallback(static_cast<mozilla::Command>(commands[i]), aCallbackData);
for (uint32_t i = 0; i < commands->Length(); i++) {
aCallback(static_cast<mozilla::Command>((*commands)[i]), aCallbackData);
}
return true;
#endif