Write ArcLabelsIn so it doesn't crash.

This commit is contained in:
putterman%netscape.com 1999-07-20 05:45:42 +00:00
parent 0708ffd2ac
commit 7f795cdaad
3 changed files with 20 additions and 5 deletions

View File

@ -349,8 +349,7 @@ NS_IMETHODIMP nsMsgFolderDataSource::HasAssertion(nsIRDFResource* source,
NS_IMETHODIMP nsMsgFolderDataSource::ArcLabelsIn(nsIRDFNode* node,
nsISimpleEnumerator** labels)
{
PR_ASSERT(0);
return NS_ERROR_NOT_IMPLEMENTED;
return nsMsgRDFDataSource::ArcLabelsIn(node, labels);
}
NS_IMETHODIMP nsMsgFolderDataSource::ArcLabelsOut(nsIRDFResource* source,

View File

@ -297,8 +297,7 @@ NS_IMETHODIMP nsMsgMessageDataSource::HasAssertion(nsIRDFResource* source,
NS_IMETHODIMP nsMsgMessageDataSource::ArcLabelsIn(nsIRDFNode* node,
nsISimpleEnumerator** labels)
{
PR_ASSERT(0);
return NS_ERROR_NOT_IMPLEMENTED;
return nsMsgRDFDataSource::ArcLabelsIn(node, labels);
}
NS_IMETHODIMP nsMsgMessageDataSource::ArcLabelsOut(nsIRDFResource* source,

View File

@ -22,6 +22,7 @@
#include "plstr.h"
#include "nsXPIDLString.h"
#include "nsMsgRDFUtils.h"
#include "nsEnumeratorUtils.h"
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
@ -197,7 +198,23 @@ nsMsgRDFDataSource::RemoveObserver(nsIRDFObserver *aObserver)
NS_IMETHODIMP
nsMsgRDFDataSource::ArcLabelsIn(nsIRDFNode *aNode, nsISimpleEnumerator **_retval)
{
return NS_RDF_NO_VALUE;
//return empty enumerator
nsCOMPtr<nsISupportsArray> arcs;
nsresult rv = NS_NewISupportsArray(getter_AddRefs(arcs));
if(NS_FAILED(rv))
return rv;
nsArrayEnumerator* arrayEnumerator =
new nsArrayEnumerator(arcs);
if (arrayEnumerator == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(arrayEnumerator);
*_retval = arrayEnumerator;
return NS_OK;
}