This commit is contained in:
saari%netscape.com 1999-05-11 18:21:39 +00:00
Родитель f967d83d2e
Коммит 789be39b20
1 изменённых файлов: 8 добавлений и 3 удалений

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

@ -240,8 +240,11 @@ NS_METHOD nsMenu::AddMenu(nsIMenu * aMenu)
nsresult rv = nsComponentManager::CreateInstance(
kMenuItemCID, nsnull, kIMenuItemIID, (void**)&pnsMenuItem);
if (NS_OK == rv) {
pnsMenuItem->Create(this, labelStr, PR_FALSE); //PR_TRUE);
nsISupports * supports = nsnull;
QueryInterface(kISupportsIID, (void**) &supports);
pnsMenuItem->Create(supports, labelStr, PR_FALSE); //PR_TRUE);
NS_RELEASE(supports);
pnsMenuItem->QueryInterface(kISupportsIID, (void**) &supports);
AddItem(supports); // Parent should now own menu item
NS_RELEASE(supports);
@ -272,9 +275,11 @@ NS_METHOD nsMenu::AddSeparator()
kMenuItemCID, nsnull, kIMenuItemIID, (void**)&pnsMenuItem);
if (NS_OK == rv) {
nsString tmp = "separator";
pnsMenuItem->Create(this, tmp, PR_TRUE);
nsISupports * supports = nsnull;
QueryInterface(kISupportsIID, (void**) &supports);
pnsMenuItem->Create(supports, tmp, PR_TRUE);
NS_RELEASE(supports);
pnsMenuItem->QueryInterface(kISupportsIID, (void**) &supports);
AddItem(supports); // Parent should now own menu item
NS_RELEASE(supports);