PRBool hasNegation; rv = datasource->HasAssertion(aSource, aProperty, aTarget, !aTruthValue, &hasNegation); if (NS_FAILED(rv)) return rv;
if (mAllowNegativeAssertions == PR_TRUE) { PRBool hasNegation; rv = datasource->HasAssertion(aSource, aProperty, aTarget, !aTruthValue, &hasNegation); if (NS_FAILED(rv)) return rv;
CompositeDataSourceImpl::HasAssertion(nsIRDFResource* aSource,                                      nsIRDFResource* aProperty,                                      nsIRDFNode* aTarget,                                      PRBool aTruthValue,                                      PRBool* aResult){    NS_PRECONDITION(aSource != nsnull, "null ptr");    if (! aSource)        return NS_ERROR_NULL_POINTER;    NS_PRECONDITION(aProperty != nsnull, "null ptr");    if (! aProperty)        return NS_ERROR_NULL_POINTER;    NS_PRECONDITION(aResult != nsnull, "null ptr");    if (! aResult)        return NS_ERROR_NULL_POINTER;    nsresult rv;    // Otherwise, look through all the data sources to see if anyone    // has the positive...    PRInt32 count = mDataSources.Count();    for (PRInt32 i = 0; i < count; ++i) {        nsIRDFDataSource* datasource = NS_STATIC_CAST(nsIRDFDataSource*, mDataSources[i]);        rv = datasource->HasAssertion(aSource, aProperty, aTarget, aTruthValue, aResult);        if (NS_FAILED(rv)) return rv;        if (*aResult)            return NS_OK;        PRBool hasNegation;        rv = datasource->HasAssertion(aSource, aProperty, aTarget, !aTruthValue, &hasNegation);        if (NS_FAILED(rv)) return rv;        if (hasNegation) {            *aResult = PR_FALSE;            return NS_OK;        }    }    // If we get here, nobody had the assertion at all    *aResult = PR_FALSE;    return NS_OK;}