fix problem in popup permissions enumerator. r=danm,sr=jag,a=asa

This commit is contained in:
shliang%netscape.com 2003-01-27 23:42:51 +00:00
Родитель c722ff3c6a
Коммит 7f339d0b96
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -65,14 +65,14 @@ class nsPopupEnumerator : public nsISimpleEnumerator
NS_DECL_ISUPPORTS
nsPopupEnumerator() : mHostCurrent(0), mTypeCurrent(0)
nsPopupEnumerator() : mHostCurrent(0), mTypeCurrent(0), mHostsFound(0)
{
mHostCount = PERMISSION_HostCountForType(WINDOWPERMISSION);
}
NS_IMETHOD HasMoreElements(PRBool *result)
{
*result = mHostCount > mHostCurrent;
*result = mHostCount > mHostsFound;
return NS_OK;
}
@ -93,6 +93,7 @@ class nsPopupEnumerator : public nsISimpleEnumerator
nsIPermission *permission = new nsPermission(host, type, capability);
*result = permission;
NS_ADDREF(*result);
mHostsFound++;
break;
}
}
@ -107,6 +108,7 @@ class nsPopupEnumerator : public nsISimpleEnumerator
PRInt32 mHostCurrent;
PRInt32 mTypeCurrent;
PRInt32 mHostCount;
PRInt32 mHostsFound;
};
NS_IMPL_ISUPPORTS1(nsPopupEnumerator, nsISimpleEnumerator);