X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flist.q;h=3add8de152e8bd9ef05744ab26020eb3df15e107;hb=dbb0228a4c98cbf4756ba651fda158c1565b3b55;hp=e3ac2ed52e853e27cff9877afc37e6e7659dafda;hpb=b321086267ad1014dc5d09886396cde30f094437;p=pspp diff --git a/src/list.q b/src/list.q index e3ac2ed52e..3add8de152 100644 --- a/src/list.q +++ b/src/list.q @@ -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 "error.h" @@ -517,8 +517,9 @@ determine_layout (void) { int column; /* Current column. */ int width; /* Accumulated width. */ + int height; /* Height of vertical names. */ int max_width; /* Page width. */ - + struct list_ext *prc; if (d->class == &html_class) @@ -557,14 +558,19 @@ determine_layout (void) } /* Try layout #2. */ - for (width = cmd.n_variables - 1, column = 0; + for (width = cmd.n_variables - 1, height = 0, column = 0; column < cmd.n_variables && width <= max_width; - column++) - width += cmd.v_variables[column]->print.w; + column++) + { + struct variable *v = cmd.v_variables[column]; + width += v->print.w; + if (strlen (v->name) > height) + height = strlen (v->name); + } /* If it fit then we need to determine how many labels can be written horizontally. */ - if (width <= max_width) + if (width <= max_width && height <= SHORT_NAME_LEN) { #ifndef NDEBUG prc->n_vertical = -1;