cvs: pear /HTML_Table Table.php
| From: | Mark Wiesemann | Date: | Tue, 25 Oct 2005 12:41:23 +0000 |
| Subject: | cvs: pear /HTML_Table Table.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35847@lists.php.net to get a copy of this message | ||
wiesemann Tue Oct 25 08:41:23 2005 EDT
Modified files:
/pear/HTML_Table Table.php
Log:
Bugix: toHtml() wrongly assumed that there are instances of $_thead and
$_tfoot when $useTGroups == true
http://cvs.php.net/diff.php/pear/HTML_Table/Table.php?r1=1.28&r2=1.29&ty=u
Index: pear/HTML_Table/Table.php
diff -u pear/HTML_Table/Table.php:1.28 pear/HTML_Table/Table.php:1.29
--- pear/HTML_Table/Table.php:1.28 Tue Oct 25 07:49:48 2005
+++ pear/HTML_Table/Table.php Tue Oct 25 08:41:19 2005
@@ -28,7 +28,7 @@
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Table.php,v 1.28 2005/10/25 11:49:48 wiesemann Exp $
+ * @version CVS: $Id: Table.php,v 1.29 2005/10/25 12:41:19 wiesemann Exp $
* @link http://pear.php.net/package/HTML_Table
*/
@@ -560,26 +560,42 @@
$strHtml .= '</caption>' . $lnEnd;
}
if ($this->_useTGroups) {
- $maxColCount = max($this->_thead->getColCount(),
- $this->_tfoot->getColCount(),
- $this->_tbody->getColCount());
- $this->_thead->setColCount($maxColCount);
- $this->_tfoot->setColCount($maxColCount);
- $this->_tbody->setColCount($maxColCount);
- if ($this->_thead->getRowCount() > 0) {
- $strHtml .= $tabs . $tab . '<thead>' . $lnEnd;
- $strHtml .= $this->_thead->toHtml();
- $strHtml .= $tabs . $tab . '</thead>' . $lnEnd;
+ $tHeadColCount = 0;
+ if ($this->_thead !== null) {
+ $tHeadColCount = $this->_thead->getColCount();
}
- if ($this->_tfoot->getRowCount() > 0) {
- $strHtml .= $tabs . $tab . '<tfoot>' . $lnEnd;
- $strHtml .= $this->_tfoot->toHtml();
- $strHtml .= $tabs . $tab . '</tfoot>' . $lnEnd;
+ $tFootColCount = 0;
+ if ($this->_tfoot !== null) {
+ $tFootColCount = $this->_tfoot->getColCount();
}
- if ($this->_tbody->getRowCount() > 0) {
- $strHtml .= $tabs . $tab . '<tbody>' . $lnEnd;
- $strHtml .= $this->_tbody->toHtml();
- $strHtml .= $tabs . $tab . '</tbody>' . $lnEnd;
+ $tBodyColCount = 0;
+ if ($this->_tbody !== null) {
+ $tBodyColCount = $this->_tbody->getColCount();
+ }
+ $maxColCount = max($tHeadColCount, $tFootColCount, $tBodyColCount);
+ if ($this->_thead !== null) {
+ $this->_thead->setColCount($maxColCount);
+ if ($this->_thead->getRowCount() > 0) {
+ $strHtml .= $tabs . $tab . '<thead>' . $lnEnd;
+ $strHtml .= $this->_thead->toHtml();
+ $strHtml .= $tabs . $tab . '</thead>' . $lnEnd;
+ }
+ }
+ if ($this->_tfoot !== null) {
+ $this->_tfoot->setColCount($maxColCount);
+ if ($this->_tfoot->getRowCount() > 0) {
+ $strHtml .= $tabs . $tab . '<tfoot>' . $lnEnd;
+ $strHtml .= $this->_tfoot->toHtml();
+ $strHtml .= $tabs . $tab . '</tfoot>' . $lnEnd;
+ }
+ }
+ if ($this->_tbody !== null) {
+ $this->_tbody->setColCount($maxColCount);
+ if ($this->_tbody->getRowCount() > 0) {
+ $strHtml .= $tabs . $tab . '<tbody>' . $lnEnd;
+ $strHtml .= $this->_tbody->toHtml();
+ $strHtml .= $tabs . $tab . '</tbody>' . $lnEnd;
+ }
}
} else {
$strHtml .= $this->_tbody->toHtml();