Added ASSERTION and run-time check for SpaceManager before dereferencing it. r=rods,pierre

This commit is contained in:
attinasi@netscape.com
2000-01-18 15:36:36 +00:00
parent e99ccbb14c
commit d9e7126009
6 changed files with 54 additions and 30 deletions

View File

@@ -580,6 +580,8 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
mLineNumber(0),
mNeedResizeReflow(PR_FALSE)
{
const nsMargin& borderPadding = BorderPadding();
if (aBlockMarginRoot) {
mIsTopMarginRoot = PR_TRUE;
mIsBottomMarginRoot = PR_TRUE;
@@ -596,11 +598,13 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
mSpaceManager = aReflowState.mSpaceManager;
// Translate into our content area and then save the
// coordinate system origin for later.
const nsMargin& borderPadding = BorderPadding();
mSpaceManager->Translate(borderPadding.left, borderPadding.top);
mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY);
NS_ASSERTION( nsnull != mSpaceManager, "SpaceManager should be set in nsBlockReflowState" );
if( nsnull != mSpaceManager ) {
// Translate into our content area and then save the
// coordinate system origin for later.
mSpaceManager->Translate(borderPadding.left, borderPadding.top);
mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY);
}
mReflowStatus = NS_FRAME_COMPLETE;