diff --git a/Classes/PHPExcel/Worksheet.php b/Classes/PHPExcel/Worksheet.php index 8964dff5..52711229 100644 --- a/Classes/PHPExcel/Worksheet.php +++ b/Classes/PHPExcel/Worksheet.php @@ -1033,7 +1033,7 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable /** * Set a cell value by using numeric cell coordinates * - * @param string $pColumn Numeric column coordinate of the cell + * @param string $pColumn Numeric column coordinate of the cell (A = 0) * @param string $pRow Numeric row coordinate of the cell * @param mixed $pValue Value of the cell * @param bool $returnCell Return the worksheet (false, default) or the cell (true) diff --git a/Classes/PHPExcel/Writer/CSV.php b/Classes/PHPExcel/Writer/CSV.php index 212676cf..be9761f3 100644 --- a/Classes/PHPExcel/Writer/CSV.php +++ b/Classes/PHPExcel/Writer/CSV.php @@ -103,7 +103,7 @@ class PHPExcel_Writer_CSV implements PHPExcel_Writer_IWriter { * Save PHPExcel to file * * @param string $pFilename - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function save($pFilename = null) { // Fetch sheet @@ -117,7 +117,7 @@ class PHPExcel_Writer_CSV implements PHPExcel_Writer_IWriter { // Open file $fileHandle = fopen($pFilename, 'wb+'); if ($fileHandle === false) { - throw new Exception("Could not open file $pFilename for writing."); + throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing."); } if ($this->_excelCompatibility) { @@ -278,7 +278,7 @@ class PHPExcel_Writer_CSV implements PHPExcel_Writer_IWriter { * * @param mixed $pFileHandle PHP filehandle * @param array $pValues Array containing values in a row - * @throws Exception + * @throws PHPExcel_Writer_Exception */ private function _writeLine($pFileHandle = null, $pValues = null) { if (is_array($pValues)) { @@ -313,7 +313,7 @@ class PHPExcel_Writer_CSV implements PHPExcel_Writer_IWriter { fwrite($pFileHandle, $line); } } else { - throw new Exception("Invalid data row passed to CSV writer."); + throw new PHPExcel_Writer_Exception("Invalid data row passed to CSV writer."); } } diff --git a/Classes/PHPExcel/Writer/Excel2007.php b/Classes/PHPExcel/Writer/Excel2007.php index acf6072f..e2ec139c 100644 --- a/Classes/PHPExcel/Writer/Excel2007.php +++ b/Classes/PHPExcel/Writer/Excel2007.php @@ -191,7 +191,7 @@ class PHPExcel_Writer_Excel2007 implements PHPExcel_Writer_IWriter * Save PHPExcel to file * * @param string $pFilename - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function save($pFilename = null) { @@ -245,7 +245,7 @@ class PHPExcel_Writer_Excel2007 implements PHPExcel_Writer_IWriter // Try opening the ZIP file if ($objZip->open($pFilename, $zipOverWrite) !== true) { if ($objZip->open($pFilename, $zipCreate) !== true) { - throw new Exception("Could not open " . $pFilename . " for writing."); + throw new PHPExcel_Writer_Exception("Could not open " . $pFilename . " for writing."); } } @@ -375,18 +375,18 @@ class PHPExcel_Writer_Excel2007 implements PHPExcel_Writer_IWriter // Close file if ($objZip->close() === false) { - throw new Exception("Could not close zip file $pFilename."); + throw new PHPExcel_Writer_Exception("Could not close zip file $pFilename."); } // If a temporary file was used, copy it to the correct file stream if ($originalFilename != $pFilename) { if (copy($pFilename, $originalFilename) === false) { - throw new Exception("Could not copy temporary zip file $pFilename to $originalFilename."); + throw new PHPExcel_Writer_Exception("Could not copy temporary zip file $pFilename to $originalFilename."); } @unlink($pFilename); } } else { - throw new Exception("PHPExcel object unassigned."); + throw new PHPExcel_Writer_Exception("PHPExcel object unassigned."); } } @@ -394,13 +394,13 @@ class PHPExcel_Writer_Excel2007 implements PHPExcel_Writer_IWriter * Get PHPExcel object * * @return PHPExcel - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function getPHPExcel() { if ($this->_spreadSheet !== null) { return $this->_spreadSheet; } else { - throw new Exception("No PHPExcel assigned."); + throw new PHPExcel_Writer_Exception("No PHPExcel assigned."); } } @@ -408,7 +408,7 @@ class PHPExcel_Writer_Excel2007 implements PHPExcel_Writer_IWriter * Set PHPExcel object * * @param PHPExcel $pPHPExcel PHPExcel object - * @throws Exception + * @throws PHPExcel_Writer_Exception * @return PHPExcel_Writer_Excel2007 */ public function setPHPExcel(PHPExcel $pPHPExcel = null) { @@ -556,7 +556,7 @@ class PHPExcel_Writer_Excel2007 implements PHPExcel_Writer_IWriter * * @param boolean $pValue * @param string $pDirectory Disk caching directory - * @throws Exception Exception when directory does not exist + * @throws PHPExcel_Writer_Exception Exception when directory does not exist * @return PHPExcel_Writer_Excel2007 */ public function setUseDiskCaching($pValue = false, $pDirectory = null) { @@ -566,7 +566,7 @@ class PHPExcel_Writer_Excel2007 implements PHPExcel_Writer_IWriter if (is_dir($pDirectory)) { $this->_diskCachingDirectory = $pDirectory; } else { - throw new Exception("Directory does not exist: $pDirectory"); + throw new PHPExcel_Writer_Exception("Directory does not exist: $pDirectory"); } } return $this; diff --git a/Classes/PHPExcel/Writer/Excel2007/Chart.php b/Classes/PHPExcel/Writer/Excel2007/Chart.php index 6459c74b..2b858d4c 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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception('Chart is not yet implemented'); + throw new PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_Exception */ private function _writePrintSettings($objWriter) { diff --git a/Classes/PHPExcel/Writer/Excel2007/Comments.php b/Classes/PHPExcel/Writer/Excel2007/Comments.php index 4c6a9f7a..5859896b 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Comments.php +++ b/Classes/PHPExcel/Writer/Excel2007/Comments.php @@ -40,7 +40,7 @@ class PHPExcel_Writer_Excel2007_Comments extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel_Worksheet $pWorksheet * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function writeComments(PHPExcel_Worksheet $pWorksheet = null) { @@ -98,7 +98,7 @@ class PHPExcel_Writer_Excel2007_Comments extends PHPExcel_Writer_Excel2007_Write * @param string $pCellReference Cell reference * @param PHPExcel_Comment $pComment Comment * @param array $pAuthors Array of authors - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function _writeComment(PHPExcel_Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', PHPExcel_Comment $pComment = null, $pAuthors = null) { @@ -120,7 +120,7 @@ class PHPExcel_Writer_Excel2007_Comments extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel_Worksheet $pWorksheet * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function writeVMLComments(PHPExcel_Worksheet $pWorksheet = null) { @@ -193,7 +193,7 @@ class PHPExcel_Writer_Excel2007_Comments extends PHPExcel_Writer_Excel2007_Write * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param string $pCellReference Cell reference * @param PHPExcel_Comment $pComment Comment - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function _writeVMLComment(PHPExcel_Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', PHPExcel_Comment $pComment = null) { diff --git a/Classes/PHPExcel/Writer/Excel2007/ContentTypes.php b/Classes/PHPExcel/Writer/Excel2007/ContentTypes.php index d701a76c..a9b1dd92 100644 --- a/Classes/PHPExcel/Writer/Excel2007/ContentTypes.php +++ b/Classes/PHPExcel/Writer/Excel2007/ContentTypes.php @@ -41,7 +41,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W * @param PHPExcel $pPHPExcel * @param boolean $includeCharts Flag indicating if we should include drawing details for charts * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function writeContentTypes(PHPExcel $pPHPExcel = null, $includeCharts = FALSE) { @@ -205,7 +205,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W * * @param string $pFile Filename * @return string Mime Type - * @throws Exception + * @throws PHPExcel_Writer_Exception */ private function _getImageMimeType($pFile = '') { @@ -213,7 +213,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W $image = getimagesize($pFile); return image_type_to_mime_type($image[2]); } else { - throw new Exception("File $pFile does not exist"); + throw new PHPExcel_Writer_Exception("File $pFile does not exist"); } } @@ -223,7 +223,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param string $pPartname Part name * @param string $pContentType Content type - * @throws Exception + * @throws PHPExcel_Writer_Exception */ private function _writeDefaultContentType(PHPExcel_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') { @@ -234,7 +234,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W $objWriter->writeAttribute('ContentType', $pContentType); $objWriter->endElement(); } else { - throw new Exception("Invalid parameters passed."); + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); } } @@ -244,7 +244,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param string $pPartname Part name * @param string $pContentType Content type - * @throws Exception + * @throws PHPExcel_Writer_Exception */ private function _writeOverrideContentType(PHPExcel_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') { @@ -255,7 +255,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W $objWriter->writeAttribute('ContentType', $pContentType); $objWriter->endElement(); } else { - throw new Exception("Invalid parameters passed."); + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); } } } diff --git a/Classes/PHPExcel/Writer/Excel2007/DocProps.php b/Classes/PHPExcel/Writer/Excel2007/DocProps.php index ee0fa748..67ad72df 100644 --- a/Classes/PHPExcel/Writer/Excel2007/DocProps.php +++ b/Classes/PHPExcel/Writer/Excel2007/DocProps.php @@ -40,7 +40,7 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel $pPHPExcel * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function writeDocPropsApp(PHPExcel $pPHPExcel = null) { @@ -137,7 +137,7 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel $pPHPExcel * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function writeDocPropsCore(PHPExcel $pPHPExcel = null) { @@ -204,7 +204,7 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write * * @param PHPExcel $pPHPExcel * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function writeDocPropsCustom(PHPExcel $pPHPExcel = null) { diff --git a/Classes/PHPExcel/Writer/Excel2007/Drawing.php b/Classes/PHPExcel/Writer/Excel2007/Drawing.php index 71d6561e..fbb35566 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Drawing.php +++ b/Classes/PHPExcel/Writer/Excel2007/Drawing.php @@ -42,7 +42,7 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer * @param int &$chartRef Chart ID * @param boolean $includeCharts Flag indicating if we should include drawing details for charts * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function writeDrawings(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = FALSE) { @@ -95,7 +95,7 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Chart $pChart * @param int $pRelationId - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function _writeChart(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Chart $pChart = null, $pRelationId = -1) { @@ -167,7 +167,7 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param PHPExcel_Worksheet_BaseDrawing $pDrawing * @param int $pRelationId - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function _writeDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet_BaseDrawing $pDrawing = null, $pRelationId = -1) { @@ -375,7 +375,7 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer $objWriter->endElement(); } else { - throw new Exception("Invalid parameters passed."); + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); } } @@ -384,7 +384,7 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer * * @param PHPExcel_Worksheet $pWorksheet * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function writeVMLHeaderFooterImages(PHPExcel_Worksheet $pWorksheet = null) { @@ -532,7 +532,7 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param string $pReference Reference * @param PHPExcel_Worksheet_HeaderFooterDrawing $pImage Image - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function _writeVMLHeaderFooterImage(PHPExcel_Shared_XMLWriter $objWriter = null, $pReference = '', PHPExcel_Worksheet_HeaderFooterDrawing $pImage = null) { @@ -574,7 +574,7 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer * * @param PHPExcel $pPHPExcel * @return PHPExcel_Worksheet_Drawing[] All drawings in PHPExcel - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function allDrawings(PHPExcel $pPHPExcel = null) { diff --git a/Classes/PHPExcel/Writer/Excel2007/Rels.php b/Classes/PHPExcel/Writer/Excel2007/Rels.php index 5a1271c0..f21bcea2 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Rels.php +++ b/Classes/PHPExcel/Writer/Excel2007/Rels.php @@ -40,7 +40,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar * * @param PHPExcel $pPHPExcel * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function writeRelationships(PHPExcel $pPHPExcel = null) { @@ -106,7 +106,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar * * @param PHPExcel $pPHPExcel * @return string XML Output - * @throws Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception("Invalid parameters passed."); + throw new PHPExcel_Reader_Exception("Invalid parameters passed."); } } } diff --git a/Classes/PHPExcel/Writer/Excel2007/StringTable.php b/Classes/PHPExcel/Writer/Excel2007/StringTable.php index ee77be4f..ade877cb 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 Exception + * @throws PHPExcel_Reader_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 Exception("Invalid PHPExcel_Worksheet object passed."); + throw new PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception("Invalid string table array passed."); + throw new PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 b980a167..9740b760 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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_Exception */ public function allNumberFormats(PHPExcel $pPHPExcel = null) { diff --git a/Classes/PHPExcel/Writer/Excel2007/Theme.php b/Classes/PHPExcel/Writer/Excel2007/Theme.php index 2ebdf575..d408b2f2 100644 --- a/Classes/PHPExcel/Writer/Excel2007/Theme.php +++ b/Classes/PHPExcel/Writer/Excel2007/Theme.php @@ -134,7 +134,7 @@ class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel $pPHPExcel * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function writeTheme(PHPExcel $pPHPExcel = null) { @@ -820,7 +820,7 @@ class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPa * @param string $latinFont * @param array of string $fontSet * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ private function _writeFonts($objWriter, $latinFont, $fontSet) { @@ -853,7 +853,7 @@ class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPa * * @param PHPExcel_Shared_XMLWriter $objWriter * @return string XML Output - * @throws Exception + * @throws PHPExcel_Writer_Exception */ private function _writeColourScheme($objWriter) { diff --git a/Classes/PHPExcel/Writer/Excel2007/Workbook.php b/Classes/PHPExcel/Writer/Excel2007/Workbook.php index eefe7f10..87ad0596 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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception("Invalid parameters passed."); + throw new PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 0ea07d20..37ae3fc8 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 Exception + * @throws PHPExcel_Reader_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 Exception("Invalid PHPExcel_Worksheet object passed."); + throw new PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception("Invalid parameters passed."); + throw new PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception("Invalid parameters passed."); + throw new PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_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 20c375a1..338d07e7 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 Exception + * @throws PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_Exception */ public function getParentWriter() { if (!is_null($this->_parentWriter)) { return $this->_parentWriter; } else { - throw new Exception("No parent PHPExcel_Writer_IWriter assigned."); + throw new PHPExcel_Reader_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 Exception + * @throws PHPExcel_Reader_Exception */ public function __construct(PHPExcel_Writer_IWriter $pWriter = null) { if (!is_null($pWriter)) { diff --git a/Classes/PHPExcel/Writer/Excel5.php b/Classes/PHPExcel/Writer/Excel5.php index c2f78cc6..609df7be 100644 --- a/Classes/PHPExcel/Writer/Excel5.php +++ b/Classes/PHPExcel/Writer/Excel5.php @@ -120,7 +120,7 @@ class PHPExcel_Writer_Excel5 implements PHPExcel_Writer_IWriter * Save PHPExcel to file * * @param string $pFilename - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function save($pFilename = null) { @@ -241,7 +241,7 @@ class PHPExcel_Writer_Excel5 implements PHPExcel_Writer_IWriter * * @deprecated * @param string $pValue Temporary storage directory - * @throws Exception Exception when directory does not exist + * @throws PHPExcel_Writer_Exception Exception when directory does not exist * @return PHPExcel_Writer_Excel5 */ public function setTempDir($pValue = '') { diff --git a/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php b/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php index 33206082..77765219 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 Exception("Required floating point format not supported on this platform."); + throw new PHPExcel_Reader_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 baf74082..4db7a87a 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 Exception("Unknown token $token"); + throw new PHPExcel_Reader_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 Exception("String is too long"); + throw new PHPExcel_Reader_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 Exception("Unknown range separator"); + throw new PHPExcel_Reader_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 Exception("Unknown class $class"); + throw new PHPExcel_Reader_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 Exception("Unknown class $class"); +// throw new PHPExcel_Reader_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 Exception("Unknown class $class"); +// throw new PHPExcel_Reader_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 Exception("Unknown class $class"); +// throw new PHPExcel_Reader_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 Exception("Unknown sheet name $sheet_name1 in formula"); + throw new PHPExcel_Reader_Exception("Unknown sheet name $sheet_name1 in formula"); } $sheet2 = $this->_getSheetIndex($sheet_name2); if ($sheet2 == -1) { - throw new Exception("Unknown sheet name $sheet_name2 in formula"); + throw new PHPExcel_Reader_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 Exception("Unknown sheet name $ext_ref in formula"); + throw new PHPExcel_Reader_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 Exception("Unknown sheet name $sheet_name1 in formula"); + throw new PHPExcel_Reader_Exception("Unknown sheet name $sheet_name1 in formula"); } $sheet2 = $this->_getSheetIndex($sheet_name2); if ($sheet2 == -1) { - throw new Exception("Unknown sheet name $sheet_name2 in formula"); + throw new PHPExcel_Reader_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 Exception("Unknown sheet name $ext_ref in formula"); + throw new PHPExcel_Reader_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 Exception("Column in: $cell greater than 255"); + throw new PHPExcel_Reader_Exception("Column in: $cell greater than 255"); } if ($row >= 65536) { - throw new Exception("Row in: $cell greater than 65536 "); + throw new PHPExcel_Reader_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 Exception("Row in: $range greater than 65536 "); + throw new PHPExcel_Reader_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 Exception("')' token expected."); + throw new PHPExcel_Reader_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 Exception("Syntax error: ".$this->_current_token. + throw new PHPExcel_Reader_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 Exception("Syntax error: comma expected in ". + throw new PHPExcel_Reader_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 Exception("Function $function() doesn't exist"); + throw new PHPExcel_Reader_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 Exception("Incorrect number of arguments in function $function() "); + throw new PHPExcel_Reader_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 d6d6c214..f9ae28a5 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 Exception("Couldn't import $bitmap"); + throw new PHPExcel_Reader_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 Exception("$bitmap doesn't contain enough data.\n"); + throw new PHPExcel_Reader_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 Exception("$bitmap doesn't appear to be a valid bitmap image.\n"); + throw new PHPExcel_Reader_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 Exception("$bitmap: largest image width supported is 65k.\n"); + throw new PHPExcel_Reader_Exception("$bitmap: largest image width supported is 65k.\n"); } if ($height > 0xFFFF) { - throw new Exception("$bitmap: largest image height supported is 65k.\n"); + throw new PHPExcel_Reader_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 Exception("$bitmap isn't a 24bit true color bitmap.\n"); + throw new PHPExcel_Reader_Exception("$bitmap isn't a 24bit true color bitmap.\n"); } if ($planes_and_bitcount[1] != 1) { - throw new Exception("$bitmap: only 1 plane supported in bitmap image.\n"); + throw new PHPExcel_Reader_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 Exception("$bitmap: compression not supported in bitmap image.\n"); + throw new PHPExcel_Reader_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(Exception $e) { + } catch(PHPExcel_Reader_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 Exception('No formula2'); + throw new PHPExcel_Reader_Exception('No formula2'); } $this->_parser->parse($formula2); $formula2 = $this->_parser->toReversePolish(); $sz2 = strlen($formula2); - } catch(Exception $e) { + } catch(PHPExcel_Reader_Exception $e) { $sz2 = 0; $formula2 = ''; } diff --git a/Classes/PHPExcel/Writer/Exception.php b/Classes/PHPExcel/Writer/Exception.php new file mode 100644 index 00000000..d50bf292 --- /dev/null +++ b/Classes/PHPExcel/Writer/Exception.php @@ -0,0 +1,52 @@ +line = $line; + $e->file = $file; + throw $e; + } +} diff --git a/Classes/PHPExcel/Writer/HTML.php b/Classes/PHPExcel/Writer/HTML.php index 52af1727..15aedc06 100644 --- a/Classes/PHPExcel/Writer/HTML.php +++ b/Classes/PHPExcel/Writer/HTML.php @@ -146,7 +146,7 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { * Save PHPExcel to file * * @param string $pFilename - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function save($pFilename = null) { // garbage collect @@ -163,7 +163,7 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { // Open file $fileHandle = fopen($pFilename, 'wb+'); if ($fileHandle === false) { - throw new Exception("Could not open file $pFilename for writing."); + throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing."); } // Write headers @@ -300,12 +300,12 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { * * @param boolean $pIncludeStyles Include styles? * @return string - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function generateHTMLHeader($pIncludeStyles = false) { // PHPExcel object known? if (is_null($this->_phpExcel)) { - throw new Exception('Internal PHPExcel object not set to an instance of an object.'); + throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.'); } // Construct HTML @@ -351,12 +351,12 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { * Generate sheet data * * @return string - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function generateSheetData() { // PHPExcel object known? if (is_null($this->_phpExcel)) { - throw new Exception('Internal PHPExcel object not set to an instance of an object.'); + throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.'); } // Ensure that Spans have been calculated? @@ -470,13 +470,13 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { * Generate sheet tabs * * @return string - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function generateNavigation() { // PHPExcel object known? if (is_null($this->_phpExcel)) { - throw new Exception('Internal PHPExcel object not set to an instance of an object.'); + throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.'); } // Fetch sheets @@ -514,7 +514,7 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { * @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet * @param string $coordinates Cell coordinates * @return string - * @throws Exception + * @throws PHPExcel_Writer_Exception */ private function _writeImageTagInCell(PHPExcel_Worksheet $pSheet, $coordinates) { // Construct HTML @@ -557,12 +557,12 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { * * @param boolean $generateSurroundingHTML Generate surrounding HTML tags? () * @return string - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function generateStyles($generateSurroundingHTML = true) { // PHPExcel object known? if (is_null($this->_phpExcel)) { - throw new Exception('Internal PHPExcel object not set to an instance of an object.'); + throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.'); } // Build CSS @@ -598,12 +598,12 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { * * @param boolean $generateSurroundingHTML Generate surrounding HTML style? (html { }) * @return array - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function buildCSS($generateSurroundingHTML = true) { // PHPExcel object known? if (is_null($this->_phpExcel)) { - throw new Exception('Internal PHPExcel object not set to an instance of an object.'); + throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.'); } // Cached? @@ -894,7 +894,7 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { * * @param PHPExcel_Worksheet $pSheet The worksheet for the table we are writing * @return string - * @throws Exception + * @throws PHPExcel_Writer_Exception */ private function _generateTableHeader($pSheet) { $sheetIndex = $pSheet->getParent()->getIndex($pSheet); @@ -938,7 +938,7 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { /** * Generate table footer * - * @throws Exception + * @throws PHPExcel_Writer_Exception */ private function _generateTableFooter() { // Construct HTML @@ -956,7 +956,7 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { * @param array $pValues Array containing cells in a row * @param int $pRow Row number (0-based) * @return string - * @throws Exception + * @throws PHPExcel_Writer_Exception */ private function _generateRow(PHPExcel_Worksheet $pSheet, $pValues = null, $pRow = 0) { if (is_array($pValues)) { @@ -1172,7 +1172,7 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { // Return return $html; } else { - throw new Exception("Invalid parameters passed."); + throw new PHPExcel_Writer_Exception("Invalid parameters passed."); } } diff --git a/Classes/PHPExcel/Writer/IWriter.php b/Classes/PHPExcel/Writer/IWriter.php index 28ab4198..ac95bb13 100644 --- a/Classes/PHPExcel/Writer/IWriter.php +++ b/Classes/PHPExcel/Writer/IWriter.php @@ -39,7 +39,7 @@ interface PHPExcel_Writer_IWriter * Save PHPExcel to file * * @param string $pFilename - * @throws Exception + * @throws PHPExcel_Writer_Exception */ public function save($pFilename = null); } diff --git a/Classes/PHPExcel/Writer/PDF.php b/Classes/PHPExcel/Writer/PDF.php index 966364a1..ad418c8f 100644 --- a/Classes/PHPExcel/Writer/PDF.php +++ b/Classes/PHPExcel/Writer/PDF.php @@ -41,17 +41,18 @@ class PHPExcel_Writer_PDF { * Create a new PHPExcel_Writer_PDF * * @param PHPExcel $phpExcel PHPExcel object + * @throws PHPExcel_Writer_Exception Exception when directory does not exist */ public function __construct(PHPExcel $phpExcel) { $pdfLibraryName = PHPExcel_Settings::getPdfRendererName(); if (is_null($pdfLibraryName)) { - throw new Exception("PDF Rendering library has not been defined."); + throw new PHPExcel_Writer_Exception("PDF Rendering library has not been defined."); } $pdfLibraryPath = PHPExcel_Settings::getPdfRendererPath(); if (is_null($pdfLibraryName)) { - throw new Exception("PDF Rendering library path has not been defined."); + throw new PHPExcel_Writer_Exception("PDF Rendering library path has not been defined."); } $includePath = str_replace('\\','/',get_include_path()); $rendererPath = str_replace('\\','/',$pdfLibraryPath); @@ -67,7 +68,7 @@ class PHPExcel_Writer_PDF { public function __call($name, $arguments) { if ($this->_renderer === NULL) { - throw new Exception("PDF Renderer has not been defined."); + throw new PHPExcel_Writer_Exception("PDF Renderer has not been defined."); } return call_user_func_array(array($this->_renderer,$name),$arguments); diff --git a/Classes/PHPExcel/Writer/PDF/Core.php b/Classes/PHPExcel/Writer/PDF/Core.php index f82be0f0..adc449e5 100644 --- a/Classes/PHPExcel/Writer/PDF/Core.php +++ b/Classes/PHPExcel/Writer/PDF/Core.php @@ -225,14 +225,14 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML { * Set temporary storage directory * * @param string $pValue Temporary storage directory - * @throws Exception Exception when directory does not exist + * @throws PHPExcel_Writer_Exception Exception when directory does not exist * @return PHPExcel_Writer_PDF */ public function setTempDir($pValue = '') { if (is_dir($pValue)) { $this->_tempDir = $pValue; } else { - throw new Exception("Directory does not exist: $pValue"); + throw new PHPExcel_Writer_Exception("Directory does not exist: $pValue"); } return $this; } diff --git a/Classes/PHPExcel/Writer/PDF/DomPDF.php b/Classes/PHPExcel/Writer/PDF/DomPDF.php index 7522b27c..f30508ef 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 Exception('Unable to load PDF Rendering library'); + throw new PHPExcel_Reader_Exception('Unable to load PDF Rendering library'); } /** @@ -55,7 +55,7 @@ class PHPExcel_Writer_PDF_DomPDF extends PHPExcel_Writer_PDF_Core implements PHP * Save PHPExcel to file * * @param string $pFileName - * @throws Exception + * @throws PHPExcel_Reader_Exception */ public function save($pFilename = null) { // garbage collect @@ -67,7 +67,7 @@ class PHPExcel_Writer_PDF_DomPDF extends PHPExcel_Writer_PDF_Core implements PHP // Open file $fileHandle = fopen($pFilename, 'w'); if ($fileHandle === false) { - throw new Exception("Could not open file $pFilename for writing."); + throw new PHPExcel_Reader_Exception("Could not open file $pFilename for writing."); } // Set PDF diff --git a/Classes/PHPExcel/Writer/PDF/mPDF.php b/Classes/PHPExcel/Writer/PDF/mPDF.php index 5ecf609e..2c807d74 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 Exception('Unable to load PDF Rendering library'); + throw new PHPExcel_Reader_Exception('Unable to load PDF Rendering library'); } /** @@ -55,7 +55,7 @@ class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPEx * Save PHPExcel to file * * @param string $pFileName - * @throws Exception + * @throws PHPExcel_Reader_Exception */ public function save($pFilename = null) { // garbage collect @@ -67,7 +67,7 @@ class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPEx // Open file $fileHandle = fopen($pFilename, 'w'); if ($fileHandle === false) { - throw new Exception("Could not open file $pFilename for writing."); + throw new PHPExcel_Reader_Exception("Could not open file $pFilename for writing."); } // Set PDF @@ -108,8 +108,11 @@ class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPEx // Create PDF $pdf = new mpdf(); - $pdf->_setPageSize(strtoupper($paperSize), $orientation); + $ortmp = $orientation; + $pdf->_setPageSize(strtoupper($paperSize), $ortmp); $pdf->DefOrientation = $orientation; + $pdf->AddPage($orientation); + // Document info $pdf->SetTitle($this->_phpExcel->getProperties()->getTitle()); $pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator()); diff --git a/Classes/PHPExcel/Writer/PDF/tcPDF.php b/Classes/PHPExcel/Writer/PDF/tcPDF.php index 08e7ca78..821a8493 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 Exception('Unable to load PDF Rendering library'); + throw new PHPExcel_Reader_Exception('Unable to load PDF Rendering library'); } /** @@ -56,7 +56,7 @@ class PHPExcel_Writer_PDF_tcPDF extends PHPExcel_Writer_PDF_Core implements PHPE * Save PHPExcel to file * * @param string $pFileName - * @throws Exception + * @throws PHPExcel_Reader_Exception */ public function save($pFilename = null) { // garbage collect @@ -68,7 +68,7 @@ class PHPExcel_Writer_PDF_tcPDF extends PHPExcel_Writer_PDF_Core implements PHPE // Open file $fileHandle = fopen($pFilename, 'w'); if ($fileHandle === false) { - throw new Exception("Could not open file $pFilename for writing."); + throw new PHPExcel_Reader_Exception("Could not open file $pFilename for writing."); } // Set PDF diff --git a/Examples/02types-xls.php b/Examples/02types-xls.php index ba84d6a2..8e4f0ab5 100644 --- a/Examples/02types-xls.php +++ b/Examples/02types-xls.php @@ -106,6 +106,10 @@ $objPHPExcel->getActiveSheet()->setCellValue('A11', 'Date/Time') ->setCellValue('C11', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow )); $objPHPExcel->getActiveSheet()->getStyle('C11')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_DATETIME); +$objPHPExcel->getActiveSheet()->setCellValue('A12', 'NULL') + ->setCellValue('C12', NULL); + + $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true); diff --git a/Examples/02types.php b/Examples/02types.php index fcfd6778..76ef427f 100644 --- a/Examples/02types.php +++ b/Examples/02types.php @@ -106,7 +106,11 @@ $objPHPExcel->getActiveSheet()->setCellValue('A11', 'Date/Time') ->setCellValue('C11', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow )); $objPHPExcel->getActiveSheet()->getStyle('C11')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_DATETIME); -$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true); +$objPHPExcel->getActiveSheet()->setCellValue('A12', 'NULL') + ->setCellValue('C12', NULL); + + + $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true); // Rename worksheet diff --git a/Examples/21pdf.php b/Examples/21pdf.php index 5cac43c3..2271f5ba 100644 --- a/Examples/21pdf.php +++ b/Examples/21pdf.php @@ -43,11 +43,11 @@ require_once '../Classes/PHPExcel/IOFactory.php'; // Change these values to select the Rendering library that you wish to use // and its directory location on your server -//$rendererName = PHPExcel_Settings::PDF_RENDERER_MPDF; -$rendererName = PHPExcel_Settings::PDF_RENDERER_DOMPDF; +$rendererName = PHPExcel_Settings::PDF_RENDERER_MPDF; +//$rendererName = PHPExcel_Settings::PDF_RENDERER_DOMPDF; //$rendererLibrary = 'tcPDF5.9'; -//$rendererLibrary = 'mPDF5.4'; -$rendererLibrary = 'domPDF0.6.0beta3'; +$rendererLibrary = 'mPDF5.4'; +//$rendererLibrary = 'domPDF0.6.0beta3'; $rendererLibraryPath = '/php/libraries/PDF/' . $rendererLibrary; diff --git a/changelog.txt b/changelog.txt index 2ba004a6..c790b200 100644 --- a/changelog.txt +++ b/changelog.txt @@ -26,9 +26,10 @@ Fixed in develop branch: - Bugfix: (Asker) Work item 18777 - Error in PHPEXCEL/Calculation.php script on line 2976 (stack pop check) - Bugfix: (MBaker) Work item 18794 - CSV files without a file extension being identified as HTML -- Bugfix: (MBaker) Work item GH-66 - Wrong check for maximum number of rows in Excel5 Writer -- General: (kea) Improved AdvancedValueBinder for currency +- Bugfix: (AndreKR) Work item GH-66 - Wrong check for maximum number of rows in Excel5 Writer +- General: (kea) Work item GH-69 - Improved AdvancedValueBinder for currency - Bugfix: (techhead) Work item GH-70 - Fixed formula/formatting bug when removing rows +- Bugfix: (alexgann) Work item GH-63 - Fix to cellExists for non-existent namedRanges --------------------------------------------------------------------------------