Changeset: 2a60e5961918 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2a60e5961918
Modified Files:
clients/src/mapiclient/mclient.mx
Branch: default
Log Message:
move up graphwaste definition so it can be used, add some todos
diffs (57 lines):
diff -r 308740ba0d1d -r 2a60e5961918 clients/src/mapiclient/mclient.mx
--- a/clients/src/mapiclient/mclient.mx Tue Aug 17 09:54:09 2010 +0200
+++ b/clients/src/mapiclient/mclient.mx Tue Aug 17 10:07:55 2010 +0200
@@ -1061,6 +1061,11 @@
memset(rest, 0, sizeof(char *) * fields);
memset(numeric, 0, sizeof(int) * fields);
+ /* what we waste on space on the display is
+ * the column separators ' | ', but the edges
+ * lack the edgespace of course */
+ graphwaste = ((fields * 3) - 1) + 2;
+
total = 0;
lentotal = 0;
vartotal = 0;
@@ -1068,13 +1073,14 @@
char *s;
len[i] = mapi_get_len(hdl, i);
- if (len[i] == 0 || len[i]> pagewidth -2 - 2 *
fields) {
+ /* TODO: Replace Martin's extension by
something more sensible
+ * also cut fields that are bigger than what
could
+ * possibly be displayed to "fair share" width
*/
+ if (len[i] == 0 || len[i] > pagewidth -
graphwaste) {
/* no table width known, give
- a fair share of the
- available space (+1 so we
- always fully fill the
- terminal) */
- len[i] = 1 + (pagewidth - 2 - ((fields
* 3) - 1)) / fields;
+ a fair share of the available space
(+1 so we
+ always fully fill the terminal) */
+ len[i] = 1 + (pagewidth - graphwaste) /
fields;
}
if (len[i] < MINCOLSIZE)
len[i] = MINCOLSIZE;
@@ -1102,11 +1108,6 @@
lentotal += (hdr[i] > len[i] ? hdr[i] : len[i]);
}
- /* what we waste on space on the display is
- * the column separators ' | ', but the edges
- * lack the edgespace of course */
- graphwaste = ((fields * 3) - 1) + 2;
-
/* Punishing the value fields is done based on
* how much squeezing will result in. The
* objective is to have at most a single
@@ -1119,6 +1120,8 @@
* are unreadable. Basically, the only fields
* that we want to break are non-numerical
* fields. */
+ /* TODO: this must go in favour of more aggressive
string
+ * truncation */
if (graphwaste + total > mypagewidth) {
while (total > mypagewidth ||
(vartotal + 1) / 2 < total -
mypagewidth) {
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list