mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-19 09:30:44 +00:00
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:
parent
fc23fb1269
commit
51000b5618
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user