summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp')
-rw-r--r--Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp b/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp
index 648394b6f..2f92098ca 100644
--- a/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp
+++ b/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp
@@ -186,12 +186,15 @@ void PopupMenuItemModel::select(int index)
if (!item.enabled)
return;
- Item& oldItem = m_items[oldIndex];
- oldItem.selected = false;
item.selected = true;
m_selectedModelIndex = index;
- emit dataChanged(this->index(oldIndex), this->index(oldIndex));
+ if (oldIndex != -1) {
+ Item& oldItem = m_items[oldIndex];
+ oldItem.selected = false;
+ emit dataChanged(this->index(oldIndex), this->index(oldIndex));
+ }
+
emit dataChanged(this->index(index), this->index(index));
}