From f178395e66ccd88ae97e70457c740b6b1c603fa3 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 20 Feb 2006 19:01:22 +0000 Subject: [PATCH] More bogus XUL assumptions about what is or is not a box... Bug 325132, r=neil, sr=bryner --- layout/xul/base/src/nsSplitterFrame.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/layout/xul/base/src/nsSplitterFrame.cpp b/layout/xul/base/src/nsSplitterFrame.cpp index c0b9ce8953e..4dc4543255a 100644 --- a/layout/xul/base/src/nsSplitterFrame.cpp +++ b/layout/xul/base/src/nsSplitterFrame.cpp @@ -697,13 +697,19 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent) mDidDrag = PR_FALSE; mOuter->GetParentBox(&mParentBox); - - // get our index - nscoord childIndex = nsFrameNavigator::IndexOf(outerPresContext, mParentBox, mOuter); - PRInt32 childCount = nsFrameNavigator::CountFrames(outerPresContext, mParentBox); - // if its 0 or the last index then stop right here. - if (childIndex == 0 || childIndex == childCount-1) { + + PRInt32 childIndex, childCount; + if (mParentBox) { + // get our index + childIndex = + nsFrameNavigator::IndexOf(outerPresContext, mParentBox, mOuter); + childCount = nsFrameNavigator::CountFrames(outerPresContext, mParentBox); + } + + // if we have no parent box or the index is 0 or the last index then + // stop right here. + if (!mParentBox || childIndex == 0 || childIndex == childCount-1) { mPressed = PR_FALSE; return NS_OK; }