/[groff]/groff/src/devices/grohtml/html-table.cpp
ViewVC logotype

Diff of /groff/src/devices/grohtml/html-table.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by wlemb, Tue Apr 15 15:13:21 2003 UTC revision 1.2 by wl, Tue Oct 12 21:39:31 2004 UTC
# Line 1  Line 1 
1  // -*- C++ -*-  // -*- C++ -*-
2  /* Copyright (C) 2002, 2003 Free Software Foundation, Inc.  /* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
3   *   *
4   *  Gaius Mulley (gaius@glam.ac.uk) wrote html-table.cpp   *  Gaius Mulley (gaius@glam.ac.uk) wrote html-table.cpp
5   *   *
# Line 104  int tabs::compatible (const char *s) Line 104  int tabs::compatible (const char *s)
104      while ((*s != (char)0) && isspace(*s))      while ((*s != (char)0) && isspace(*s))
105        s++;        s++;
106      // collect tab position      // collect tab position
107      total += atoi(s);      total = atoi(s);
108      // move over tab position      // move over tab position
109      while ((*s != (char)0) && !isspace(*s))      while ((*s != (char)0) && !isspace(*s))
110        s++;        s++;
# Line 162  void tabs::init (const char *s) Line 162  void tabs::init (const char *s)
162  }  }
163    
164  /*  /*
165     *  check_init - define tab stops using, s, providing none already exist.
166     */
167    
168    void tabs::check_init (const char *s)
169    {
170      if (tab == NULL)
171        init(s);
172    }
173    
174    /*
175   *  find_tab - returns the tab number corresponding to the position, pos.   *  find_tab - returns the tab number corresponding to the position, pos.
176   */   */
177    
# Line 326  void html_table::emit_table_header (int Line 336  void html_table::emit_table_header (int
336    
337      out->nl();      out->nl();
338      out->nl();      out->nl();
339    
340    #if 0
341      if (space)      if (space)
342        out->put_string("<p>");        out->put_string("<p>");
343    #endif
344    
345      start_space = space;      start_space = space;
346      out->put_string("<table width=\"100%\" border=0 rules=\"none\" frame=\"void\"\n       cols=\"").put_number(n).put_string("\" cellspacing=\"0\" cellpadding=\"0\">").nl();      out->put_string("<table width=\"100%\"")
347          .put_string(" border=0 rules=\"none\" frame=\"void\"\n")
348          .put_string("       cols=\"")
349          .put_number(n)
350          .put_string("\" cellspacing=\"0\" cellpadding=\"0\"")
351          .put_string(start_space ? " style=\"margin-top: 8px; margin-bottom: 8px\"" : "")
352          .put_string(">")
353          .nl();
354      out->put_string("<tr valign=\"top\" align=\"left\">").nl();      out->put_string("<tr valign=\"top\" align=\"left\">").nl();
355    }    }
356  }  }
# Line 468  void html_table::emit_new_row (void) Line 489  void html_table::emit_new_row (void)
489  void html_table::emit_finish_table (void)  void html_table::emit_finish_table (void)
490  {  {
491    finish_row();    finish_row();
   // out->put_string("linelength = ").put_number(linelength).nl();  
492    out->put_string("</table>");    out->put_string("</table>");
493    #if 0
494    if (start_space)    if (start_space)
495      out->put_string("</p>");      out->put_string("</p>");
496    out->nl();  #endif
497  }  }
498    
499  /*  /*
# Line 516  cols *html_table::get_column (int coln) Line 537  cols *html_table::get_column (int coln)
537  int html_table::insert_column (int coln, int hstart, int hend, char align)  int html_table::insert_column (int coln, int hstart, int hend, char align)
538  {  {
539    cols *c = columns;    cols *c = columns;
540    cols *l = NULL;    cols *l = columns;
541    cols *n = NULL;    cols *n = NULL;
542    
543    while (c != NULL && c->no < coln) {    while (c != NULL && c->no < coln) {
544      l = c;      l = c;
545      c = c->next;      c = c->next;
546    }    }
547      if (l != NULL && l->no>coln && hend > l->left)
548        return FALSE;       // new column bumps into previous one
549    
550      l = NULL;
551      c = columns;
552      while (c != NULL && c->no < coln) {
553        l = c;
554        c = c->next;
555      }
556    
557    if ((l != NULL) && (hstart < l->right))    if ((l != NULL) && (hstart < l->right))
558      return FALSE;       // new column bumps into previous one      return FALSE;       // new column bumps into previous one
559        

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26