From cce77bad0e8432584aec17c0165d775420f23ffc Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Mon, 5 Nov 2012 23:34:02 +0000 Subject: [PATCH] Cleanup of refactored writers --- Classes/PHPExcel/Writer/Excel2007.php | 2 +- Classes/PHPExcel/Writer/Excel2007/Chart.php | 32 ++++++------ Classes/PHPExcel/Writer/Excel2007/Rels.php | 12 ++--- .../PHPExcel/Writer/Excel2007/StringTable.php | 12 ++--- Classes/PHPExcel/Writer/Excel2007/Style.php | 32 ++++++------ Classes/PHPExcel/Writer/Excel2007/Theme.php | 2 +- .../PHPExcel/Writer/Excel2007/Workbook.php | 30 +++++------ .../PHPExcel/Writer/Excel2007/Worksheet.php | 52 +++++++++---------- .../PHPExcel/Writer/Excel2007/WriterPart.php | 8 +-- Classes/PHPExcel/Writer/Excel5/BIFFwriter.php | 2 +- Classes/PHPExcel/Writer/Excel5/Parser.php | 42 +++++++-------- Classes/PHPExcel/Writer/Excel5/Worksheet.php | 22 ++++---- Classes/PHPExcel/Writer/Exception.php | 4 +- Classes/PHPExcel/Writer/PDF/Core.php | 27 ++++++++-- Classes/PHPExcel/Writer/PDF/DomPDF.php | 7 +-- Classes/PHPExcel/Writer/PDF/mPDF.php | 7 +-- Classes/PHPExcel/Writer/PDF/tcPDF.php | 7 +-- 17 files changed, 156 insertions(+), 144 deletions(-) diff --git a/Classes/PHPExcel/Writer/Excel2007.php b/Classes/PHPExcel/Writer/Excel2007.php index 00d041c0..ad2ee97d 100644 --- a/Classes/PHPExcel/Writer/Excel2007.php +++ b/Classes/PHPExcel/Writer/Excel2007.php @@ -30,7 +30,7 @@ * PHPExcel_Writer_Excel2007 * * @category PHPExcel - * @package PHPExcel_Writer + * @package PHPExcel_Writer_2007 * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) */ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter diff --git a/Classes/PHPExcel/Writer/Excel2007/Chart.php b/Classes/PHPExcel/Writer/Excel2007/Chart.php index 2b858d4c..1a727384 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Chart.php +++ b/Classes/PHPExcel/Writer/Excel2007/Chart.php @@ -40,7 +40,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Chart $pChart * @return string XML Output - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeChart(PHPExcel_Chart $pChart = null) { @@ -120,7 +120,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Chart_Title $title * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeTitle(PHPExcel_Chart_Title $title = null, $objWriter) { @@ -164,7 +164,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Chart_Legend $legend * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeLegend(PHPExcel_Chart_Legend $legend = null, $objWriter) { @@ -217,7 +217,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * @param PHPExcel_Chart_Title $xAxisLabel * @param PHPExcel_Chart_Title $yAxisLabel * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writePlotArea(PHPExcel_Chart_PlotArea $plotArea, PHPExcel_Chart_Title $xAxisLabel = NULL, @@ -355,7 +355,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Chart_Layout $chartLayout Chart layout - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeDataLbls($objWriter, $chartLayout) { @@ -410,7 +410,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * @param string $id1 * @param string $id2 * @param boolean $isMultiLevelSeries - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeCatAx($objWriter, PHPExcel_Chart_PlotArea $plotArea, $xAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries) { @@ -533,7 +533,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * @param string $id1 * @param string $id2 * @param boolean $isMultiLevelSeries - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeValAx($objWriter, PHPExcel_Chart_PlotArea $plotArea, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries) { @@ -649,7 +649,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Chart_PlotArea $plotArea * @return string|array - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private static function _getChartType($plotArea) { @@ -664,7 +664,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa } $chartType = array_unique($chartTypes); if (count($chartTypes) == 0) { - throw new PHPExcel_Reader_Exception('Chart is not yet implemented'); + throw new PHPExcel_Writer_Exception('Chart is not yet implemented'); } } @@ -681,7 +681,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * @param boolean &$valIsMultiLevelSeries Is value set a multi-series set * @param string &$plotGroupingType Type of grouping for multi-series values * @param PHPExcel_Worksheet $pSheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writePlotGroup( $plotGroup, $groupType, @@ -872,7 +872,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Chart_DataSeriesValues $plotSeriesLabel * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writePlotSeriesLabel($plotSeriesLabel, $objWriter) { @@ -910,7 +910,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * @param string $groupType Type of plot for dataseries * @param string $dataType Datatype of series values * @param PHPExcel_Worksheet $pSheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writePlotSeriesValues( $plotSeriesValues, $objWriter, @@ -1010,7 +1010,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Chart_DataSeriesValues $plotSeriesValues * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeBubbles($plotSeriesValues, $objWriter, PHPExcel_Worksheet $pSheet) { @@ -1056,7 +1056,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Chart_Layout $layout * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeLayout(PHPExcel_Chart_Layout $layout = NULL, $objWriter) { @@ -1124,7 +1124,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * Write Alternate Content block * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeAlternateContent($objWriter) { @@ -1153,7 +1153,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa * Write Printer Settings * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writePrintSettings($objWriter) { diff --git a/Classes/PHPExcel/Writer/Excel2007/Rels.php b/Classes/PHPExcel/Writer/Excel2007/Rels.php index f21bcea2..606e8c79 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Rels.php +++ b/Classes/PHPExcel/Writer/Excel2007/Rels.php @@ -106,7 +106,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar * * @param PHPExcel $pPHPExcel * @return string XML Output - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeWorkbookRelationships(PHPExcel $pPHPExcel = null) { @@ -177,7 +177,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar * @param int $pWorksheetId * @param boolean $includeCharts Flag indicating if we should write charts * @return string XML Output - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeWorksheetRelationships(PHPExcel_Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = FALSE) { @@ -286,7 +286,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar * @param int &$chartRef Chart ID * @param boolean $includeCharts Flag indicating if we should write charts * @return string XML Output - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = FALSE) { @@ -350,7 +350,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar * * @param PHPExcel_Worksheet $pWorksheet * @return string XML Output - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeHeaderFooterDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null) { @@ -394,7 +394,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar * @param string $pType Relationship type * @param string $pTarget Relationship target * @param string $pTargetMode Relationship target mode - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeRelationship(PHPExcel_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') { @@ -411,7 +411,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar $objWriter->endElement(); } else { - throw new PHPExcel_Reader_Exception("Invalid parameters passed."); + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); } } } diff --git a/Classes/PHPExcel/Writer/Excel2007/StringTable.php b/Classes/PHPExcel/Writer/Excel2007/StringTable.php index ade877cb..e43d0f0f 100644 --- a/Classes/PHPExcel/Writer/Excel2007/StringTable.php +++ b/Classes/PHPExcel/Writer/Excel2007/StringTable.php @@ -41,7 +41,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr * @param PHPExcel_Worksheet $pSheet Worksheet * @param string[] $pExistingTable Existing table to eventually merge with * @return string[] String table for worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function createStringTable($pSheet = null, $pExistingTable = null) { @@ -81,7 +81,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr // Return return $aStringTable; } else { - throw new PHPExcel_Reader_Exception("Invalid PHPExcel_Worksheet object passed."); + throw new PHPExcel_Writer_Exception("Invalid PHPExcel_Worksheet object passed."); } } @@ -90,7 +90,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr * * @param string[] $pStringTable * @return string XML Output - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeStringTable($pStringTable = null) { @@ -135,7 +135,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr // Return return $objWriter->getData(); } else { - throw new PHPExcel_Reader_Exception("Invalid string table array passed."); + throw new PHPExcel_Writer_Exception("Invalid string table array passed."); } } @@ -145,7 +145,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_RichText $pRichText Rich text * @param string $prefix Optional Namespace prefix - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeRichText(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_RichText $pRichText = null, $prefix=NULL) { @@ -227,7 +227,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param string|PHPExcel_RichText $pRichText text string or Rich text * @param string $prefix Optional Namespace prefix - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeRichTextForCharts(PHPExcel_Shared_XMLWriter $objWriter = null, $pRichText = null, $prefix=NULL) { diff --git a/Classes/PHPExcel/Writer/Excel2007/Style.php b/Classes/PHPExcel/Writer/Excel2007/Style.php index 9740b760..90b5e954 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Style.php +++ b/Classes/PHPExcel/Writer/Excel2007/Style.php @@ -40,7 +40,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel $pPHPExcel * @return string XML Output - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeStyles(PHPExcel $pPHPExcel = null) { @@ -170,7 +170,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Style_Fill $pFill Fill style - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) { @@ -190,7 +190,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Style_Fill $pFill Fill style - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeGradientFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) { @@ -234,7 +234,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Style_Fill $pFill Fill style - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writePatternFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) { @@ -272,7 +272,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Style_Font $pFont Font style - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeFont(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Font $pFont = null) { @@ -352,7 +352,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Style_Borders $pBorders Borders style - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeBorder(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Borders $pBorders = null) { @@ -389,7 +389,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Style $pStyle Style * @param PHPExcel $pPHPExcel Workbook - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeCellStyleXf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null, PHPExcel $pPHPExcel = null) { @@ -458,7 +458,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Style $pStyle Style - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeCellStyleDxf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null) { @@ -524,7 +524,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param string $pName Element name * @param PHPExcel_Style_Border $pBorder Border style - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeBorderPr(PHPExcel_Shared_XMLWriter $objWriter = null, $pName = 'left', PHPExcel_Style_Border $pBorder = null) { @@ -548,7 +548,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Style_NumberFormat $pNumberFormat Number Format * @param int $pId Number Format identifier - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeNumFmt(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_NumberFormat $pNumberFormat = null, $pId = 0) { @@ -569,7 +569,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel $pPHPExcel * @return PHPExcel_Style[] All styles in PHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function allStyles(PHPExcel $pPHPExcel = null) { @@ -583,7 +583,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel $pPHPExcel * @return PHPExcel_Style_Conditional[] All conditional styles in PHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function allConditionalStyles(PHPExcel $pPHPExcel = null) { @@ -607,7 +607,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel $pPHPExcel * @return PHPExcel_Style_Fill[] All fills in PHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function allFills(PHPExcel $pPHPExcel = null) { @@ -638,7 +638,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel $pPHPExcel * @return PHPExcel_Style_Font[] All fonts in PHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function allFonts(PHPExcel $pPHPExcel = null) { @@ -660,7 +660,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel $pPHPExcel * @return PHPExcel_Style_Borders[] All borders in PHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function allBorders(PHPExcel $pPHPExcel = null) { @@ -682,7 +682,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel $pPHPExcel * @return PHPExcel_Style_NumberFormat[] All number formats in PHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function allNumberFormats(PHPExcel $pPHPExcel = null) { diff --git a/Classes/PHPExcel/Writer/Excel2007/Theme.php b/Classes/PHPExcel/Writer/Excel2007/Theme.php index d408b2f2..ce3a8c2c 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Theme.php +++ b/Classes/PHPExcel/Writer/Excel2007/Theme.php @@ -27,7 +27,7 @@ /** - * PHPExcel_Writer_Excel2007_DocProps + * PHPExcel_Writer_Excel2007_Theme * * @category PHPExcel * @package PHPExcel_Writer_Excel2007 diff --git a/Classes/PHPExcel/Writer/Excel2007/Workbook.php b/Classes/PHPExcel/Writer/Excel2007/Workbook.php index 87ad0596..6f3e44a2 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Workbook.php +++ b/Classes/PHPExcel/Writer/Excel2007/Workbook.php @@ -41,7 +41,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * @param PHPExcel $pPHPExcel * @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing * @return string XML Output - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeWorkbook(PHPExcel $pPHPExcel = null, $recalcRequired = FALSE) { @@ -95,7 +95,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * Write file version * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeFileVersion(PHPExcel_Shared_XMLWriter $objWriter = null) { @@ -111,7 +111,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * Write WorkbookPr * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeWorkbookPr(PHPExcel_Shared_XMLWriter $objWriter = null) { @@ -131,7 +131,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel $pPHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeBookViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) { @@ -161,7 +161,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel $pPHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeWorkbookProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) { @@ -188,7 +188,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeCalcPr(PHPExcel_Shared_XMLWriter $objWriter = null, $recalcRequired = TRUE) { @@ -207,7 +207,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel $pPHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeSheets(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) { @@ -236,7 +236,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * @param int $pSheetId Sheet id * @param int $pRelId Relationship ID * @param string $sheetState Sheet state (visible, hidden, veryHidden) - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeSheet(PHPExcel_Shared_XMLWriter $objWriter = null, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible') { @@ -251,7 +251,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write $objWriter->writeAttribute('r:id', 'rId' . $pRelId); $objWriter->endElement(); } else { - throw new PHPExcel_Reader_Exception("Invalid parameters passed."); + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); } } @@ -260,7 +260,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel $pPHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeDefinedNames(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) { @@ -294,7 +294,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel $pPHPExcel - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeNamedRanges(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel) { @@ -310,7 +310,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_NamedRange $pNamedRange - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeDefinedNameForNamedRange(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_NamedRange $pNamedRange) { @@ -342,7 +342,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet * @param int $pSheetId - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeDefinedNameForAutofilter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0) { @@ -378,7 +378,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet * @param int $pSheetId - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeDefinedNameForPrintTitles(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0) { @@ -421,7 +421,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet * @param int $pSheetId - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeDefinedNameForPrintArea(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0) { diff --git a/Classes/PHPExcel/Writer/Excel2007/Worksheet.php b/Classes/PHPExcel/Writer/Excel2007/Worksheet.php index 37ae3fc8..977f172d 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Worksheet.php +++ b/Classes/PHPExcel/Writer/Excel2007/Worksheet.php @@ -42,7 +42,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * @param string[] $pStringTable * @param boolean $includeCharts Flag indicating if we should write charts * @return string XML Output - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function writeWorksheet($pSheet = null, $pStringTable = null, $includeCharts = FALSE) { @@ -132,7 +132,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ // Return return $objWriter->getData(); } else { - throw new PHPExcel_Reader_Exception("Invalid PHPExcel_Worksheet object passed."); + throw new PHPExcel_Writer_Exception("Invalid PHPExcel_Worksheet object passed."); } } @@ -141,7 +141,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeSheetPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -182,7 +182,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeDimension(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -197,7 +197,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeSheetViews(PHPExcel_Shared_XMLWriter $objWriter = NULL, PHPExcel_Worksheet $pSheet = NULL) { @@ -304,7 +304,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeSheetFormatPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -356,7 +356,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeCols(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -421,7 +421,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeSheetProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -456,7 +456,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeConditionalFormatting(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -531,7 +531,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeDataValidations(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -597,7 +597,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeHyperlinks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -638,7 +638,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeProtectedRanges(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -667,7 +667,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeMergeCells(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -692,7 +692,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writePrintOptions(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -718,7 +718,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writePageMargins(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -738,7 +738,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeAutoFilter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -830,7 +830,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writePageSetup(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -865,7 +865,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeHeaderFooter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -890,7 +890,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeBreaks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -948,7 +948,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet * @param string[] $pStringTable String table - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeSheetData(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pStringTable = null) { @@ -1033,7 +1033,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ $objWriter->endElement(); } else { - throw new PHPExcel_Reader_Exception("Invalid parameters passed."); + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); } } @@ -1045,7 +1045,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * @param PHPExcel_Cell $pCellAddress Cell Address * @param string[] $pStringTable String table * @param string[] $pFlippedStringTable String table (flipped), for faster index searching - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeCell(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pCellAddress = null, $pStringTable = null, $pFlippedStringTable = null) { @@ -1157,7 +1157,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ $objWriter->endElement(); } else { - throw new PHPExcel_Reader_Exception("Invalid parameters passed."); + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); } } @@ -1167,7 +1167,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet * @param boolean $includeCharts Flag indicating if we should include drawing details for charts - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeDrawings(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $includeCharts = FALSE) { @@ -1186,7 +1186,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeLegacyDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { @@ -1203,7 +1203,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ private function _writeLegacyDrawingHF(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) { diff --git a/Classes/PHPExcel/Writer/Excel2007/WriterPart.php b/Classes/PHPExcel/Writer/Excel2007/WriterPart.php index 338d07e7..e1242c84 100644 --- a/Classes/PHPExcel/Writer/Excel2007/WriterPart.php +++ b/Classes/PHPExcel/Writer/Excel2007/WriterPart.php @@ -46,7 +46,7 @@ abstract class PHPExcel_Writer_Excel2007_WriterPart * Set parent IWriter object * * @param PHPExcel_Writer_IWriter $pWriter - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function setParentWriter(PHPExcel_Writer_IWriter $pWriter = null) { $this->_parentWriter = $pWriter; @@ -56,13 +56,13 @@ abstract class PHPExcel_Writer_Excel2007_WriterPart * Get parent IWriter object * * @return PHPExcel_Writer_IWriter - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function getParentWriter() { if (!is_null($this->_parentWriter)) { return $this->_parentWriter; } else { - throw new PHPExcel_Reader_Exception("No parent PHPExcel_Writer_IWriter assigned."); + throw new PHPExcel_Writer_Exception("No parent PHPExcel_Writer_IWriter assigned."); } } @@ -70,7 +70,7 @@ abstract class PHPExcel_Writer_Excel2007_WriterPart * Set parent IWriter object * * @param PHPExcel_Writer_IWriter $pWriter - * @throws PHPExcel_Reader_Exception + * @throws PHPExcel_Writer_Exception */ public function __construct(PHPExcel_Writer_IWriter $pWriter = null) { if (!is_null($pWriter)) { diff --git a/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php b/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php index 77765219..20c125d0 100644 --- a/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php +++ b/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php @@ -122,7 +122,7 @@ class PHPExcel_Writer_Excel5_BIFFwriter $byte_order = 1; // Big Endian } else { // Give up. I'll fix this in a later version. - throw new PHPExcel_Reader_Exception("Required floating point format not supported on this platform."); + throw new PHPExcel_Writer_Exception("Required floating point format not supported on this platform."); } self::$_byte_order = $byte_order; } diff --git a/Classes/PHPExcel/Writer/Excel5/Parser.php b/Classes/PHPExcel/Writer/Excel5/Parser.php index 4db7a87a..579fecfa 100644 --- a/Classes/PHPExcel/Writer/Excel5/Parser.php +++ b/Classes/PHPExcel/Writer/Excel5/Parser.php @@ -564,7 +564,7 @@ class PHPExcel_Writer_Excel5_Parser } // TODO: use real error codes - throw new PHPExcel_Reader_Exception("Unknown token $token"); + throw new PHPExcel_Writer_Exception("Unknown token $token"); } /** @@ -598,7 +598,7 @@ class PHPExcel_Writer_Excel5_Parser // chop away beggining and ending quotes $string = substr($string, 1, strlen($string) - 2); if (strlen($string) > 255) { - throw new PHPExcel_Reader_Exception("String is too long"); + throw new PHPExcel_Writer_Exception("String is too long"); } return pack('C', $this->ptg['ptgStr']) . PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($string); @@ -644,7 +644,7 @@ class PHPExcel_Writer_Excel5_Parser list($cell1, $cell2) = explode(':', $range); } else { // TODO: use real error codes - throw new PHPExcel_Reader_Exception("Unknown range separator"); + throw new PHPExcel_Writer_Exception("Unknown range separator"); } // Convert the cell references @@ -660,7 +660,7 @@ class PHPExcel_Writer_Excel5_Parser $ptgArea = pack("C", $this->ptg['ptgAreaA']); } else { // TODO: use real error codes - throw new PHPExcel_Reader_Exception("Unknown class $class"); + throw new PHPExcel_Writer_Exception("Unknown class $class"); } return $ptgArea . $row1 . $row2 . $col1. $col2; } @@ -702,7 +702,7 @@ class PHPExcel_Writer_Excel5_Parser // } elseif ($class == 2) { // $ptgArea = pack("C", $this->ptg['ptgArea3dA']); // } else { -// throw new PHPExcel_Reader_Exception("Unknown class $class"); +// throw new PHPExcel_Writer_Exception("Unknown class $class"); // } return $ptgArea . $ext_ref . $row1 . $row2 . $col1. $col2; @@ -732,7 +732,7 @@ class PHPExcel_Writer_Excel5_Parser $ptgRef = pack("C", $this->ptg['ptgRefA']); // } else { // // TODO: use real error codes -// throw new PHPExcel_Reader_Exception("Unknown class $class"); +// throw new PHPExcel_Writer_Exception("Unknown class $class"); // } return $ptgRef.$row.$col; } @@ -766,7 +766,7 @@ class PHPExcel_Writer_Excel5_Parser // } elseif ($class == 2) { $ptgRef = pack("C", $this->ptg['ptgRef3dA']); // } else { -// throw new PHPExcel_Reader_Exception("Unknown class $class"); +// throw new PHPExcel_Writer_Exception("Unknown class $class"); // } return $ptgRef . $ext_ref. $row . $col; @@ -812,11 +812,11 @@ class PHPExcel_Writer_Excel5_Parser $sheet1 = $this->_getSheetIndex($sheet_name1); if ($sheet1 == -1) { - throw new PHPExcel_Reader_Exception("Unknown sheet name $sheet_name1 in formula"); + throw new PHPExcel_Writer_Exception("Unknown sheet name $sheet_name1 in formula"); } $sheet2 = $this->_getSheetIndex($sheet_name2); if ($sheet2 == -1) { - throw new PHPExcel_Reader_Exception("Unknown sheet name $sheet_name2 in formula"); + throw new PHPExcel_Writer_Exception("Unknown sheet name $sheet_name2 in formula"); } // Reverse max and min sheet numbers if necessary @@ -826,7 +826,7 @@ class PHPExcel_Writer_Excel5_Parser } else { // Single sheet name only. $sheet1 = $this->_getSheetIndex($ext_ref); if ($sheet1 == -1) { - throw new PHPExcel_Reader_Exception("Unknown sheet name $ext_ref in formula"); + throw new PHPExcel_Writer_Exception("Unknown sheet name $ext_ref in formula"); } $sheet2 = $sheet1; } @@ -858,11 +858,11 @@ class PHPExcel_Writer_Excel5_Parser $sheet1 = $this->_getSheetIndex($sheet_name1); if ($sheet1 == -1) { - throw new PHPExcel_Reader_Exception("Unknown sheet name $sheet_name1 in formula"); + throw new PHPExcel_Writer_Exception("Unknown sheet name $sheet_name1 in formula"); } $sheet2 = $this->_getSheetIndex($sheet_name2); if ($sheet2 == -1) { - throw new PHPExcel_Reader_Exception("Unknown sheet name $sheet_name2 in formula"); + throw new PHPExcel_Writer_Exception("Unknown sheet name $sheet_name2 in formula"); } // Reverse max and min sheet numbers if necessary @@ -872,7 +872,7 @@ class PHPExcel_Writer_Excel5_Parser } else { // Single sheet name only. $sheet1 = $this->_getSheetIndex($ext_ref); if ($sheet1 == -1) { - throw new PHPExcel_Reader_Exception("Unknown sheet name $ext_ref in formula"); + throw new PHPExcel_Writer_Exception("Unknown sheet name $ext_ref in formula"); } $sheet2 = $sheet1; } @@ -942,10 +942,10 @@ class PHPExcel_Writer_Excel5_Parser $cell = strtoupper($cell); list($row, $col, $row_rel, $col_rel) = $this->_cellToRowcol($cell); if ($col >= 256) { - throw new PHPExcel_Reader_Exception("Column in: $cell greater than 255"); + throw new PHPExcel_Writer_Exception("Column in: $cell greater than 255"); } if ($row >= 65536) { - throw new PHPExcel_Reader_Exception("Row in: $cell greater than 65536 "); + throw new PHPExcel_Writer_Exception("Row in: $cell greater than 65536 "); } // Set the high bits to indicate if row or col are relative. @@ -983,7 +983,7 @@ class PHPExcel_Writer_Excel5_Parser // FIXME: this changes for BIFF8 if (($row1 >= 65536) or ($row2 >= 65536)) { - throw new PHPExcel_Reader_Exception("Row in: $range greater than 65536 "); + throw new PHPExcel_Writer_Exception("Row in: $range greater than 65536 "); } // Set the high bits to indicate if rows are relative. @@ -1372,7 +1372,7 @@ class PHPExcel_Writer_Excel5_Parser $this->_advance(); // eat the "(" $result = $this->_parenthesizedExpression(); if ($this->_current_token != ")") { - throw new PHPExcel_Reader_Exception("')' token expected."); + throw new PHPExcel_Writer_Exception("')' token expected."); } $this->_advance(); // eat the ")" return $result; @@ -1442,7 +1442,7 @@ class PHPExcel_Writer_Excel5_Parser $result = $this->_func(); return $result; } - throw new PHPExcel_Reader_Exception("Syntax error: ".$this->_current_token. + throw new PHPExcel_Writer_Exception("Syntax error: ".$this->_current_token. ", lookahead: ".$this->_lookahead. ", current char: ".$this->_current_char); } @@ -1469,7 +1469,7 @@ class PHPExcel_Writer_Excel5_Parser { $this->_advance(); // eat the "," or ";" } else { - throw new PHPExcel_Reader_Exception("Syntax error: comma expected in ". + throw new PHPExcel_Writer_Exception("Syntax error: comma expected in ". "function $function, arg #{$num_args}"); } $result2 = $this->_condition(); @@ -1481,12 +1481,12 @@ class PHPExcel_Writer_Excel5_Parser ++$num_args; } if (!isset($this->_functions[$function])) { - throw new PHPExcel_Reader_Exception("Function $function() doesn't exist"); + throw new PHPExcel_Writer_Exception("Function $function() doesn't exist"); } $args = $this->_functions[$function][1]; // If fixed number of args eg. TIME($i,$j,$k). Check that the number of args is valid. if (($args >= 0) and ($args != $num_args)) { - throw new PHPExcel_Reader_Exception("Incorrect number of arguments in function $function() "); + throw new PHPExcel_Writer_Exception("Incorrect number of arguments in function $function() "); } $result = $this->_createTree($function, $result, $num_args); diff --git a/Classes/PHPExcel/Writer/Excel5/Worksheet.php b/Classes/PHPExcel/Writer/Excel5/Worksheet.php index f9ae28a5..f7d097e9 100644 --- a/Classes/PHPExcel/Writer/Excel5/Worksheet.php +++ b/Classes/PHPExcel/Writer/Excel5/Worksheet.php @@ -2579,7 +2579,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter // Open file. $bmp_fd = @fopen($bitmap,"rb"); if (!$bmp_fd) { - throw new PHPExcel_Reader_Exception("Couldn't import $bitmap"); + throw new PHPExcel_Writer_Exception("Couldn't import $bitmap"); } // Slurp the file into a string. @@ -2587,13 +2587,13 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter // Check that the file is big enough to be a bitmap. if (strlen($data) <= 0x36) { - throw new PHPExcel_Reader_Exception("$bitmap doesn't contain enough data.\n"); + throw new PHPExcel_Writer_Exception("$bitmap doesn't contain enough data.\n"); } // The first 2 bytes are used to identify the bitmap. $identity = unpack("A2ident", $data); if ($identity['ident'] != "BM") { - throw new PHPExcel_Reader_Exception("$bitmap doesn't appear to be a valid bitmap image.\n"); + throw new PHPExcel_Writer_Exception("$bitmap doesn't appear to be a valid bitmap image.\n"); } // Remove bitmap data: ID. @@ -2617,20 +2617,20 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter $height = $width_and_height[2]; $data = substr($data, 8); if ($width > 0xFFFF) { - throw new PHPExcel_Reader_Exception("$bitmap: largest image width supported is 65k.\n"); + throw new PHPExcel_Writer_Exception("$bitmap: largest image width supported is 65k.\n"); } if ($height > 0xFFFF) { - throw new PHPExcel_Reader_Exception("$bitmap: largest image height supported is 65k.\n"); + throw new PHPExcel_Writer_Exception("$bitmap: largest image height supported is 65k.\n"); } // Read and remove the bitmap planes and bpp data. Verify them. $planes_and_bitcount = unpack("v2", substr($data, 0, 4)); $data = substr($data, 4); if ($planes_and_bitcount[2] != 24) { // Bitcount - throw new PHPExcel_Reader_Exception("$bitmap isn't a 24bit true color bitmap.\n"); + throw new PHPExcel_Writer_Exception("$bitmap isn't a 24bit true color bitmap.\n"); } if ($planes_and_bitcount[1] != 1) { - throw new PHPExcel_Reader_Exception("$bitmap: only 1 plane supported in bitmap image.\n"); + throw new PHPExcel_Writer_Exception("$bitmap: only 1 plane supported in bitmap image.\n"); } // Read and remove the bitmap compression. Verify compression. @@ -2639,7 +2639,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter //$compression = 0; if ($compression['comp'] != 0) { - throw new PHPExcel_Reader_Exception("$bitmap: compression not supported in bitmap image.\n"); + throw new PHPExcel_Writer_Exception("$bitmap: compression not supported in bitmap image.\n"); } // Remove bitmap data: data size, hres, vres, colours, imp. colours. @@ -2895,7 +2895,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter $formula1 = $this->_parser->toReversePolish(); $sz1 = strlen($formula1); - } catch(PHPExcel_Reader_Exception $e) { + } catch(PHPExcel_Writer_Exception $e) { $sz1 = 0; $formula1 = ''; } @@ -2906,13 +2906,13 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter try { $formula2 = $dataValidation->getFormula2(); if ($formula2 === '') { - throw new PHPExcel_Reader_Exception('No formula2'); + throw new PHPExcel_Writer_Exception('No formula2'); } $this->_parser->parse($formula2); $formula2 = $this->_parser->toReversePolish(); $sz2 = strlen($formula2); - } catch(PHPExcel_Reader_Exception $e) { + } catch(PHPExcel_Writer_Exception $e) { $sz2 = 0; $formula2 = ''; } diff --git a/Classes/PHPExcel/Writer/Exception.php b/Classes/PHPExcel/Writer/Exception.php index d50bf292..3cc055cf 100644 --- a/Classes/PHPExcel/Writer/Exception.php +++ b/Classes/PHPExcel/Writer/Exception.php @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Reader + * @package PHPExcel_Writer * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## @@ -30,7 +30,7 @@ * PHPExcel_Writer_Exception * * @category PHPExcel - * @package PHPExcel_Reader + * @package PHPExcel_Writer * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) */ class PHPExcel_Writer_Exception extends Exception { diff --git a/Classes/PHPExcel/Writer/PDF/Core.php b/Classes/PHPExcel/Writer/PDF/Core.php index f9008381..7c700b77 100644 --- a/Classes/PHPExcel/Writer/PDF/Core.php +++ b/Classes/PHPExcel/Writer/PDF/Core.php @@ -64,6 +64,13 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML protected $_paperSize = NULL; + /** + * Temporary storage for Save Array Return type + * + * @var string + */ + private $_saveArrayReturnType; + /** * Paper Sizes xRef List * @@ -313,7 +320,7 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML } /** - * Save PHPExcel to file, pre-save + * Save PHPExcel to PDF file, pre-save * * @param string $pFileName * @throws PHPExcel_Writer_Exception @@ -323,13 +330,13 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML // garbage collect $this->_phpExcel->garbageCollect(); - $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); + $this->_saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); // Open file $fileHandle = fopen($pFilename, 'w'); if ($fileHandle === FALSE) { - throw new PHPExcel_Reader_Exception("Could not open file $pFilename for writing."); + throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing."); } // Set PDF @@ -340,4 +347,18 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML return $fileHandle; } + /** + * Save PHPExcel to PDF file, post-save + * + * @param resource $fileHandle + * @throws PHPExcel_Writer_Exception + */ + protected function restoreStateAfterSave($fileHandle) + { + // Close file + fclose($fileHandle); + + PHPExcel_Calculation::setArrayReturnType($this->_saveArrayReturnType); + } + } diff --git a/Classes/PHPExcel/Writer/PDF/DomPDF.php b/Classes/PHPExcel/Writer/PDF/DomPDF.php index d03b758c..5abd0a3c 100644 --- a/Classes/PHPExcel/Writer/PDF/DomPDF.php +++ b/Classes/PHPExcel/Writer/PDF/DomPDF.php @@ -31,7 +31,7 @@ $pdfRendererClassFile = PHPExcel_Settings::getPdfRendererPath() . '/dompdf_confi if (file_exists($pdfRendererClassFile)) { require_once $pdfRendererClassFile; } else { - throw new PHPExcel_Reader_Exception('Unable to load PDF Rendering library'); + throw new PHPExcel_Writer_Exception('Unable to load PDF Rendering library'); } /** @@ -114,10 +114,7 @@ class PHPExcel_Writer_PDF_DomPDF extends PHPExcel_Writer_PDF_Core implements PHP // Write to file fwrite($fileHandle, $pdf->output()); - // Close file - fclose($fileHandle); - - PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType); + parent::restoreStateAfterSave($fileHandle); } } diff --git a/Classes/PHPExcel/Writer/PDF/mPDF.php b/Classes/PHPExcel/Writer/PDF/mPDF.php index 53dd9122..a9b6b0fc 100644 --- a/Classes/PHPExcel/Writer/PDF/mPDF.php +++ b/Classes/PHPExcel/Writer/PDF/mPDF.php @@ -31,7 +31,7 @@ $pdfRendererClassFile = PHPExcel_Settings::getPdfRendererPath() . '/mpdf.php'; if (file_exists($pdfRendererClassFile)) { require_once $pdfRendererClassFile; } else { - throw new PHPExcel_Reader_Exception('Unable to load PDF Rendering library'); + throw new PHPExcel_Writer_Exception('Unable to load PDF Rendering library'); } /** @@ -124,10 +124,7 @@ class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPEx // Write to file fwrite($fileHandle, $pdf->Output('', 'S')); - // Close file - fclose($fileHandle); - - PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType); + parent::restoreStateAfterSave($fileHandle); } } diff --git a/Classes/PHPExcel/Writer/PDF/tcPDF.php b/Classes/PHPExcel/Writer/PDF/tcPDF.php index 4119af87..23a6e315 100644 --- a/Classes/PHPExcel/Writer/PDF/tcPDF.php +++ b/Classes/PHPExcel/Writer/PDF/tcPDF.php @@ -32,7 +32,7 @@ if (file_exists($pdfRendererClassFile)) { $k_path_url = PHPExcel_Settings::getPdfRendererPath(); require_once $pdfRendererClassFile; } else { - throw new PHPExcel_Reader_Exception('Unable to load PDF Rendering library'); + throw new PHPExcel_Writer_Exception('Unable to load PDF Rendering library'); } /** @@ -130,10 +130,7 @@ class PHPExcel_Writer_PDF_tcPDF extends PHPExcel_Writer_PDF_Core implements PHPE // Write to file fwrite($fileHandle, $pdf->output($pFilename, 'S')); - // Close file - fclose($fileHandle); - - PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType); + parent::restoreStateAfterSave($fileHandle); } }