зеркало из https://github.com/mozilla/pjs.git
Write ArcLabelsIn so it doesn't crash.
This commit is contained in:
Родитель
39a2594cb5
Коммит
aaa2ad6e88
|
@ -349,8 +349,7 @@ NS_IMETHODIMP nsMsgFolderDataSource::HasAssertion(nsIRDFResource* source,
|
||||||
NS_IMETHODIMP nsMsgFolderDataSource::ArcLabelsIn(nsIRDFNode* node,
|
NS_IMETHODIMP nsMsgFolderDataSource::ArcLabelsIn(nsIRDFNode* node,
|
||||||
nsISimpleEnumerator** labels)
|
nsISimpleEnumerator** labels)
|
||||||
{
|
{
|
||||||
PR_ASSERT(0);
|
return nsMsgRDFDataSource::ArcLabelsIn(node, labels);
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsMsgFolderDataSource::ArcLabelsOut(nsIRDFResource* source,
|
NS_IMETHODIMP nsMsgFolderDataSource::ArcLabelsOut(nsIRDFResource* source,
|
||||||
|
|
|
@ -297,8 +297,7 @@ NS_IMETHODIMP nsMsgMessageDataSource::HasAssertion(nsIRDFResource* source,
|
||||||
NS_IMETHODIMP nsMsgMessageDataSource::ArcLabelsIn(nsIRDFNode* node,
|
NS_IMETHODIMP nsMsgMessageDataSource::ArcLabelsIn(nsIRDFNode* node,
|
||||||
nsISimpleEnumerator** labels)
|
nsISimpleEnumerator** labels)
|
||||||
{
|
{
|
||||||
PR_ASSERT(0);
|
return nsMsgRDFDataSource::ArcLabelsIn(node, labels);
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsMsgMessageDataSource::ArcLabelsOut(nsIRDFResource* source,
|
NS_IMETHODIMP nsMsgMessageDataSource::ArcLabelsOut(nsIRDFResource* source,
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "plstr.h"
|
#include "plstr.h"
|
||||||
#include "nsXPIDLString.h"
|
#include "nsXPIDLString.h"
|
||||||
#include "nsMsgRDFUtils.h"
|
#include "nsMsgRDFUtils.h"
|
||||||
|
#include "nsEnumeratorUtils.h"
|
||||||
|
|
||||||
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
||||||
|
|
||||||
|
@ -197,7 +198,23 @@ nsMsgRDFDataSource::RemoveObserver(nsIRDFObserver *aObserver)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsMsgRDFDataSource::ArcLabelsIn(nsIRDFNode *aNode, nsISimpleEnumerator **_retval)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче