X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsom.c;h=733fc3c8b67ef2ab4c84339252e14d1099922363;hb=3417680e253b1bfc4519347ef06536378026be2a;hp=d0867aa0ad4d93979dac2bf816589b62354caa16;hpb=2c4c4a789e9c23478bce195d2ed98bab6064dfc1;p=pspp diff --git a/src/som.c b/src/som.c index d0867aa0ad..733fc3c8b6 100644 --- a/src/som.c +++ b/src/som.c @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include #include "som.h" @@ -144,6 +144,7 @@ som_submit (struct som_entity *t) static void output_entity (struct outp_driver *driver, struct som_entity *entity) { + bool fits_width, fits_length; d = driver; assert (d->driver_open); @@ -163,6 +164,19 @@ output_entity (struct outp_driver *driver, struct som_entity *entity) t->class->driver (d); t->class->area (&tw, &th); + fits_width = t->class->fits_width (d->width); + fits_length = t->class->fits_length (d->length); + if (!fits_width || !fits_length) + { + int tl, tr, tt, tb; + tl = fits_width ? hl : 0; + tr = fits_width ? hr : 0; + tt = fits_length ? ht : 0; + tb = fits_length ? hb : 0; + t->class->set_headers (tl, tr, tt, tb); + t->class->driver (d); + t->class->area (&tw, &th); + } if (!(flags & SOMF_NO_SPACING) && d->cp_y != 0) d->cp_y += d->font_height; @@ -175,6 +189,8 @@ output_entity (struct outp_driver *driver, struct som_entity *entity) render_simple (); else render_segments (); + + t->class->set_headers (hl, hr, ht, hb); } /* Render the table into multiple columns. */