fix bug 16656, change the test condiction for NS_PRECONDICTION. also add some error checking code for null ptr. r=erik

This commit is contained in:
ftang%netscape.com 1999-10-18 22:17:16 +00:00
parent fc23fb1269
commit 51000b5618

View File

@ -374,8 +374,14 @@ NS_IMETHODIMP nsJISx4501LineBreaker::Next(
NS_PRECONDITION( nsnull != aText, "null ptr");
if(nsnull == aText)
return NS_ERROR_NULL_POINTER;
NS_PRECONDITION( nsnull != oNext, "null ptr");
if(nsnull == oNext)
return NS_ERROR_NULL_POINTER;
NS_PRECONDITION( nsnull != oNeedMoreText, "null ptr");
if(nsnull == oNeedMoreText)
return NS_ERROR_NULL_POINTER;
NS_PRECONDITION( aPos < aLen, "aPos >= aLen");
NS_PRECONDITION( aPos <= aLen, "aPos > aLen");
if( aPos > aLen )
return NS_ERROR_ILLEGAL_VALUE;
@ -434,6 +440,12 @@ NS_IMETHODIMP nsJISx4501LineBreaker::Prev(
NS_PRECONDITION( nsnull != aText, "null ptr");
if(nsnull == aText)
return NS_ERROR_NULL_POINTER;
NS_PRECONDITION( nsnull != oPrev, "null ptr");
if(nsnull == oPrev)
return NS_ERROR_NULL_POINTER;
NS_PRECONDITION( nsnull != oNeedMoreText, "null ptr");
if(nsnull == oNeedMoreText)
return NS_ERROR_NULL_POINTER;
if(aPos < 2)
{