Bugfix: (alexgann) Work item GH-154 - Fix merged-cell borders on HTML/PDF output

This commit is contained in:
Mark Baker 2013-04-01 17:26:26 +01:00
parent 663b8a1903
commit db7b99ac8e
2 changed files with 14 additions and 4 deletions

View File

@ -966,7 +966,10 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
*/ */
private function _createCSSStyleBorder(PHPExcel_Style_Border $pStyle) { private function _createCSSStyleBorder(PHPExcel_Style_Border $pStyle) {
// Create CSS // 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
return $css; return $css;
@ -1229,6 +1232,11 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
$spans = $this->_isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum]; $spans = $this->_isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum];
$rowSpan = $spans['rowspan']; $rowSpan = $spans['rowspan'];
$colSpan = $spans['colspan']; $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 // Write

View File

@ -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: (MBaker) Work item GH-80 - "Sheet index is out of bounds." Exception
- Bugfix: (ccorliss) Work item GH-105 - Fixed number format fatal error - 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: (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 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 workbooks, there are some changes that will affect the PHPExcel_Cell object
methods. 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 getCalculatedValue() The getValue() method will return calculated
values for cells containing formulae instead. values for cells containing formulae instead.
setCalculatedValue() The cell value will always contain the result of a setCalculatedValue() The cell value will always contain the result of a
@ -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() getFormulaAttributes() This will be replaced by the getArrayFormulaRange()
method. 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 getFormula() Use to retrieve a cell formula, will return the cell
value if the cell doesn't contain a formula, or value if the cell doesn't contain a formula, or
is not part of an array formula range. is not part of an array formula range.
@ -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. or is part of an array formula range or not.
getArrayFormulaRange() Use to retrieve an array formula range. 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 setValue() The logic behind this will be modified to store
formula values in the new cell property structure, formula values in the new cell property structure,
but it will still perform the same function. but it will still perform the same function.