bug 280889 prevent use of uninitialized 'cursor', r/sr=bzbarsky

This commit is contained in:
dveditz%cruzio.com 2005-02-04 00:14:06 +00:00
Родитель ed4add2733
Коммит 3c09601e58
1 изменённых файлов: 2 добавлений и 6 удалений

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

@ -2312,7 +2312,7 @@ nsEventStateManager::UpdateCursor(nsPresContext* aPresContext,
nsEvent* aEvent, nsIFrame* aTargetFrame, nsEvent* aEvent, nsIFrame* aTargetFrame,
nsEventStatus* aStatus) nsEventStatus* aStatus)
{ {
PRInt32 cursor; PRInt32 cursor = NS_STYLE_CURSOR_DEFAULT;
imgIContainer* container = nsnull; imgIContainer* container = nsnull;
//If cursor is locked just use the locked one //If cursor is locked just use the locked one
@ -2326,12 +2326,8 @@ nsEventStateManager::UpdateCursor(nsPresContext* aPresContext,
targetContent = mCurrentTarget->GetContent(); targetContent = mCurrentTarget->GetContent();
} }
//Check if the current target is disabled. If so use the default pointer.
if (targetContent && CheckDisabled(targetContent)) {
cursor = NS_STYLE_CURSOR_DEFAULT;
}
//If not disabled, check for the right cursor. //If not disabled, check for the right cursor.
else { if (!targetContent || !CheckDisabled(targetContent)) {
if (aTargetFrame) { if (aTargetFrame) {
nsIFrame::Cursor framecursor; nsIFrame::Cursor framecursor;
if (NS_FAILED(aTargetFrame->GetCursor(aEvent->point, framecursor))) if (NS_FAILED(aTargetFrame->GetCursor(aEvent->point, framecursor)))