Commit 59b11139 authored by mitz@apple.com's avatar mitz@apple.com

Allow pop-up menus to contain multiple items that have the same title.

Reviewed by Anders Carlsson.

* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::populate): Set the item’s title after adding it rather than
when adding it, so that it will not replace any existing item with the same title.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4cdc9803
2011-01-27 Dan Bernstein <mitz@apple.com>
Reviewed by Anders Carlsson.
Allow pop-up menus to contain multiple items that have the same title.
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::populate): Set the item’s title after adding it rather than
when adding it, so that it will not replace any existing item with the same title.
2011-01-27 Andreas Kling <kling@webkit.org>
Reviewed by Kenneth Rohde Christiansen.
......@@ -63,8 +63,9 @@ void WebPopupMenuProxyMac::populate(const Vector<WebPopupItem>& items)
if (items[i].m_type == WebPopupItem::Seperator)
[[m_popup.get() menu] addItem:[NSMenuItem separatorItem]];
else {
[m_popup.get() addItemWithTitle:nsStringFromWebCoreString(items[i].m_text)];
[m_popup.get() addItemWithTitle:@""];
NSMenuItem* menuItem = [m_popup.get() lastItem];
[menuItem setTitle:nsStringFromWebCoreString(items[i].m_text)];
[menuItem setEnabled:items[i].m_isEnabled];
[menuItem setToolTip:nsStringFromWebCoreString(items[i].m_toolTip)];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment