void gml_lp( const gmltag * entry ) { char * p; su * list_skip_su; su * lp_skip_su; su * pre_skip_su; scan_err = false; p = scan_start; if( nest_cb == NULL ) { xx_nest_err( err_li_lp_no_list ); // tag must be in a list scan_start = scan_stop + 1; return; } list_skip_su = &nest_cb->xl_pre_skip; // nest_cb on entry, not LP nest_cb lp_skip_su = &layout_work.lp.pre_skip; gml_xl_lp_common( t_LP ); if( g_line_indent == 0 ) { ProcFlags.para_starting = false; // clear for this tag's first break } scr_process_break(); nest_cb->compact = false; nest_cb->li_number = 0; nest_cb->left_indent = conv_hor_unit( &layout_work.lp.left_indent, g_curr_font ); nest_cb->right_indent = -1 * conv_hor_unit( &layout_work.lp.right_indent, g_curr_font ); nest_cb->lay_tag = &layout_work.lp; nest_cb->lm = nest_cb->prev->lm + nest_cb->prev->left_indent; nest_cb->rm = nest_cb->prev->rm + nest_cb->prev->right_indent; spacing = (int8_t) layout_work.lp.spacing; ProcFlags.keep_left_margin = true; // keep special Note indent post_space = 0; if( ProcFlags.need_li_lp ) { // :LP first tag in list pre_skip_su = greater_su( lp_skip_su, list_skip_su, spacing ); } else { pre_skip_su = lp_skip_su; } set_skip_vars( pre_skip_su, NULL, &layout_work.lp.post_skip, 1, g_curr_font ); g_cur_left = nest_cb->lm + nest_cb->left_indent;// left start // possibly indent first line g_line_indent = conv_hor_unit( &(layout_work.lp.line_indent), g_curr_font ); g_cur_h_start = g_cur_left + g_line_indent; g_page_right = nest_cb->rm + nest_cb->right_indent; nest_cb->left_indent += nest_cb->prev->left_indent; nest_cb->right_indent += nest_cb->prev->right_indent; ju_x_start = g_cur_h_start; ProcFlags.need_li_lp = false; // :LI or :LP seen ProcFlags.para_starting = true; // for next break, not this tag's break if( *p == '.' ) p++; // possible tag end while( *p == ' ' ) p++; // skip initial spaces if( *p ) { process_text( p, g_curr_font ); // if text follows } scan_start = scan_stop + 1; return; }
void gml_lp( const gmltag * entry ) { char * p; su * list_skip_su; su * lp_skip_su; su * pre_skip_su; scan_err = false; p = scan_start; if( nest_cb == NULL ) { xx_nest_err( err_li_lp_no_list ); // tag must be in a list scan_start = scan_stop + 1; return; } switch( nest_cb->c_tag ) { case t_OL : list_skip_su = &((ol_lay_tag *)(nest_cb->lay_tag))->pre_skip; break; case t_SL : list_skip_su = &((sl_lay_tag *)(nest_cb->lay_tag))->pre_skip; break; case t_UL : list_skip_su = &((ul_lay_tag *)(nest_cb->lay_tag))->pre_skip; break; case t_DL : // TBD list_skip_su = &((dl_lay_tag *)(nest_cb->lay_tag))->pre_skip; break; case t_GL : // TBD list_skip_su = &((gl_lay_tag *)(nest_cb->lay_tag))->pre_skip; break; default: break; } lp_skip_su = &layout_work.lp.pre_skip; gml_xl_lp_common( entry, t_LP ); nest_cb->compact = false; nest_cb->li_number = 0; nest_cb->left_indent = conv_hor_unit( &layout_work.lp.left_indent ); nest_cb->right_indent = conv_hor_unit( &layout_work.lp.right_indent ); nest_cb->lay_tag = &layout_work.lp; nest_cb->lm = nest_cb->prev->lm + nest_cb->prev->left_indent; nest_cb->rm = nest_cb->prev->rm - nest_cb->prev->right_indent; scr_process_break(); spacing = ((lp_lay_tag *)(nest_cb->lay_tag))->spacing; ProcFlags.keep_left_margin = true; // keep special Note indent post_space = 0; if( ProcFlags.need_li_lp ) { // :LP first tag in list pre_skip_su = greater_su( lp_skip_su, list_skip_su, spacing ); } else { pre_skip_su = &((lp_lay_tag *)(nest_cb->lay_tag))->pre_skip; } set_skip_vars( NULL, pre_skip_su, &((ol_lay_tag *)(nest_cb->lay_tag))->post_skip, 1, g_curr_font ); g_cur_left = nest_cb->lm + nest_cb->left_indent;// left start // possibly indent first line g_cur_h_start = g_cur_left + conv_hor_unit( &(layout_work.lp.line_indent) ); g_page_right = nest_cb->rm - nest_cb->right_indent; ju_x_start = g_cur_h_start; if( *p == '.' ) p++; // over '.' while( *p == ' ' ) p++; // skip initial spaces ProcFlags.need_li_lp = false; // :LI or :LP seen if( *p ) { process_text( p, g_curr_font ); // if text follows } scan_start = scan_stop + 1; return; }