From 06fa5cb7c76ed3a5548fafa3cc5dab4875f7211c Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Wed, 4 Feb 2004 00:46:14 +0000 Subject: [PATCH] Fix for loop scoping bustage. --- view/src/nsViewManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/view/src/nsViewManager.cpp b/view/src/nsViewManager.cpp index 5041f5d2303..33f1dac4dbc 100644 --- a/view/src/nsViewManager.cpp +++ b/view/src/nsViewManager.cpp @@ -1972,7 +1972,8 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *aS offset.x = offset.y = 0; //Get offset from root of baseView - for (nsView *parent = baseView; parent != mRootView; + nsView *parent; + for (parent = baseView; parent != mRootView; parent = parent->GetParent()) parent->ConvertToParentCoords(&offset.x, &offset.y); @@ -1986,7 +1987,7 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *aS } //Subtract back offset from root of view - for (nsView *parent = view; parent != mRootView; + for (parent = view; parent != mRootView; parent = parent->GetParent()) parent->ConvertFromParentCoords(&offset.x, &offset.y);