Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Commit

Permalink
Bugfix: (alexgann) Work item GH-154 - Fix merged-cell borders on HTML…
Browse files Browse the repository at this point in the history
…/PDF output
  • Loading branch information
Mark Baker committed Apr 1, 2013
1 parent 663b8a1 commit db7b99a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 9 additions & 1 deletion Classes/PHPExcel/Writer/HTML.php
Expand Up @@ -966,7 +966,10 @@ private function _createCSSStyleBorders(PHPExcel_Style_Borders $pStyle) {
*/
private function _createCSSStyleBorder(PHPExcel_Style_Border $pStyle) {
// Create CSS
$css = $this->_mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB();
// $css = $this->_mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB();
// Create CSS - add !important to non-none border styles for merged cells
$borderStyle = $this->_mapBorderStyle($pStyle->getBorderStyle());
$css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important');

// Return
return $css;
Expand Down Expand Up @@ -1229,6 +1232,11 @@ private function _generateRow(PHPExcel_Worksheet $pSheet, $pValues = null, $pRow
$spans = $this->_isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum];
$rowSpan = $spans['rowspan'];
$colSpan = $spans['colspan'];

// Also apply style from last cell in merge to fix borders -
// relies on !important for non-none border declarations in _createCSSStyleBorder
$endCellCoord = PHPExcel_Cell::stringFromColumnIndex($colNum + $colSpan - 1) . ($pRow + $rowSpan);
$cssClass .= ' style' . $pSheet->getCell($endCellCoord)->getXfIndex();
}

// Write
Expand Down
8 changes: 5 additions & 3 deletions changelog.txt
Expand Up @@ -56,13 +56,15 @@ Fixed in develop branch for release v1.7.9:
- Bugfix: (MBaker) Work item GH-80 - "Sheet index is out of bounds." Exception
- Bugfix: (ccorliss) Work item GH-105 - Fixed number format fatal error
- Bugfix: (MBaker) - Add DROP TABLE in destructor for SQLite and SQLite3 cache controllers
- Bugfix: (alexgann) Work item GH-154 - Fix merged-cell borders on HTML/PDF output


--------------------------------------------------------------------------------
BREAKING CHANGE! As part of the planned changes for handling array formulae in
workbooks, there are some changes that will affect the PHPExcel_Cell object
methods.

The following methods are now deprecated, and will be removed in version 1.7.9:
The following methods are now deprecated, and will be removed in or after version 1.8.0:
getCalculatedValue() The getValue() method will return calculated
values for cells containing formulae instead.
setCalculatedValue() The cell value will always contain the result of a
Expand All @@ -72,7 +74,7 @@ The following methods are now deprecated, and will be removed in version 1.7.9:
getFormulaAttributes() This will be replaced by the getArrayFormulaRange()
method.

The following methods will be added in version 1.7.9
The following methods will be added in version 1.8.0
getFormula() Use to retrieve a cell formula, will return the cell
value if the cell doesn't contain a formula, or
is not part of an array formula range.
Expand All @@ -87,7 +89,7 @@ The following methods will be added in version 1.7.9
or is part of an array formula range or not.
getArrayFormulaRange() Use to retrieve an array formula range.

The following methods will be changed in version 1.7.9
The following methods will be changed in version 1.8.0
setValue() The logic behind this will be modified to store
formula values in the new cell property structure,
but it will still perform the same function.
Expand Down

0 comments on commit db7b99a

Please sign in to comment.