Fix for printing crash when bulleted items have no bullet and we assume they do. Added assertion to help find the cause of the problem, and checks for null to prevent the crash. b=70730 r=dcone sr=waterson

This commit is contained in:
attinasi@netscape.com
2001-03-07 00:38:45 +00:00
parent 9b73ac9193
commit fa42e93e4f
8 changed files with 28 additions and 24 deletions

View File

@@ -1223,7 +1223,7 @@ nsBlockFrame::Destroy(nsIPresContext* aPresContext)
mAbsoluteContainer.DestroyFrames(this, aPresContext);
// Outside bullets are not in our child-list so check for them here
// and delete them when present.
if (HaveOutsideBullet()) {
if (mBullet) {
mBullet->Destroy(aPresContext);
mBullet = nsnull;
}
@@ -2480,7 +2480,7 @@ nsBlockFrame::UpdateBulletPosition(nsBlockReflowState& aState)
const nsStyleList* styleList;
GetStyleData(eStyleStruct_List, (const nsStyleStruct*&) styleList);
if (NS_STYLE_LIST_STYLE_POSITION_INSIDE == styleList->mListStylePosition) {
if (HaveOutsideBullet()) {
if (mBullet && HaveOutsideBullet()) {
// We now have an inside bullet, but used to have an outside
// bullet. Adjust the frame line list
nsLineBox* line = aState.NewLineBox(mBullet, 1, PR_FALSE);
@@ -4061,7 +4061,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
// rare case: an empty first line followed by a second line that
// contains a block (example: <LI>\n<P>... ). This is where
// the second case can happen.
if (HaveOutsideBullet() &&
if (mBullet && HaveOutsideBullet() &&
((aLine == mLines) ||
((0 == mLines->mBounds.height) && (aLine == mLines->mNext)))) {
// Reflow the bullet
@@ -4683,7 +4683,7 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
// case is happening then the worst that will happen is that the
// bullet frame will be reflowed twice.
PRBool addedBullet = PR_FALSE;
if (HaveOutsideBullet() && (aLine == mLines) &&
if (mBullet && HaveOutsideBullet() && (aLine == mLines) &&
(!aLineLayout.IsZeroHeight() || !aLine->mNext)) {
nsHTMLReflowMetrics metrics(nsnull);
ReflowBullet(aState, metrics);