Write ArcLabelsIn so it doesn't crash.

This commit is contained in:
putterman%netscape.com 1999-07-20 05:45:42 +00:00
Родитель 39a2594cb5
Коммит aaa2ad6e88
3 изменённых файлов: 20 добавлений и 5 удалений

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

@ -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,

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

@ -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,

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

@ -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;
}