120838 - fix most of the 'theme switching doesn't work from prefs' bugs. r=ben sr=hewitt

git-svn-id: svn://10.0.0.236/trunk@114821 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blakeross%telocity.com
2002-02-18 22:58:54 +00:00
parent 057eaef9e2
commit 3f8e7b6069
2 changed files with 18 additions and 16 deletions

View File

@@ -1862,7 +1862,6 @@ NS_IMETHODIMP nsChromeRegistry::IsProviderSelected(const nsCString& aProvider,
resourceStr += aProvider;
resourceStr += ":";
resourceStr.AppendWithConversion(aProviderName);
// Obtain the provider resource.
nsresult rv = NS_OK;
nsCOMPtr<nsIRDFResource> resource;
@@ -1896,6 +1895,8 @@ NS_IMETHODIMP nsChromeRegistry::IsProviderSelected(const nsCString& aProvider,
// For each skin/package entry, follow the arcs to the real package
// resource.
PRBool more;
PRInt32 numSet = 0;
PRInt32 numPackages = 0;
rv = arcs->HasMoreElements(&more);
if (NS_FAILED(rv)) return rv;
while (more) {
@@ -1921,19 +1922,19 @@ NS_IMETHODIMP nsChromeRegistry::IsProviderSelected(const nsCString& aProvider,
NS_ERROR("Unable to set provider for package resource.");
return rv;
}
if (isSet && !*aResult)
*aResult = FULL;
else if (!isSet && *aResult) {
*aResult = PARTIAL;
return NS_OK;
}
++numPackages;
if (isSet)
++numSet;
}
}
}
rv = arcs->HasMoreElements(&more);
if (NS_FAILED(rv)) return rv;
}
if (numPackages == numSet)
*aResult = FULL;
else if (numSet)
*aResult = PARTIAL;
return NS_OK;
}

View File

@@ -1862,7 +1862,6 @@ NS_IMETHODIMP nsChromeRegistry::IsProviderSelected(const nsCString& aProvider,
resourceStr += aProvider;
resourceStr += ":";
resourceStr.AppendWithConversion(aProviderName);
// Obtain the provider resource.
nsresult rv = NS_OK;
nsCOMPtr<nsIRDFResource> resource;
@@ -1896,6 +1895,8 @@ NS_IMETHODIMP nsChromeRegistry::IsProviderSelected(const nsCString& aProvider,
// For each skin/package entry, follow the arcs to the real package
// resource.
PRBool more;
PRInt32 numSet = 0;
PRInt32 numPackages = 0;
rv = arcs->HasMoreElements(&more);
if (NS_FAILED(rv)) return rv;
while (more) {
@@ -1921,19 +1922,19 @@ NS_IMETHODIMP nsChromeRegistry::IsProviderSelected(const nsCString& aProvider,
NS_ERROR("Unable to set provider for package resource.");
return rv;
}
if (isSet && !*aResult)
*aResult = FULL;
else if (!isSet && *aResult) {
*aResult = PARTIAL;
return NS_OK;
}
++numPackages;
if (isSet)
++numSet;
}
}
}
rv = arcs->HasMoreElements(&more);
if (NS_FAILED(rv)) return rv;
}
if (numPackages == numSet)
*aResult = FULL;
else if (numSet)
*aResult = PARTIAL;
return NS_OK;
}