Merge branch 'develop' into autofilter

This commit is contained in:
unknown 2012-08-09 12:41:46 +01:00
commit 1bd83a115e
6 changed files with 71 additions and 1 deletions

View File

@ -530,6 +530,7 @@ class PHPExcel_Calculation_MathTrig {
$row = $maxColumn = 0;
foreach($matrixValues as $matrixRow) {
if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
$column = 0;
foreach($matrixRow as $matrixCell) {
if ((is_string($matrixCell)) || ($matrixCell === null)) {
@ -571,6 +572,7 @@ class PHPExcel_Calculation_MathTrig {
$row = $maxColumn = 0;
foreach($matrixValues as $matrixRow) {
if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
$column = 0;
foreach($matrixRow as $matrixCell) {
if ((is_string($matrixCell)) || ($matrixCell === null)) {
@ -607,6 +609,7 @@ class PHPExcel_Calculation_MathTrig {
$rowA = 0;
foreach($matrixData1 as $matrixRow) {
if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
$columnA = 0;
foreach($matrixRow as $matrixCell) {
if ((is_string($matrixCell)) || ($matrixCell === null)) {
@ -621,6 +624,7 @@ class PHPExcel_Calculation_MathTrig {
$matrixA = new PHPExcel_Shared_JAMA_Matrix($matrixAData);
$rowB = 0;
foreach($matrixData2 as $matrixRow) {
if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
$columnB = 0;
foreach($matrixRow as $matrixCell) {
if ((is_string($matrixCell)) || ($matrixCell === null)) {

View File

@ -775,6 +775,10 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
$docSheet->getSheetView()->setZoomScaleNormal( intval($xmlSheet->sheetViews->sheetView['zoomScaleNormal']) );
}
if (isset($xmlSheet->sheetViews->sheetView['view'])) {
$docSheet->getSheetView()->setView((string) $xmlSheet->sheetViews->sheetView['view']);
}
if (isset($xmlSheet->sheetViews->sheetView['showGridLines'])) {
$docSheet->setShowGridLines((string)$xmlSheet->sheetViews->sheetView['showGridLines'] ? true : false);
}

View File

@ -35,6 +35,18 @@
*/
class PHPExcel_Worksheet_SheetView
{
/* Sheet View types */
const SHEETVIEW_NORMAL = 'normal';
const SHEETVIEW_PAGE_LAYOUT = 'pageLayout';
const SHEETVIEW_PAGE_BREAK_PREVIEW = 'pageBreakPreview';
private static $_sheetViewTypes = array(
self::SHEETVIEW_NORMAL,
self::SHEETVIEW_PAGE_LAYOUT,
self::SHEETVIEW_PAGE_BREAK_PREVIEW,
);
/**
* ZoomScale
*
@ -53,6 +65,15 @@ class PHPExcel_Worksheet_SheetView
*/
private $_zoomScaleNormal = 100;
/**
* View
*
* Valid values range from 10 to 400.
*
* @var string
*/
private $_sheetviewType = self::SHEETVIEW_NORMAL;
/**
* Create a new PHPExcel_Worksheet_SheetView
*/
@ -116,6 +137,41 @@ class PHPExcel_Worksheet_SheetView
return $this;
}
/**
* Get View
*
* @return string
*/
public function getView() {
return $this->_sheetviewType;
}
/**
* Set View
*
* Valid values are
* 'normal' self::SHEETVIEW_NORMAL
* 'pageLayout' self::SHEETVIEW_PAGE_LAYOUT
* 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW
*
* @param string $pValue
* @throws Exception
* @return PHPExcel_Worksheet_SheetView
*/
public function setView($pValue = NULL) {
// MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview'
// via the user interface
if ($pValue === NULL)
$pValue = self::SHEETVIEW_NORMAL;
if (in_array($pValue, self::$_sheetViewTypes)) {
$this->_sheetviewType = $pValue;
} else {
throw new Exception("Invalid sheetview layout type.");
}
return $this;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/

View File

@ -194,7 +194,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
* @param PHPExcel_Worksheet $pSheet Worksheet
* @throws Exception
*/
private function _writeSheetViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
private function _writeSheetViews(PHPExcel_Shared_XMLWriter $objWriter = NULL, PHPExcel_Worksheet $pSheet = NULL)
{
// sheetViews
$objWriter->startElement('sheetViews');
@ -218,6 +218,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
$objWriter->writeAttribute('zoomScaleNormal', $pSheet->getSheetView()->getZoomScaleNormal());
}
// View Layout Type
if ($pSheet->getSheetView()->getView() !== PHPExcel_Worksheet_SheetView::SHEETVIEW_NORMAL) {
$objWriter->writeAttribute('view', $pSheet->getSheetView()->getView());
}
// Gridlines
if ($pSheet->getShowGridlines()) {
$objWriter->writeAttribute('showGridLines', 'true');

View File

@ -79,6 +79,7 @@ Fixed in develop branch:
- Feature: (MBaker) Initial version of HTML Reader
- Feature: (Progi1984) & (blazzy) Work items 9605 - Implement support for AutoFilter in PHPExcel_Writer_Excel5
- Feature: (MBaker) Modified ERF and ERFC Engineering functions to accept Excel 2010's modified acceptance of negative arguments
- Feature: (k1LoW) Support SheetView `view` attribute (Excel2007)
- General: (alexgann) Add Currency detection to the Advanced Value Binder
- General: (MBaker) Work item 18404 - setCellValueExplicitByColumnAndRow() do not return PHPExcel_Worksheet
- General: (MBaker) Work item 18324 - Reader factory doesn't read anymore XLTX and XLT files