NS_IF_RELEASE(mCurrentRow); nsresult rv = mRowCursor->NextRow(mDB->GetEnv(), &mCurrentRow, &mRowPos); if (mCurrentRow && NS_SUCCEEDED(rv)) { mdbOid rowOid;  if (mCurrentRow->GetOid(mDB->GetEnv(), &rowOid) == NS_OK) { if (mDB->IsListRowScopeToken(rowOid.mOid_Scope)) { mCurrentRowIsList = PR_TRUE; return NS_OK; } else if (mDB->IsCardRowScopeToken(rowOid.mOid_Scope)) { mCurrentRowIsList = PR_FALSE; return NS_OK; } else if (mDB->IsDataRowScopeToken(rowOid.mOid_Scope)) { return Next(); } else return NS_ERROR_FAILURE; } } else if (!mCurrentRow) { mDone = PR_TRUE; return NS_ERROR_NULL_POINTER; } else if (NS_FAILED(rv)) { mDone = PR_TRUE; return NS_ERROR_FAILURE; } return NS_ERROR_FAILURE;
NS_IMETHODIMP nsAddrDBEnumerator::Next(void){    if (!mRowCursor)    {        mDone = PR_TRUE;        return NS_ERROR_FAILURE;    }        NS_IF_RELEASE(mCurrentRow);    nsresult rv = mRowCursor->NextRow(mDB->GetEnv(), &mCurrentRow, &mRowPos);    if (mCurrentRow && NS_SUCCEEDED(rv))    {        mdbOid rowOid;        if (mCurrentRow->GetOid(mDB->GetEnv(), &rowOid) == NS_OK)        {            if (mDB->IsListRowScopeToken(rowOid.mOid_Scope))            {                mCurrentRowIsList = PR_TRUE;                return NS_OK;            }            else if (mDB->IsCardRowScopeToken(rowOid.mOid_Scope))            {                mCurrentRowIsList = PR_FALSE;                return NS_OK;            }            else if (mDB->IsDataRowScopeToken(rowOid.mOid_Scope))            {                return Next();            }            else                return NS_ERROR_FAILURE;        }    }    else if (!mCurrentRow)     {        mDone = PR_TRUE;        return NS_ERROR_NULL_POINTER;    }    else if (NS_FAILED(rv)) {        mDone = PR_TRUE;        return NS_ERROR_FAILURE;    }    return NS_ERROR_FAILURE;}