Initialize the result value in nsViewManager::SetFrameRate b=32381 r=rods@netscape.com

git-svn-id: svn://10.0.0.236/trunk@63620 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kmcclusk%netscape.com 2000-03-21 21:47:50 +00:00
parent 2816ad1409
commit e92c7a3168
2 changed files with 10 additions and 16 deletions

View File

@ -347,7 +347,7 @@ NS_IMETHODIMP nsViewManager :: GetFrameRate(PRUint32 &aRate)
NS_IMETHODIMP nsViewManager :: SetFrameRate(PRUint32 aFrameRate)
{
nsresult rv;
nsresult rv = NS_OK;
if (aFrameRate != mFrameRate)
{
@ -372,11 +372,7 @@ NS_IMETHODIMP nsViewManager :: SetFrameRate(PRUint32 aFrameRate)
mTimer->Init(vm_timer_callback, this, 1000 / mFrameRate);
#endif
}
else
rv = NS_OK;
}
else
rv = NS_OK;
return rv;
}

View File

@ -347,35 +347,33 @@ NS_IMETHODIMP nsViewManager2::GetFrameRate(PRUint32 &aRate)
NS_IMETHODIMP nsViewManager2::SetFrameRate(PRUint32 aFrameRate)
{
nsresult rv;
nsresult rv = NS_OK;
if (aFrameRate != mFrameRate)
{
{
#ifdef NS_VIEWMANAGER_NEEDS_TIMER
if (nsnull != mTimer)
{
{
mTimer->Cancel(); //XXX this should not be necessary. MMP
NS_RELEASE(mTimer);
}
}
#endif
mFrameRate = aFrameRate;
mTrueFrameRate = aFrameRate;
if (mFrameRate != 0)
{
{
#ifdef NS_VIEWMANAGER_NEEDS_TIMER
rv = NS_NewTimer(&mTimer);
if (NS_OK == rv)
mTimer->Init(vm_timer_callback, this, 1000 / mFrameRate);
#endif
}
else
rv = NS_OK;
}
else
rv = NS_OK;
}
}
return rv;
}