From 7828a4605aaaf834d1dba94e9d736e78a6704682 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Mon, 10 Jan 2000 05:14:47 +0000 Subject: [PATCH] Fixed a problem with code that determined whether this was a beginning line. It wasn't correctly handling the very first line in the block git-svn-id: svn://10.0.0.236/trunk@57259 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsBlockFrame.cpp | 3 ++- mozilla/layout/generic/nsBlockReflowState.cpp | 3 ++- mozilla/layout/generic/nsBlockReflowState.h | 3 ++- mozilla/layout/html/base/src/nsBlockFrame.cpp | 3 ++- mozilla/layout/html/base/src/nsBlockReflowState.cpp | 3 ++- mozilla/layout/html/base/src/nsBlockReflowState.h | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 1e3e90ac521..6b9321b2817 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -2780,7 +2780,8 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, // XXX This approach doesn't work when floaters are involved in which case // we'll either need to recover the floater state that applies to the // unconstrained reflow or keep it around in a separate space manager... - if (aState.mComputeMaximumWidth && aState.mPrevLine && !aState.mPrevLine->IsLineWrapped()) { + PRBool isBeginningLine = !aState.mPrevLine || !aState.mPrevLine->IsLineWrapped(); + if (aState.mComputeMaximumWidth && isBeginningLine) { nscoord oldY = aState.mY; nscoord oldPrevBottomMargin = aState.mPrevBottomMargin; diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index 1e3e90ac521..6b9321b2817 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -2780,7 +2780,8 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, // XXX This approach doesn't work when floaters are involved in which case // we'll either need to recover the floater state that applies to the // unconstrained reflow or keep it around in a separate space manager... - if (aState.mComputeMaximumWidth && aState.mPrevLine && !aState.mPrevLine->IsLineWrapped()) { + PRBool isBeginningLine = !aState.mPrevLine || !aState.mPrevLine->IsLineWrapped(); + if (aState.mComputeMaximumWidth && isBeginningLine) { nscoord oldY = aState.mY; nscoord oldPrevBottomMargin = aState.mPrevBottomMargin; diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index 1e3e90ac521..6b9321b2817 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -2780,7 +2780,8 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, // XXX This approach doesn't work when floaters are involved in which case // we'll either need to recover the floater state that applies to the // unconstrained reflow or keep it around in a separate space manager... - if (aState.mComputeMaximumWidth && aState.mPrevLine && !aState.mPrevLine->IsLineWrapped()) { + PRBool isBeginningLine = !aState.mPrevLine || !aState.mPrevLine->IsLineWrapped(); + if (aState.mComputeMaximumWidth && isBeginningLine) { nscoord oldY = aState.mY; nscoord oldPrevBottomMargin = aState.mPrevBottomMargin; diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 1e3e90ac521..6b9321b2817 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -2780,7 +2780,8 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, // XXX This approach doesn't work when floaters are involved in which case // we'll either need to recover the floater state that applies to the // unconstrained reflow or keep it around in a separate space manager... - if (aState.mComputeMaximumWidth && aState.mPrevLine && !aState.mPrevLine->IsLineWrapped()) { + PRBool isBeginningLine = !aState.mPrevLine || !aState.mPrevLine->IsLineWrapped(); + if (aState.mComputeMaximumWidth && isBeginningLine) { nscoord oldY = aState.mY; nscoord oldPrevBottomMargin = aState.mPrevBottomMargin; diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index 1e3e90ac521..6b9321b2817 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -2780,7 +2780,8 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, // XXX This approach doesn't work when floaters are involved in which case // we'll either need to recover the floater state that applies to the // unconstrained reflow or keep it around in a separate space manager... - if (aState.mComputeMaximumWidth && aState.mPrevLine && !aState.mPrevLine->IsLineWrapped()) { + PRBool isBeginningLine = !aState.mPrevLine || !aState.mPrevLine->IsLineWrapped(); + if (aState.mComputeMaximumWidth && isBeginningLine) { nscoord oldY = aState.mY; nscoord oldPrevBottomMargin = aState.mPrevBottomMargin; diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index 1e3e90ac521..6b9321b2817 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -2780,7 +2780,8 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, // XXX This approach doesn't work when floaters are involved in which case // we'll either need to recover the floater state that applies to the // unconstrained reflow or keep it around in a separate space manager... - if (aState.mComputeMaximumWidth && aState.mPrevLine && !aState.mPrevLine->IsLineWrapped()) { + PRBool isBeginningLine = !aState.mPrevLine || !aState.mPrevLine->IsLineWrapped(); + if (aState.mComputeMaximumWidth && isBeginningLine) { nscoord oldY = aState.mY; nscoord oldPrevBottomMargin = aState.mPrevBottomMargin;