Fixed GetTarget() to use new return codes.

This commit is contained in:
waterson%netscape.com 1999-03-30 03:58:24 +00:00
Родитель 33bca75da4
Коммит 99a0e395db
7 изменённых файлов: 51 добавлений и 0 удалений

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

@ -184,6 +184,9 @@ ContainerCursorImpl::Advance(void)
if (NS_FAILED(rv = mDataSource->GetTarget(mContainer, kRDF_nextVal, PR_TRUE, &nextNode)))
goto done;
if (rv == NS_RDF_NO_VALUE)
goto done;
if (NS_FAILED(rv = nextNode->QueryInterface(kIRDFLiteralIID, (void**) &nextVal)))
goto done;

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

@ -1214,6 +1214,10 @@ RDFXMLDataSourceImpl::SerializeMember(nsIOutputStream* aStream,
if (NS_FAILED(rv = cursor->GetTarget(&node)))
break;
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "null item in cursor");
if (rv == NS_RDF_NO_VALUE)
continue;
// If it's a resource, then output a "<RDF:li resource=... />"
// tag, because we'll be dumping the resource separately. (We
// iterate thru all the resources in the datasource,

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

@ -728,6 +728,9 @@ rdf_ContainerGetNextValue(nsIRDFDataSource* ds,
if (NS_FAILED(rv = ds->GetTarget(container, kRDF_nextVal, PR_TRUE, &nextValNode)))
goto done;
if (rv == NS_RDF_NO_VALUE)
goto done;
if (NS_FAILED(rv = nextValNode->QueryInterface(kIRDFLiteralIID, (void**) &nextValLiteral)))
goto done;
@ -841,6 +844,10 @@ rdf_ContainerRemoveElement(nsIRDFDataSource* aDataSource,
return rv;
}
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "null item in cursor");
if (rv == NS_RDF_NO_VALUE)
continue;
PRBool eq;
if (NS_FAILED(rv = element->EqualsNode(aElement, &eq))) {
NS_ERROR("severe error on equality check");
@ -886,6 +893,10 @@ rdf_ContainerRemoveElement(nsIRDFDataSource* aDataSource,
return rv;
}
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "null value in cursor");
if (rv == NS_RDF_NO_VALUE)
continue;
if (NS_FAILED(rv = elements->GetLabel(getter_AddRefs(ordinal)))) {
NS_ERROR("unable to get element's ordinal index");
return rv;
@ -1032,6 +1043,10 @@ rdf_ContainerInsertElementAt(nsIRDFDataSource* aDataSource,
return rv;
}
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "null value in cursor");
if (rv == NS_RDF_NO_VALUE)
continue;
if (NS_FAILED(rv = aDataSource->Unassert(aContainer, ordinal, element))) {
NS_ERROR("unable to remove element from container");
return rv;
@ -1115,6 +1130,10 @@ rdf_ContainerIndexOf(nsIRDFDataSource* aDataSource,
return rv;
}
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "null value in cursor");
if (rv == NS_RDF_NO_VALUE)
continue;
// Okay, we've found it.
nsCOMPtr<nsIRDFResource> ordinal;
if (NS_FAILED(rv = elements->GetLabel(getter_AddRefs(ordinal)))) {

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

@ -277,6 +277,10 @@ RDFMenuBuilderImpl::AddWidgetItem(nsIContent* aElement,
return rv;
}
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "arc-out with no target: fix your arcs-out cursor!");
if (rv == NS_RDF_NO_VALUE)
continue;
nsCOMPtr<nsIRDFResource> resource;
nsCOMPtr<nsIRDFLiteral> literal;

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

@ -259,6 +259,10 @@ RDFToolbarBuilderImpl::AddWidgetItem(nsIContent* aElement,
return rv;
}
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "arc-out with no target: fix your arcs out cursor");
if (rv == NS_RDF_NO_VALUE)
continue;
nsCOMPtr<nsIRDFResource> resource;
nsCOMPtr<nsIRDFLiteral> literal;

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

@ -593,6 +593,10 @@ RDFTreeBuilderImpl::AddWidgetItem(nsIContent* aElement,
return rv;
}
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "arc-out with no target: fix your arcs-out cursor");
if (rv == NS_RDF_NO_VALUE)
continue;
nsCOMPtr<nsIRDFResource> resource;
nsCOMPtr<nsIRDFLiteral> literal;

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

@ -573,6 +573,10 @@ RDFXULBuilderImpl::CreateContents(nsIContent* aElement)
return rv;
}
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "null value in cursor");
if (rv == NS_RDF_NO_VALUE)
continue;
if (NS_FAILED(AppendChild(aElement, child))) {
NS_ERROR("problem appending child to content model");
return rv;
@ -1446,6 +1450,11 @@ RDFXULBuilderImpl::CreateElement(nsIRDFResource* aResource,
return rv;
}
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "no node type");
if (rv == NS_RDF_NO_VALUE)
return NS_ERROR_UNEXPECTED;
nsCOMPtr<nsIRDFResource> type;
if (NS_FAILED(rv = typeNode->QueryInterface(kIRDFResourceIID, getter_AddRefs(type)))) {
NS_ERROR("type wasn't a resource");
@ -1573,6 +1582,10 @@ RDFXULBuilderImpl::CreateHTMLElement(nsIRDFResource* aResource,
return rv;
}
NS_ASSERTION(rv != NS_RDF_NO_VALUE, "null value in cursor");
if (rv == NS_RDF_NO_VALUE)
continue;
// Add the attribute to the newly constructed element
if (NS_FAILED(rv = AddAttribute(element, property, value))) {
NS_ERROR("unable to add attribute to element");