General: (Raghav1981) ZeroHeight for rows in sheet format

This commit is contained in:
Mark Baker 2012-09-09 11:38:32 +01:00
parent 23fe9937fe
commit 0dac1e1ab5
5 changed files with 39 additions and 1 deletions

View File

@ -855,6 +855,10 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
if (isset($xmlSheet->sheetFormatPr['defaultColWidth'])) {
$docSheet->getDefaultColumnDimension()->setWidth( (float)$xmlSheet->sheetFormatPr['defaultColWidth'] );
}
if (isset($xmlSheet->sheetFormatPr['zeroHeight']) &&
((string)$xmlSheet->sheetFormatPr['zeroHeight'] == '1')) {
$docSheet->getDefaultRowDimension()->setzeroHeight(true);
}
}
if (isset($xmlSheet->cols) && !$this->_readDataOnly) {

View File

@ -51,6 +51,13 @@ class PHPExcel_Worksheet_RowDimension
*/
private $_rowHeight = -1;
/**
* ZeroHeight for Row?
*
* @var bool
*/
private $_zeroHeight = true;
/**
* Visible?
*
@ -133,6 +140,26 @@ class PHPExcel_Worksheet_RowDimension
return $this;
}
/**
* Get ZeroHeight
*
* @return bool
*/
public function getzeroHeight() {
return $this->_zeroHeight;
}
/**
* Set ZeroHeight
*
* @param bool $pValue
* @return PHPExcel_Worksheet_RowDimension
*/
public function setzeroHeight($pValue = false) {
$this->_zeroHeight = $pValue;
return $this;
}
/**
* Get Visible
*

View File

@ -319,6 +319,12 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
$objWriter->writeAttribute('defaultRowHeight', '14.4');
}
// Set Zero Height row
if ((string)$pSheet->getDefaultRowDimension()->getzeroHeight() == '1' ||
strtolower((string)$pSheet->getDefaultRowDimension()->getzeroHeight()) == 'true' ) {
$objWriter->writeAttribute('zeroHeight', '1');
}
// Default column width
if ($pSheet->getDefaultColumnDimension()->getWidth() >= 0) {
$objWriter->writeAttribute('defaultColWidth', PHPExcel_Shared_String::FormatNumber($pSheet->getDefaultColumnDimension()->getWidth()));

View File

@ -229,7 +229,7 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter {
*/
private function _mapBorderStyle($borderStyle) {
switch ($borderStyle) {
case PHPExcel_Style_Border::BORDER_NONE: return '1px hidden';
case PHPExcel_Style_Border::BORDER_NONE: return 'none';
case PHPExcel_Style_Border::BORDER_DASHDOT: return '1px dashed';
case PHPExcel_Style_Border::BORDER_DASHDOTDOT: return '1px dotted';
case PHPExcel_Style_Border::BORDER_DASHED: return '1px dashed';

View File

@ -89,6 +89,7 @@ Fixed in develop branch:
- General: (MBaker) Work item 18324 - Reader factory doesn't read anymore XLTX and XLT files
- General: (MBaker) Magic __toString() method added to Cell object to return raw data value as a string
- General: (alexgann) Add cell indent to html rendering
- General: (Raghav1981) ZeroHeight for rows in sheet format
- Bugfix: (cyberconte) Patch 12318 - OOCalc cells containing <text:span> inside the <text:p> tag
- Bugfix: (schir1964) Fix to listWorksheetInfo() method for OOCalc Reader
- Bugfix: (MBaker) Support for "e" (epoch) date format mask