projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Delete trailing whitespace at end of lines.
[pspp-builds.git]
/
src
/
output
/
manager.c
diff --git
a/src/output/manager.c
b/src/output/manager.c
index ba9cfe94c4673898962a6918438cc60734e47b31..492415950bad84f642fa6f2f5dd6a93e41c3d39a 100644
(file)
--- a/
src/output/manager.c
+++ b/
src/output/manager.c
@@
-1,6
+1,5
@@
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@
-21,6
+20,7
@@
#include "manager.h"
#include <stdio.h>
#include <stdlib.h>
#include "manager.h"
#include <stdio.h>
#include <stdlib.h>
+#include <libpspp/assertion.h>
#include "output.h"
/* Table. */
#include "output.h"
/* Table. */
@@
-54,17
+54,17
@@
void
som_blank_line (void)
{
struct outp_driver *d;
som_blank_line (void)
{
struct outp_driver *d;
-
+
for (d = outp_drivers (NULL); d; d = outp_drivers (d))
if (d->page_open && d->cp_y != 0)
d->cp_y += d->font_height;
}
\f
/* Driver. */
for (d = outp_drivers (NULL); d; d = outp_drivers (d))
if (d->page_open && d->cp_y != 0)
d->cp_y += d->font_height;
}
\f
/* Driver. */
-static struct outp_driver *d
=
0;
+static struct outp_driver *d
=
0;
/* Table. */
/* Table. */
-static struct som_entity *t
=
0;
+static struct som_entity *t
=
0;
/* Flags. */
static unsigned flags;
/* Flags. */
static unsigned flags;
@@
-93,11
+93,11
@@
som_submit (struct som_entity *t)
{
#if DEBUGGING
static int entry;
{
#if DEBUGGING
static int entry;
-
+
assert (entry++ == 0);
#endif
assert (entry++ == 0);
#endif
- if ( t->type == SOM_TABLE)
+ if ( t->type == SOM_TABLE)
{
t->class->table (t);
t->class->flags (&flags);
{
t->class->table (t);
t->class->flags (&flags);
@@
-110,7
+110,7
@@
som_submit (struct som_entity *t)
{
printf ("headers: (l,r)=(%d,%d), (t,b)=(%d,%d) in table size (%d,%d)\n",
hl, hr, ht, hb, nc, nr);
{
printf ("headers: (l,r)=(%d,%d), (t,b)=(%d,%d) in table size (%d,%d)\n",
hl, hr, ht, hb, nc, nr);
-
abort
();
+
NOT_REACHED
();
}
else if (hl + hr == nc)
printf ("warning: headers (l,r)=(%d,%d) in table width %d\n", hl, hr, nc);
}
else if (hl + hr == nc)
printf ("warning: headers (l,r)=(%d,%d) in table width %d\n", hl, hr, nc);
@@
-122,17
+122,17
@@
som_submit (struct som_entity *t)
if (!(flags & SOMF_NO_TITLE))
subtable_num++;
if (!(flags & SOMF_NO_TITLE))
subtable_num++;
-
+
}
}
-
+
{
struct outp_driver *d;
{
struct outp_driver *d;
-
+
for (d = outp_drivers (NULL); d; d = outp_drivers (d))
output_entity (d, t);
}
for (d = outp_drivers (NULL); d; d = outp_drivers (d))
output_entity (d, t);
}
-
+
#if DEBUGGING
assert (--entry == 0);
#endif
#if DEBUGGING
assert (--entry == 0);
#endif
@@
-153,12
+153,12
@@
output_entity (struct outp_driver *driver, struct som_entity *entity)
}
t = entity;
}
t = 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);
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)
+ if (!fits_width || !fits_length)
{
int tl, tr, tt, tb;
tl = fits_width ? hl : 0;
{
int tl, tr, tt, tb;
tl = fits_width ? hl : 0;
@@
-169,17
+169,17
@@
output_entity (struct outp_driver *driver, struct som_entity *entity)
t->class->driver (d);
t->class->area (&tw, &th);
}
t->class->driver (d);
t->class->area (&tw, &th);
}
-
+
if (!(flags & SOMF_NO_SPACING) && d->cp_y != 0)
d->cp_y += d->font_height;
if (!(flags & SOMF_NO_SPACING) && d->cp_y != 0)
d->cp_y += d->font_height;
-
+
if (cs != SOM_COL_NONE
&& 2 * (tw + d->prop_em_width) <= d->width
&& nr - (ht + hb) > 5)
render_columns ();
else if (tw < d->width && th + d->cp_y < d->length)
render_simple ();
if (cs != SOM_COL_NONE
&& 2 * (tw + d->prop_em_width) <= d->width
&& nr - (ht + hb) > 5)
render_columns ();
else if (tw < d->width && th + d->cp_y < d->length)
render_simple ();
- else
+ else
render_segments ();
t->class->set_headers (hl, hr, ht, hb);
render_segments ();
t->class->set_headers (hl, hr, ht, hb);
@@
-192,14
+192,14
@@
render_columns (void)
int y0, y1;
int max_len = 0;
int index = 0;
int y0, y1;
int max_len = 0;
int index = 0;
-
+
assert (cs == SOM_COL_DOWN);
assert (d->cp_x == 0);
for (y0 = ht; y0 < nr - hb; y0 = y1)
{
int len;
assert (cs == SOM_COL_DOWN);
assert (d->cp_x == 0);
for (y0 = ht; y0 < nr - hb; y0 = y1)
{
int len;
-
+
t->class->cumulate (SOM_ROWS, y0, &y1, d->length - d->cp_y, &len);
if (y0 == y1)
t->class->cumulate (SOM_ROWS, y0, &y1, d->length - d->cp_y, &len);
if (y0 == y1)
@@
-214,7
+214,7
@@
render_columns (void)
t->class->title (index++, 0);
t->class->render (0, y0, nc, y1);
t->class->title (index++, 0);
t->class->render (0, y0, nc, y1);
-
+
d->cp_x += tw + 2 * d->prop_em_width;
if (d->cp_x + tw > d->width)
{
d->cp_x += tw + 2 * d->prop_em_width;
if (d->cp_x + tw > d->width)
{
@@
-224,7
+224,7
@@
render_columns (void)
}
}
}
}
}
}
-
+
if (d->cp_x > 0)
{
d->cp_x = 0;
if (d->cp_x > 0)
{
d->cp_x = 0;
@@
-249,17
+249,17
@@
static void
render_segments (void)
{
int count = 0;
render_segments (void)
{
int count = 0;
-
+
int x_index;
int x0, x1;
int x_index;
int x0, x1;
-
+
assert (d->cp_x == 0);
for (x_index = 0, x0 = hl; x0 < nc - hr; x0 = x1, x_index++)
{
int y_index;
int y0, y1;
assert (d->cp_x == 0);
for (x_index = 0, x0 = hl; x0 < nc - hr; x0 = x1, x_index++)
{
int y_index;
int y0, y1;
-
+
t->class->cumulate (SOM_COLUMNS, x0, &x1, d->width, NULL);
if (x_index == 0 && x1 != nc - hr)
x_index++;
t->class->cumulate (SOM_COLUMNS, x0, &x1, d->width, NULL);
if (x_index == 0 && x1 != nc - hr)
x_index++;
@@
-267,10
+267,10
@@
render_segments (void)
for (y_index = 0, y0 = ht; y0 < nr - hb; y0 = y1, y_index++)
{
int len;
for (y_index = 0, y0 = ht; y0 < nr - hb; y0 = y1, y_index++)
{
int len;
-
+
if (count++ != 0 && d->cp_y != 0)
d->cp_y += d->font_height;
if (count++ != 0 && d->cp_y != 0)
d->cp_y += d->font_height;
-
+
t->class->cumulate (SOM_ROWS, y0, &y1, d->length - d->cp_y, &len);
if (y_index == 0 && y1 != nr - hb)
y_index++;
t->class->cumulate (SOM_ROWS, y0, &y1, d->length - d->cp_y, &len);
if (y_index == 0 && y1 != nr - hb)
y_index++;
@@
-279,11
+279,13
@@
render_segments (void)
{
assert (d->cp_y);
outp_eject_page (d);
{
assert (d->cp_y);
outp_eject_page (d);
- } else {
+ }
+ else
+ {
t->class->title (x_index ? x_index : y_index,
x_index ? y_index : 0);
t->class->render (x0, y0, x1, y1);
t->class->title (x_index ? x_index : y_index,
x_index ? y_index : 0);
t->class->render (x0, y0, x1, y1);
-
+
d->cp_y += len;
}
}
d->cp_y += len;
}
}