From 3ec85aec75508c9b6c2eded2000c284d09e565bc Mon Sep 17 00:00:00 2001 From: nisheeth Date: Fri, 12 Jun 1998 22:35:50 +0000 Subject: [PATCH] Fix for bug#112027. Reviewed by Dan. The crash was occuring for the case when the MULTICOL tag had no content. Fixed lo_rl_FitMultiColumn() to handle that case. git-svn-id: svn://10.0.0.236/trunk@3740 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/lib/layout/layrelay.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mozilla/lib/layout/layrelay.c b/mozilla/lib/layout/layrelay.c index c96eb040fc8..d29c7f89e5c 100644 --- a/mozilla/lib/layout/layrelay.c +++ b/mozilla/lib/layout/layrelay.c @@ -1306,10 +1306,18 @@ lo_rl_FitMulticolumn( lo_RelayoutState *relay_state, LO_Element *lo_ele ) /* Insert the state->linelist constructed above in between the linefeeds before and after the table. */ - linefeedBeforeTable->next = state->line_list; - state->line_list->lo_any.prev = (LO_Element *) linefeedBeforeTable; - lastElementInLastCell->lo_any.next = (LO_Element *) linefeedAfterTable; - linefeedAfterTable->prev = lastElementInLastCell; + if (state->line_list) { + linefeedBeforeTable->next = state->line_list; + state->line_list->lo_any.prev = (LO_Element *) linefeedBeforeTable; + lastElementInLastCell->lo_any.next = (LO_Element *) linefeedAfterTable; + linefeedAfterTable->prev = lastElementInLastCell; + } + else { + /* This means that the MULTICOL tag did not contain anything. So we just + hook up the linefeeds before and after the table element. */ + linefeedBeforeTable->next = (LO_Element *) linefeedAfterTable; + linefeedAfterTable->prev = (LO_Element *) linefeedBeforeTable; + } /* Set the next layout element to be fitted to the linefeed before the table. This will fit all the elements that were on the cells of the table */