Update of /cvsroot/monetdb/clients/src/mapiclient
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv549

Modified Files:
        MapiClient.mx 
Log Message:
Multiline output may take a long time to squeeze. Perform a
quick cut using the pagewidth.


Index: MapiClient.mx
===================================================================
RCS file: /cvsroot/monetdb/clients/src/mapiclient/MapiClient.mx,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- MapiClient.mx       4 Sep 2007 21:03:55 -0000       1.83
+++ MapiClient.mx       8 Sep 2007 14:45:28 -0000       1.84
@@ -714,13 +714,13 @@
                                                           strcmp(s, "double") 
== 0 ||
                                                           strcmp(s, "float") 
== 0);
                        }
+                       /* punish the column headers first until you cannot 
squeeze  */
                        while (2 * fields + 2 + total >= pagewidth && max) {
                                max = 0;
                                total = 0;
                                for (i = 0; i < fields; i++)
                                        total += len[i];
 
-                               /* punish the column headers first */
                                for (i = 0; i < fields; i++) {
                                        char *name = mapi_get_name(hdl, i);
 
@@ -735,7 +735,11 @@
                                        }
                                }
                        }
-                       /* punish the long value fields */
+                       /* punish the long value fields, first the multi-lines 
*/
+                       for (i = 0; i < fields; i++)
+                               if( len[i] >= pagewidth-2*fields)
+                                       len[i]= pagewidth-2*fields;
+                       /* finetune the long value fields */
                        while (2 * fields + 2 + total >= pagewidth) {
                                total = 0;
                                max = 0;
@@ -748,6 +752,7 @@
                                /* penalty for largest field */
                                len[max]--;
                                total--;
+                               /* no more squeezing possible */
                                if (len[max] == 1)
                                        break;
                        }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to