This commit is contained in:
warren%netscape.com 1999-03-05 06:12:47 +00:00
Родитель f3d5314c50
Коммит 7483c69105
1 изменённых файлов: 16 добавлений и 10 удалений

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

@ -39,12 +39,15 @@ NS_IMPL_ISUPPORTS_INHERITED(nsRDFArrayCursor,
NS_IMETHODIMP nsRDFArrayCursor::Advance(void)
{
if (mStarted) {
nsresult rv = Next();
if (NS_SUCCEEDED(rv)) return rv;
return NS_ERROR_RDF_CURSOR_EMPTY;
if (!mStarted) {
mStarted = PR_TRUE;
nsresult rv = First();
if (NS_FAILED(rv)) return NS_ERROR_RDF_CURSOR_EMPTY;
}
else {
nsresult rv = Next();
if (NS_FAILED(rv)) return NS_ERROR_RDF_CURSOR_EMPTY;
}
mStarted = PR_TRUE;
return IsDone() == NS_OK ? NS_ERROR_RDF_CURSOR_EMPTY : NS_OK;
}
@ -294,12 +297,15 @@ nsRDFEnumeratorCursor::QueryInterface(REFNSIID iid, void** result)
NS_IMETHODIMP nsRDFEnumeratorCursor::Advance(void)
{
if (mStarted) {
nsresult rv = mEnum->Next();
if (NS_SUCCEEDED(rv)) return rv;
return NS_ERROR_RDF_CURSOR_EMPTY;
if (!mStarted) {
mStarted = PR_TRUE;
nsresult rv = mEnum->First();
if (NS_FAILED(rv)) return NS_ERROR_RDF_CURSOR_EMPTY;
}
else {
nsresult rv = mEnum->Next();
if (NS_FAILED(rv)) return NS_ERROR_RDF_CURSOR_EMPTY;
}
mStarted = PR_TRUE;
return mEnum->IsDone() == NS_OK ? NS_ERROR_RDF_CURSOR_EMPTY : NS_OK;
}