[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] Changes to pspp/src/tab.c
From: |
Ben Pfaff |
Subject: |
[Pspp-cvs] Changes to pspp/src/tab.c |
Date: |
Tue, 17 May 2005 03:09:37 -0400 |
Index: pspp/src/tab.c
diff -u pspp/src/tab.c:1.22 pspp/src/tab.c:1.23
--- pspp/src/tab.c:1.22 Tue May 17 05:46:39 2005
+++ pspp/src/tab.c Tue May 17 07:09:35 2005
@@ -1135,6 +1135,45 @@
*flags = t->flags;
}
+/* Returns true if the table will fit in the given page WIDTH,
+ false otherwise. */
+static bool
+tabi_fits_width (int width)
+{
+ int i;
+
+ for (i = t->l; i < t->nc - t->r; i++)
+ if (t->wl + t->wr + t->w[i] > width)
+ return false;
+
+ return true;
+}
+
+/* Returns true if the table will fit in the given page LENGTH,
+ false otherwise. */
+static bool
+tabi_fits_length (int length)
+{
+ int i;
+
+ for (i = t->t; i < t->nr - t->b; i++)
+ if (t->ht + t->hb + t->h[i] > length)
+ return false;
+
+ return true;
+}
+
+/* Sets the number of header rows/columns on the left, right, top,
+ and bottom sides to HL, HR, HT, and HB, respectively. */
+static void
+tabi_set_headers (int hl, int hr, int ht, int hb)
+{
+ t->l = hl;
+ t->r = hr;
+ t->t = ht;
+ t->b = hb;
+}
+
/* Render title for current table, with major index X and minor index
Y. Y may be zero, or X and Y may be zero, but X should be nonzero
if Y is nonzero. */
@@ -1235,9 +1274,12 @@
NULL,
tabi_cumulate,
tabi_flags,
+ tabi_fits_width,
+ tabi_fits_length,
NULL,
NULL,
+ tabi_set_headers,
tabi_title,
tabi_render,