Fixed mac and linux uses of Count

git-svn-id: svn://10.0.0.236/trunk@31414 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
warren%netscape.com
1999-05-13 05:28:31 +00:00
parent fe7d7e2e69
commit 241c136c33
2 changed files with 12 additions and 3 deletions

View File

@@ -326,7 +326,10 @@ nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable)
// Walk through flavors and see which flavor matches the one being pasted:
PRUint32 i;
for (i=0;i<dfList->Count();i++) {
PRUint32 cnt = 0;
nsresult rv = dfList->Count(&cnt);
NS_ASSERTION(NS_SUCCEEDED(rv), "Count failed");
for (i=0;i<cnt;i++) {
nsIDataFlavor * df;
nsISupports * supports = dfList->ElementAt(i);
if (NS_OK == supports->QueryInterface(kIDataFlavorIID, (void **)&df)) {

View File

@@ -122,7 +122,10 @@ nsClipboard :: SetNativeClipboardData()
// converter knows about) put it on the clipboard. Luckily, GetTransferData()
// handles conversions for us, so we really don't need to know if a conversion
// is required or not.
for ( int i = 0; i < flavorList->Count(); ++i ) {
PRUint32 cnt = 0;
nsresult rv = flavorList->Count(&cnt);
NS_ASSERTION(NS_SUCCEEDED(rv), "Count failed");
for ( int i = 0; i < cnt; ++i ) {
nsCOMPtr<nsISupports> temp = getter_AddRefs(flavorList->ElementAt(i));
nsCOMPtr<nsIDataFlavor> currentFlavor ( do_QueryInterface(temp) );
if ( currentFlavor ) {
@@ -181,7 +184,10 @@ nsClipboard :: GetNativeClipboardData(nsITransferable * aTransferable)
// Now walk down the list of flavors. When we find one that is actually on the
// clipboard, copy out the data into the transferable in that format. SetTransferData()
// implicitly handles conversions.
for ( int i = 0; i < flavorList->Count(); ++i ) {
PRUint32 cnt = 0;
nsresult rv = flavorList->Count(&cnt);
NS_ASSERTION(NS_SUCCEEDED(rv), "Count failed");
for ( int i = 0; i < cnt; ++i ) {
nsCOMPtr<nsISupports> temp = getter_AddRefs(flavorList->ElementAt(i));
nsCOMPtr<nsIDataFlavor> currentFlavor ( do_QueryInterface(temp) );
if ( currentFlavor ) {