/* PSPP - a program for statistical analysis.
- Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
w += width * unspanned * d0;
}
- rows[x].width = w / d;
+ rows[x].width = MAX (rows[x].width, w / d);
w -= rows[x].width * d;
}
}
+-+-+-----+
])
AT_CLEANUP
+
+# There was a bug that, when multiple cells spanned a single column
+# (or row), only the dimensions of the cell nearest the bottom of the
+# table were actually considered. This checks for regression. (This
+# problem was most easily observed with SYSFILE INFO, which uses lots
+# of spanned cells).
+#
+# Without the fix, the output looks like this:
+# +-------+
+# | A long|
+# | text|
+# |string.|
+# +-------+
+# |shorter|
+AT_SETUP([multiple spanned cells all contribute to dimensions])
+AT_KEYWORDS([render rendering])
+AT_DATA([input], [dnl
+2 2
+1*2 @A long text string.
+1*2 @shorter
+])
+AT_CHECK([render-test --width=30 --length=15 input], [0], [dnl
++-------------------+
+|A long text string.|
++-------------------+
+| shorter|
++-------------------+
+])
+AT_CLEANUP