[TASK] Namespaced /Writer/ Classes
This commit is contained in:
parent
ed087dd396
commit
daf2482dd6
|
@ -27,7 +27,7 @@ namespace PHPExcel\Writer;
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class Excel2007 extends BaseWriter implements IWriter
|
class Excel2007 implements IWriter
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Pre-calculate formulas
|
* Pre-calculate formulas
|
||||||
|
@ -76,9 +76,9 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
private $stylesConditionalHashTable;
|
private $stylesConditionalHashTable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private unique PHPExcel_Style HashTable
|
* Private unique \PHPExcel\Style HashTable
|
||||||
*
|
*
|
||||||
* @var PHPExcel_HashTable
|
* @var \PHPExcel\HashTable
|
||||||
*/
|
*/
|
||||||
private $styleHashTable;
|
private $styleHashTable;
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
/**
|
/**
|
||||||
* Create a new PHPExcel_Writer_Excel2007
|
* Create a new PHPExcel_Writer_Excel2007
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
*/
|
*/
|
||||||
public function __construct(\PHPExcel\Spreadsheet $pPHPExcel = null)
|
public function __construct(\PHPExcel\Spreadsheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
|
@ -156,7 +156,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
|
|
||||||
// Set HashTable variables
|
// Set HashTable variables
|
||||||
foreach ($hashTablesArray as $tableName) {
|
foreach ($hashTablesArray as $tableName) {
|
||||||
$this->$tableName = new PHPExcel_HashTable();
|
$this->$tableName = new \PHPExcel\HashTable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
* Get writer part
|
* Get writer part
|
||||||
*
|
*
|
||||||
* @param string $pPartName Writer part name
|
* @param string $pPartName Writer part name
|
||||||
* @return PHPExcel_Writer_Excel2007_WriterPart
|
* @return \PHPExcel\Writer\Excel2007\WriterPart
|
||||||
*/
|
*/
|
||||||
public function getWriterPart($pPartName = '')
|
public function getWriterPart($pPartName = '')
|
||||||
{
|
{
|
||||||
|
@ -179,7 +179,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
* Save PHPExcel to file
|
* Save PHPExcel to file
|
||||||
*
|
*
|
||||||
* @param string $pFilename
|
* @param string $pFilename
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename = null)
|
||||||
{
|
{
|
||||||
|
@ -198,8 +198,8 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
|
|
||||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->getWriteDebugLog();
|
$saveDebugLog = PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->getWriteDebugLog();
|
||||||
PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog(false);
|
PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog(false);
|
||||||
$saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType();
|
$saveDateReturnType = \PHPExcel\Calculation\Functions::getReturnDateType();
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
\PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
|
||||||
|
|
||||||
// Create string lookup table
|
// Create string lookup table
|
||||||
$this->stringTable = array();
|
$this->stringTable = array();
|
||||||
|
@ -219,12 +219,13 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
$this->drawingHashTable->addFromSource($this->getWriterPart('Drawing')->allDrawings($this->spreadSheet));
|
$this->drawingHashTable->addFromSource($this->getWriterPart('Drawing')->allDrawings($this->spreadSheet));
|
||||||
|
|
||||||
// Create new ZIP file and open it for writing
|
// Create new ZIP file and open it for writing
|
||||||
$zipClass = PHPExcel_Settings::getZipClass();
|
$zipClass = \PHPExcel\Settings::getZipClass();
|
||||||
|
/** @var \ZipArchive $objZip */
|
||||||
$objZip = new $zipClass();
|
$objZip = new $zipClass();
|
||||||
|
|
||||||
// Retrieve OVERWRITE and CREATE constants from the instantiated zip class
|
// Retrieve OVERWRITE and CREATE constants from the instantiated zip class
|
||||||
// This method of accessing constant values from a dynamic class should work with all appropriate versions of PHP
|
// This method of accessing constant values from a dynamic class should work with all appropriate versions of PHP
|
||||||
$ro = new ReflectionObject($objZip);
|
$ro = new \ReflectionObject($objZip);
|
||||||
$zipOverWrite = $ro->getConstant('OVERWRITE');
|
$zipOverWrite = $ro->getConstant('OVERWRITE');
|
||||||
$zipCreate = $ro->getConstant('CREATE');
|
$zipCreate = $ro->getConstant('CREATE');
|
||||||
|
|
||||||
|
@ -234,7 +235,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
// Try opening the ZIP file
|
// Try opening the ZIP file
|
||||||
if ($objZip->open($pFilename, $zipOverWrite) !== true) {
|
if ($objZip->open($pFilename, $zipOverWrite) !== true) {
|
||||||
if ($objZip->open($pFilename, $zipCreate) !== true) {
|
if ($objZip->open($pFilename, $zipCreate) !== true) {
|
||||||
throw new PHPExcel_Writer_Exception("Could not open " . $pFilename . " for writing.");
|
throw new \PHPExcel\Writer\Exception("Could not open " . $pFilename . " for writing.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +355,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
|
|
||||||
// Add media
|
// Add media
|
||||||
for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
|
for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
|
||||||
if ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) {
|
if ($this->getDrawingHashTable()->getByIndex($i) instanceof \PHPExcel\Worksheet\Drawing) {
|
||||||
$imageContents = null;
|
$imageContents = null;
|
||||||
$imagePath = $this->getDrawingHashTable()->getByIndex($i)->getPath();
|
$imagePath = $this->getDrawingHashTable()->getByIndex($i)->getPath();
|
||||||
if (strpos($imagePath, 'zip://') !== false) {
|
if (strpos($imagePath, 'zip://') !== false) {
|
||||||
|
@ -371,7 +372,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
$objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
|
$objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
|
||||||
} elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) {
|
} elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof \PHPExcel\Worksheet\MemoryDrawing) {
|
||||||
ob_start();
|
ob_start();
|
||||||
call_user_func(
|
call_user_func(
|
||||||
$this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(),
|
$this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(),
|
||||||
|
@ -384,23 +385,23 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType);
|
\PHPExcel\Calculation\Functions::setReturnDateType($saveDateReturnType);
|
||||||
PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog($saveDebugLog);
|
PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog($saveDebugLog);
|
||||||
|
|
||||||
// Close file
|
// Close file
|
||||||
if ($objZip->close() === false) {
|
if ($objZip->close() === false) {
|
||||||
throw new PHPExcel_Writer_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 a temporary file was used, copy it to the correct file stream
|
||||||
if ($originalFilename != $pFilename) {
|
if ($originalFilename != $pFilename) {
|
||||||
if (copy($pFilename, $originalFilename) === false) {
|
if (copy($pFilename, $originalFilename) === false) {
|
||||||
throw new PHPExcel_Writer_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);
|
@unlink($pFilename);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("PHPExcel object unassigned.");
|
throw new \PHPExcel\Writer\Exception("PHPExcel object unassigned.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,14 +409,14 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
* Get PHPExcel object
|
* Get PHPExcel object
|
||||||
*
|
*
|
||||||
* @return PHPExcel
|
* @return PHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function getPHPExcel()
|
public function getPHPExcel()
|
||||||
{
|
{
|
||||||
if ($this->spreadSheet !== null) {
|
if ($this->spreadSheet !== null) {
|
||||||
return $this->spreadSheet;
|
return $this->spreadSheet;
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("No PHPExcel object assigned.");
|
throw new \PHPExcel\Writer\Exception("No PHPExcel object assigned.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,9 +444,9 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get PHPExcel_Style HashTable
|
* Get \PHPExcel\Style HashTable
|
||||||
*
|
*
|
||||||
* @return PHPExcel_HashTable
|
* @return \PHPExcel\HashTable
|
||||||
*/
|
*/
|
||||||
public function getStyleHashTable()
|
public function getStyleHashTable()
|
||||||
{
|
{
|
||||||
|
@ -453,9 +454,9 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get PHPExcel_Style_Conditional HashTable
|
* Get \PHPExcel\Style\Conditional HashTable
|
||||||
*
|
*
|
||||||
* @return PHPExcel_HashTable
|
* @return \PHPExcel\HashTable
|
||||||
*/
|
*/
|
||||||
public function getStylesConditionalHashTable()
|
public function getStylesConditionalHashTable()
|
||||||
{
|
{
|
||||||
|
@ -463,9 +464,9 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get PHPExcel_Style_Fill HashTable
|
* Get \PHPExcel\Style\Fill HashTable
|
||||||
*
|
*
|
||||||
* @return PHPExcel_HashTable
|
* @return \PHPExcel\HashTable
|
||||||
*/
|
*/
|
||||||
public function getFillHashTable()
|
public function getFillHashTable()
|
||||||
{
|
{
|
||||||
|
@ -473,9 +474,9 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get PHPExcel_Style_Font HashTable
|
* Get \PHPExcel\Style\Font HashTable
|
||||||
*
|
*
|
||||||
* @return PHPExcel_HashTable
|
* @return \PHPExcel\HashTable
|
||||||
*/
|
*/
|
||||||
public function getFontHashTable()
|
public function getFontHashTable()
|
||||||
{
|
{
|
||||||
|
@ -483,9 +484,9 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get PHPExcel_Style_Borders HashTable
|
* Get \PHPExcel\Style\Borders HashTable
|
||||||
*
|
*
|
||||||
* @return PHPExcel_HashTable
|
* @return \PHPExcel\HashTable
|
||||||
*/
|
*/
|
||||||
public function getBordersHashTable()
|
public function getBordersHashTable()
|
||||||
{
|
{
|
||||||
|
@ -493,9 +494,9 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get PHPExcel_Style_NumberFormat HashTable
|
* Get \PHPExcel\Style\NumberFormat HashTable
|
||||||
*
|
*
|
||||||
* @return PHPExcel_HashTable
|
* @return \PHPExcel\HashTable
|
||||||
*/
|
*/
|
||||||
public function getNumFmtHashTable()
|
public function getNumFmtHashTable()
|
||||||
{
|
{
|
||||||
|
@ -503,9 +504,9 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get PHPExcel_Worksheet_BaseDrawing HashTable
|
* Get \PHPExcel\Worksheet\BaseDrawing HashTable
|
||||||
*
|
*
|
||||||
* @return PHPExcel_HashTable
|
* @return \PHPExcel\HashTable
|
||||||
*/
|
*/
|
||||||
public function getDrawingHashTable()
|
public function getDrawingHashTable()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_Chart
|
* PHPExcel_Writer_Excel2007_Chart
|
||||||
|
@ -25,7 +26,7 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPart
|
class Chart extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write charts to XML format
|
* Write charts to XML format
|
||||||
|
@ -33,16 +34,16 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* @param PHPExcel_Chart $pChart
|
* @param PHPExcel_Chart $pChart
|
||||||
*
|
*
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeChart(PHPExcel_Chart $pChart = null)
|
public function writeChart(PHPExcel_Chart $pChart = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
// Ensure that data series values are up-to-date before we save
|
// Ensure that data series values are up-to-date before we save
|
||||||
$pChart->refresh();
|
$pChart->refresh();
|
||||||
|
@ -106,9 +107,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* Write Chart Title
|
* Write Chart Title
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Chart_Title $title
|
* @param PHPExcel_Chart_Title $title
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeTitle(PHPExcel_Chart_Title $title = null, $objWriter)
|
private function writeTitle(PHPExcel_Chart_Title $title = null, $objWriter)
|
||||||
{
|
{
|
||||||
|
@ -151,9 +152,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* Write Chart Legend
|
* Write Chart Legend
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Chart_Legend $legend
|
* @param PHPExcel_Chart_Legend $legend
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeLegend(PHPExcel_Chart_Legend $legend = null, $objWriter)
|
private function writeLegend(PHPExcel_Chart_Legend $legend = null, $objWriter)
|
||||||
{
|
{
|
||||||
|
@ -206,11 +207,11 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* @param PHPExcel_Chart_Title $yAxisLabel
|
* @param PHPExcel_Chart_Title $yAxisLabel
|
||||||
* @param PHPExcel_Chart_Axis $xAxis
|
* @param PHPExcel_Chart_Axis $xAxis
|
||||||
* @param PHPExcel_Chart_Axis $yAxis
|
* @param PHPExcel_Chart_Axis $yAxis
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writePlotArea(PHPExcel_Chart_PlotArea $plotArea, PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, $objWriter, PHPExcel_Worksheet $pSheet, PHPExcel_Chart_Axis $xAxis, PHPExcel_Chart_Axis $yAxis, PHPExcel_Chart_GridLines $majorGridlines, PHPExcel_Chart_GridLines $minorGridlines)
|
private function writePlotArea(PHPExcel_Chart_PlotArea $plotArea, PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, $objWriter, \PHPExcel\Worksheet $pSheet, PHPExcel_Chart_Axis $xAxis, PHPExcel_Chart_Axis $yAxis, PHPExcel_Chart_GridLines $majorGridlines, PHPExcel_Chart_GridLines $minorGridlines)
|
||||||
{
|
{
|
||||||
if (is_null($plotArea)) {
|
if (is_null($plotArea)) {
|
||||||
return;
|
return;
|
||||||
|
@ -341,10 +342,10 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Data Labels
|
* Write Data Labels
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Chart_Layout $chartLayout Chart layout
|
* @param PHPExcel_Chart_Layout $chartLayout Chart layout
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeDataLabels($objWriter, $chartLayout)
|
private function writeDataLabels($objWriter, $chartLayout)
|
||||||
{
|
{
|
||||||
|
@ -391,7 +392,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Category Axis
|
* Write Category Axis
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Chart_PlotArea $plotArea
|
* @param PHPExcel_Chart_PlotArea $plotArea
|
||||||
* @param PHPExcel_Chart_Title $xAxisLabel
|
* @param PHPExcel_Chart_Title $xAxisLabel
|
||||||
* @param string $groupType Chart type
|
* @param string $groupType Chart type
|
||||||
|
@ -399,7 +400,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* @param string $id2
|
* @param string $id2
|
||||||
* @param boolean $isMultiLevelSeries
|
* @param boolean $isMultiLevelSeries
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeCategoryAxis($objWriter, PHPExcel_Chart_PlotArea $plotArea, $xAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis)
|
private function writeCategoryAxis($objWriter, PHPExcel_Chart_PlotArea $plotArea, $xAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis)
|
||||||
{
|
{
|
||||||
|
@ -445,7 +446,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
}
|
}
|
||||||
$objWriter->startElement('a:t');
|
$objWriter->startElement('a:t');
|
||||||
// $objWriter->writeAttribute('xml:space', 'preserve');
|
// $objWriter->writeAttribute('xml:space', 'preserve');
|
||||||
$objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($caption));
|
$objWriter->writeRawData(\PHPExcel\Shared\String::ControlCharacterPHP2OOXML($caption));
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
@ -513,7 +514,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Value Axis
|
* Write Value Axis
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Chart_PlotArea $plotArea
|
* @param PHPExcel_Chart_PlotArea $plotArea
|
||||||
* @param PHPExcel_Chart_Title $yAxisLabel
|
* @param PHPExcel_Chart_Title $yAxisLabel
|
||||||
* @param string $groupType Chart type
|
* @param string $groupType Chart type
|
||||||
|
@ -521,7 +522,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* @param string $id2
|
* @param string $id2
|
||||||
* @param boolean $isMultiLevelSeries
|
* @param boolean $isMultiLevelSeries
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeValueAxis($objWriter, PHPExcel_Chart_PlotArea $plotArea, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines)
|
private function writeValueAxis($objWriter, PHPExcel_Chart_PlotArea $plotArea, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines)
|
||||||
{
|
{
|
||||||
|
@ -794,7 +795,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
|
|
||||||
$objWriter->startElement('a:t');
|
$objWriter->startElement('a:t');
|
||||||
// $objWriter->writeAttribute('xml:space', 'preserve');
|
// $objWriter->writeAttribute('xml:space', 'preserve');
|
||||||
$objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($caption));
|
$objWriter->writeRawData(\PHPExcel\Shared\String::ControlCharacterPHP2OOXML($caption));
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
@ -1002,7 +1003,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* @param PHPExcel_Chart_PlotArea $plotArea
|
* @param PHPExcel_Chart_PlotArea $plotArea
|
||||||
*
|
*
|
||||||
* @return string|array
|
* @return string|array
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private static function getChartType($plotArea)
|
private static function getChartType($plotArea)
|
||||||
{
|
{
|
||||||
|
@ -1017,7 +1018,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
}
|
}
|
||||||
$chartType = array_unique($chartTypes);
|
$chartType = array_unique($chartTypes);
|
||||||
if (count($chartTypes) == 0) {
|
if (count($chartTypes) == 0) {
|
||||||
throw new PHPExcel_Writer_Exception('Chart is not yet implemented');
|
throw new \PHPExcel\Writer\Exception('Chart is not yet implemented');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1029,15 +1030,15 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Chart_DataSeries $plotGroup
|
* @param PHPExcel_Chart_DataSeries $plotGroup
|
||||||
* @param string $groupType Type of plot for dataseries
|
* @param string $groupType Type of plot for dataseries
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param boolean &$catIsMultiLevelSeries Is category a multi-series category
|
* @param boolean &$catIsMultiLevelSeries Is category a multi-series category
|
||||||
* @param boolean &$valIsMultiLevelSeries Is value set a multi-series set
|
* @param boolean &$valIsMultiLevelSeries Is value set a multi-series set
|
||||||
* @param string &$plotGroupingType Type of grouping for multi-series values
|
* @param string &$plotGroupingType Type of grouping for multi-series values
|
||||||
* @param PHPExcel_Worksheet $pSheet
|
* @param \PHPExcel\Worksheet $pSheet
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, PHPExcel_Worksheet $pSheet)
|
private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, \PHPExcel\Worksheet $pSheet)
|
||||||
{
|
{
|
||||||
if (is_null($plotGroup)) {
|
if (is_null($plotGroup)) {
|
||||||
return;
|
return;
|
||||||
|
@ -1207,9 +1208,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* Write Plot Series Label
|
* Write Plot Series Label
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Chart_DataSeriesValues $plotSeriesLabel
|
* @param PHPExcel_Chart_DataSeriesValues $plotSeriesLabel
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writePlotSeriesLabel($plotSeriesLabel, $objWriter)
|
private function writePlotSeriesLabel($plotSeriesLabel, $objWriter)
|
||||||
{
|
{
|
||||||
|
@ -1242,14 +1243,14 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* Write Plot Series Values
|
* Write Plot Series Values
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Chart_DataSeriesValues $plotSeriesValues
|
* @param PHPExcel_Chart_DataSeriesValues $plotSeriesValues
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param string $groupType Type of plot for dataseries
|
* @param string $groupType Type of plot for dataseries
|
||||||
* @param string $dataType Datatype of series values
|
* @param string $dataType Datatype of series values
|
||||||
* @param PHPExcel_Worksheet $pSheet
|
* @param \PHPExcel\Worksheet $pSheet
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, $dataType = 'str', PHPExcel_Worksheet $pSheet)
|
private function writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, $dataType = 'str', \PHPExcel\Worksheet $pSheet)
|
||||||
{
|
{
|
||||||
if (is_null($plotSeriesValues)) {
|
if (is_null($plotSeriesValues)) {
|
||||||
return;
|
return;
|
||||||
|
@ -1337,11 +1338,11 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* Write Bubble Chart Details
|
* Write Bubble Chart Details
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Chart_DataSeriesValues $plotSeriesValues
|
* @param PHPExcel_Chart_DataSeriesValues $plotSeriesValues
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeBubbles($plotSeriesValues, $objWriter, PHPExcel_Worksheet $pSheet)
|
private function writeBubbles($plotSeriesValues, $objWriter, \PHPExcel\Worksheet $pSheet)
|
||||||
{
|
{
|
||||||
if (is_null($plotSeriesValues)) {
|
if (is_null($plotSeriesValues)) {
|
||||||
return;
|
return;
|
||||||
|
@ -1384,9 +1385,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
* Write Layout
|
* Write Layout
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Chart_Layout $layout
|
* @param PHPExcel_Chart_Layout $layout
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeLayout(PHPExcel_Chart_Layout $layout = null, $objWriter)
|
private function writeLayout(PHPExcel_Chart_Layout $layout = null, $objWriter)
|
||||||
{
|
{
|
||||||
|
@ -1453,9 +1454,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Alternate Content block
|
* Write Alternate Content block
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeAlternateContent($objWriter)
|
private function writeAlternateContent($objWriter)
|
||||||
{
|
{
|
||||||
|
@ -1483,9 +1484,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Printer Settings
|
* Write Printer Settings
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writePrintSettings($objWriter)
|
private function writePrintSettings($objWriter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_Comments
|
* PHPExcel_Writer_Excel2007_Comments
|
||||||
|
@ -25,23 +26,23 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_Comments extends PHPExcel_Writer_Excel2007_WriterPart
|
class Comments extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write comments to XML format
|
* Write comments to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pWorksheet
|
* @param \PHPExcel\Worksheet $pWorksheet
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeComments(PHPExcel_Worksheet $pWorksheet = null)
|
public function writeComments(\PHPExcel\Worksheet $pWorksheet = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -86,13 +87,13 @@ class PHPExcel_Writer_Excel2007_Comments extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write comment to XML format
|
* Write comment to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param string $pCellReference Cell reference
|
* @param string $pCellReference Cell reference
|
||||||
* @param PHPExcel_Comment $pComment Comment
|
* @param \PHPExcel\Comment $pComment Comment
|
||||||
* @param array $pAuthors Array of authors
|
* @param array $pAuthors Array of authors
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeComment(PHPExcel_Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', PHPExcel_Comment $pComment = null, $pAuthors = null)
|
private function writeComment(\PHPExcel\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PHPExcel\Comment $pComment = null, $pAuthors = null)
|
||||||
{
|
{
|
||||||
// comment
|
// comment
|
||||||
$objWriter->startElement('comment');
|
$objWriter->startElement('comment');
|
||||||
|
@ -110,18 +111,18 @@ class PHPExcel_Writer_Excel2007_Comments extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write VML comments to XML format
|
* Write VML comments to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pWorksheet
|
* @param \PHPExcel\Worksheet $pWorksheet
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeVMLComments(PHPExcel_Worksheet $pWorksheet = null)
|
public function writeVMLComments(\PHPExcel\Worksheet $pWorksheet = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -182,16 +183,16 @@ class PHPExcel_Writer_Excel2007_Comments extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write VML comment to XML format
|
* Write VML comment to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param string $pCellReference Cell reference
|
* @param string $pCellReference Cell reference
|
||||||
* @param PHPExcel_Comment $pComment Comment
|
* @param \PHPExcel\Comment $pComment Comment
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeVMLComment(PHPExcel_Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', PHPExcel_Comment $pComment = null)
|
private function writeVMLComment(\PHPExcel\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PHPExcel\Comment $pComment = null)
|
||||||
{
|
{
|
||||||
// Metadata
|
// Metadata
|
||||||
list($column, $row) = PHPExcel_Cell::coordinateFromString($pCellReference);
|
list($column, $row) = \PHPExcel\Cell::coordinateFromString($pCellReference);
|
||||||
$column = PHPExcel_Cell::columnIndexFromString($column);
|
$column = \PHPExcel\Cell::columnIndexFromString($column);
|
||||||
$id = 1024 + $column + $row;
|
$id = 1024 + $column + $row;
|
||||||
$id = substr($id, 0, 4);
|
$id = substr($id, 0, 4);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_ContentTypes
|
* PHPExcel_Writer_Excel2007_ContentTypes
|
||||||
|
@ -25,24 +26,24 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_WriterPart
|
class ContentTypes extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write content types to XML format
|
* Write content types to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\Spreadsheet $pPHPExcel
|
||||||
* @param boolean $includeCharts Flag indicating if we should include drawing details for charts
|
* @param boolean $includeCharts Flag indicating if we should include drawing details for charts
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeContentTypes(PHPExcel $pPHPExcel = null, $includeCharts = false)
|
public function writeContentTypes(\PHPExcel\Spreadsheet $pPHPExcel = null, $includeCharts = false)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -134,10 +135,10 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
|
||||||
$extension = '';
|
$extension = '';
|
||||||
$mimeType = '';
|
$mimeType = '';
|
||||||
|
|
||||||
if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) {
|
if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PHPExcel\Worksheet\Drawing) {
|
||||||
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension());
|
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension());
|
||||||
$mimeType = $this->getImageMimeType($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath());
|
$mimeType = $this->getImageMimeType($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath());
|
||||||
} elseif ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) {
|
} elseif ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PHPExcel\Worksheet\MemoryDrawing) {
|
||||||
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType());
|
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType());
|
||||||
$extension = explode('/', $extension);
|
$extension = explode('/', $extension);
|
||||||
$extension = $extension[1];
|
$extension = $extension[1];
|
||||||
|
@ -184,27 +185,27 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
|
||||||
*
|
*
|
||||||
* @param string $pFile Filename
|
* @param string $pFile Filename
|
||||||
* @return string Mime Type
|
* @return string Mime Type
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function getImageMimeType($pFile = '')
|
private function getImageMimeType($pFile = '')
|
||||||
{
|
{
|
||||||
if (PHPExcel_Shared_File::file_exists($pFile)) {
|
if (\PHPExcel\Shared\File::file_exists($pFile)) {
|
||||||
$image = getimagesize($pFile);
|
$image = getimagesize($pFile);
|
||||||
return image_type_to_mime_type($image[2]);
|
return image_type_to_mime_type($image[2]);
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("File $pFile does not exist");
|
throw new \PHPExcel\Writer\Exception("File $pFile does not exist");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write Default content type
|
* Write Default content type
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param string $pPartname Part name
|
* @param string $pPartname Part name
|
||||||
* @param string $pContentType Content type
|
* @param string $pContentType Content type
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeDefaultContentType(PHPExcel_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '')
|
private function writeDefaultContentType(\PHPExcel\Shared\XMLWriter $objWriter = null, $pPartname = '', $pContentType = '')
|
||||||
{
|
{
|
||||||
if ($pPartname != '' && $pContentType != '') {
|
if ($pPartname != '' && $pContentType != '') {
|
||||||
// Write content type
|
// Write content type
|
||||||
|
@ -213,19 +214,19 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
|
||||||
$objWriter->writeAttribute('ContentType', $pContentType);
|
$objWriter->writeAttribute('ContentType', $pContentType);
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid parameters passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write Override content type
|
* Write Override content type
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param string $pPartname Part name
|
* @param string $pPartname Part name
|
||||||
* @param string $pContentType Content type
|
* @param string $pContentType Content type
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeOverrideContentType(PHPExcel_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '')
|
private function writeOverrideContentType(\PHPExcel\Shared\XMLWriter $objWriter = null, $pPartname = '', $pContentType = '')
|
||||||
{
|
{
|
||||||
if ($pPartname != '' && $pContentType != '') {
|
if ($pPartname != '' && $pContentType != '') {
|
||||||
// Write content type
|
// Write content type
|
||||||
|
@ -234,7 +235,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
|
||||||
$objWriter->writeAttribute('ContentType', $pContentType);
|
$objWriter->writeAttribute('ContentType', $pContentType);
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid parameters passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_DocProps
|
* PHPExcel_Writer_Excel2007_DocProps
|
||||||
|
@ -25,23 +26,23 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_WriterPart
|
class DocProps extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write docProps/app.xml to XML format
|
* Write docProps/app.xml to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeDocPropsApp(PHPExcel $pPHPExcel = null)
|
public function writeDocPropsApp(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -127,18 +128,18 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write docProps/core.xml to XML format
|
* Write docProps/core.xml to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeDocPropsCore(PHPExcel $pPHPExcel = null)
|
public function writeDocPropsCore(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -194,11 +195,11 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write docProps/custom.xml to XML format
|
* Write docProps/custom.xml to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeDocPropsCustom(PHPExcel $pPHPExcel = null)
|
public function writeDocPropsCustom(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
$customPropertyList = $pPHPExcel->getProperties()->getCustomProperties();
|
$customPropertyList = $pPHPExcel->getProperties()->getCustomProperties();
|
||||||
if (empty($customPropertyList)) {
|
if (empty($customPropertyList)) {
|
||||||
|
@ -208,9 +209,9 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_Drawing
|
* PHPExcel_Writer_Excel2007_Drawing
|
||||||
|
@ -25,25 +26,25 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_WriterPart
|
class Drawing extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write drawings to XML format
|
* Write drawings to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pWorksheet
|
* @param \PHPExcel\Worksheet $pWorksheet
|
||||||
* @param int &$chartRef Chart ID
|
* @param int &$chartRef Chart ID
|
||||||
* @param boolean $includeCharts Flag indicating if we should include drawing details for charts
|
* @param boolean $includeCharts Flag indicating if we should include drawing details for charts
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeDrawings(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = false)
|
public function writeDrawings(\PHPExcel\Worksheet $pWorksheet = null, &$chartRef, $includeCharts = false)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -83,31 +84,31 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer
|
||||||
/**
|
/**
|
||||||
* Write drawings to XML format
|
* Write drawings to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Chart $pChart
|
* @param PHPExcel_Chart $pChart
|
||||||
* @param int $pRelationId
|
* @param int $pRelationId
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeChart(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Chart $pChart = null, $pRelationId = -1)
|
public function writeChart(\PHPExcel\Shared\XMLWriter $objWriter = null, PHPExcel_Chart $pChart = null, $pRelationId = -1)
|
||||||
{
|
{
|
||||||
$tl = $pChart->getTopLeftPosition();
|
$tl = $pChart->getTopLeftPosition();
|
||||||
$tl['colRow'] = PHPExcel_Cell::coordinateFromString($tl['cell']);
|
$tl['colRow'] = \PHPExcel\Cell::coordinateFromString($tl['cell']);
|
||||||
$br = $pChart->getBottomRightPosition();
|
$br = $pChart->getBottomRightPosition();
|
||||||
$br['colRow'] = PHPExcel_Cell::coordinateFromString($br['cell']);
|
$br['colRow'] = \PHPExcel\Cell::coordinateFromString($br['cell']);
|
||||||
|
|
||||||
$objWriter->startElement('xdr:twoCellAnchor');
|
$objWriter->startElement('xdr:twoCellAnchor');
|
||||||
|
|
||||||
$objWriter->startElement('xdr:from');
|
$objWriter->startElement('xdr:from');
|
||||||
$objWriter->writeElement('xdr:col', PHPExcel_Cell::columnIndexFromString($tl['colRow'][0]) - 1);
|
$objWriter->writeElement('xdr:col', \PHPExcel\Cell::columnIndexFromString($tl['colRow'][0]) - 1);
|
||||||
$objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($tl['xOffset']));
|
$objWriter->writeElement('xdr:colOff', \PHPExcel\Shared\Drawing::pixelsToEMU($tl['xOffset']));
|
||||||
$objWriter->writeElement('xdr:row', $tl['colRow'][1] - 1);
|
$objWriter->writeElement('xdr:row', $tl['colRow'][1] - 1);
|
||||||
$objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($tl['yOffset']));
|
$objWriter->writeElement('xdr:rowOff', \PHPExcel\Shared\Drawing::pixelsToEMU($tl['yOffset']));
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
$objWriter->startElement('xdr:to');
|
$objWriter->startElement('xdr:to');
|
||||||
$objWriter->writeElement('xdr:col', PHPExcel_Cell::columnIndexFromString($br['colRow'][0]) - 1);
|
$objWriter->writeElement('xdr:col', \PHPExcel\Cell::columnIndexFromString($br['colRow'][0]) - 1);
|
||||||
$objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($br['xOffset']));
|
$objWriter->writeElement('xdr:colOff', \PHPExcel\Shared\Drawing::pixelsToEMU($br['xOffset']));
|
||||||
$objWriter->writeElement('xdr:row', $br['colRow'][1] - 1);
|
$objWriter->writeElement('xdr:row', $br['colRow'][1] - 1);
|
||||||
$objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($br['yOffset']));
|
$objWriter->writeElement('xdr:rowOff', \PHPExcel\Shared\Drawing::pixelsToEMU($br['yOffset']));
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
|
||||||
$objWriter->startElement('xdr:graphicFrame');
|
$objWriter->startElement('xdr:graphicFrame');
|
||||||
|
@ -155,32 +156,32 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer
|
||||||
/**
|
/**
|
||||||
* Write drawings to XML format
|
* Write drawings to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet_BaseDrawing $pDrawing
|
* @param \PHPExcel\Worksheet\BaseDrawing $pDrawing
|
||||||
* @param int $pRelationId
|
* @param int $pRelationId
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet_BaseDrawing $pDrawing = null, $pRelationId = -1)
|
public function writeDrawing(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet\BaseDrawing $pDrawing = null, $pRelationId = -1)
|
||||||
{
|
{
|
||||||
if ($pRelationId >= 0) {
|
if ($pRelationId >= 0) {
|
||||||
// xdr:oneCellAnchor
|
// xdr:oneCellAnchor
|
||||||
$objWriter->startElement('xdr:oneCellAnchor');
|
$objWriter->startElement('xdr:oneCellAnchor');
|
||||||
// Image location
|
// Image location
|
||||||
$aCoordinates = PHPExcel_Cell::coordinateFromString($pDrawing->getCoordinates());
|
$aCoordinates = \PHPExcel\Cell::coordinateFromString($pDrawing->getCoordinates());
|
||||||
$aCoordinates[0] = PHPExcel_Cell::columnIndexFromString($aCoordinates[0]);
|
$aCoordinates[0] = \PHPExcel\Cell::columnIndexFromString($aCoordinates[0]);
|
||||||
|
|
||||||
// xdr:from
|
// xdr:from
|
||||||
$objWriter->startElement('xdr:from');
|
$objWriter->startElement('xdr:from');
|
||||||
$objWriter->writeElement('xdr:col', $aCoordinates[0] - 1);
|
$objWriter->writeElement('xdr:col', $aCoordinates[0] - 1);
|
||||||
$objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetX()));
|
$objWriter->writeElement('xdr:colOff', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetX()));
|
||||||
$objWriter->writeElement('xdr:row', $aCoordinates[1] - 1);
|
$objWriter->writeElement('xdr:row', $aCoordinates[1] - 1);
|
||||||
$objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetY()));
|
$objWriter->writeElement('xdr:rowOff', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetY()));
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
|
||||||
// xdr:ext
|
// xdr:ext
|
||||||
$objWriter->startElement('xdr:ext');
|
$objWriter->startElement('xdr:ext');
|
||||||
$objWriter->writeAttribute('cx', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getWidth()));
|
$objWriter->writeAttribute('cx', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getWidth()));
|
||||||
$objWriter->writeAttribute('cy', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getHeight()));
|
$objWriter->writeAttribute('cy', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getHeight()));
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
|
||||||
// xdr:pic
|
// xdr:pic
|
||||||
|
@ -229,7 +230,7 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer
|
||||||
|
|
||||||
// a:xfrm
|
// a:xfrm
|
||||||
$objWriter->startElement('a:xfrm');
|
$objWriter->startElement('a:xfrm');
|
||||||
$objWriter->writeAttribute('rot', PHPExcel_Shared_Drawing::degreesToAngle($pDrawing->getRotation()));
|
$objWriter->writeAttribute('rot', \PHPExcel\Shared\Drawing::degreesToAngle($pDrawing->getRotation()));
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
|
||||||
// a:prstGeom
|
// a:prstGeom
|
||||||
|
@ -288,9 +289,9 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer
|
||||||
|
|
||||||
// a:outerShdw
|
// a:outerShdw
|
||||||
$objWriter->startElement('a:outerShdw');
|
$objWriter->startElement('a:outerShdw');
|
||||||
$objWriter->writeAttribute('blurRad', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getShadow()->getBlurRadius()));
|
$objWriter->writeAttribute('blurRad', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getBlurRadius()));
|
||||||
$objWriter->writeAttribute('dist', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getShadow()->getDistance()));
|
$objWriter->writeAttribute('dist', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getDistance()));
|
||||||
$objWriter->writeAttribute('dir', PHPExcel_Shared_Drawing::degreesToAngle($pDrawing->getShadow()->getDirection()));
|
$objWriter->writeAttribute('dir', \PHPExcel\Shared\Drawing::degreesToAngle($pDrawing->getShadow()->getDirection()));
|
||||||
$objWriter->writeAttribute('algn', $pDrawing->getShadow()->getAlignment());
|
$objWriter->writeAttribute('algn', $pDrawing->getShadow()->getAlignment());
|
||||||
$objWriter->writeAttribute('rotWithShape', '0');
|
$objWriter->writeAttribute('rotWithShape', '0');
|
||||||
|
|
||||||
|
@ -366,25 +367,25 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer
|
||||||
|
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid parameters passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write VML header/footer images to XML format
|
* Write VML header/footer images to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pWorksheet
|
* @param \PHPExcel\Worksheet $pWorksheet
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeVMLHeaderFooterImages(PHPExcel_Worksheet $pWorksheet = null)
|
public function writeVMLHeaderFooterImages(\PHPExcel\Worksheet $pWorksheet = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -520,12 +521,12 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer
|
||||||
/**
|
/**
|
||||||
* Write VML comment to XML format
|
* Write VML comment to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param string $pReference Reference
|
* @param string $pReference Reference
|
||||||
* @param PHPExcel_Worksheet_HeaderFooterDrawing $pImage Image
|
* @param \PHPExcel\Worksheet\HeaderFooterDrawing $pImage Image
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeVMLHeaderFooterImage(PHPExcel_Shared_XMLWriter $objWriter = null, $pReference = '', PHPExcel_Worksheet_HeaderFooterDrawing $pImage = null)
|
private function writeVMLHeaderFooterImage(\PHPExcel\Shared\XMLWriter $objWriter = null, $pReference = '', \PHPExcel\Worksheet\HeaderFooterDrawing $pImage = null)
|
||||||
{
|
{
|
||||||
// Calculate object id
|
// Calculate object id
|
||||||
preg_match('{(\d+)}', md5($pReference), $m);
|
preg_match('{(\d+)}', md5($pReference), $m);
|
||||||
|
@ -564,10 +565,10 @@ class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_Writer
|
||||||
* Get an array of all drawings
|
* Get an array of all drawings
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @return PHPExcel_Worksheet_Drawing[] All drawings in PHPExcel
|
* @return \PHPExcel\Worksheet\Drawing[] All drawings in PHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function allDrawings(PHPExcel $pPHPExcel = null)
|
public function allDrawings(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Get an array of all drawings
|
// Get an array of all drawings
|
||||||
$aDrawings = array();
|
$aDrawings = array();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_Rels
|
* PHPExcel_Writer_Excel2007_Rels
|
||||||
|
@ -25,23 +26,23 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPart
|
class Rels extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write relationships to XML format
|
* Write relationships to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeRelationships(PHPExcel $pPHPExcel = null)
|
public function writeRelationships(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -104,18 +105,18 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
|
||||||
/**
|
/**
|
||||||
* Write workbook relationships to XML format
|
* Write workbook relationships to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeWorkbookRelationships(PHPExcel $pPHPExcel = null)
|
public function writeWorkbookRelationships(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -183,20 +184,20 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
|
||||||
* rId1 - Drawings
|
* rId1 - Drawings
|
||||||
* rId_hyperlink_x - Hyperlinks
|
* rId_hyperlink_x - Hyperlinks
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pWorksheet
|
* @param \PHPExcel\Worksheet $pWorksheet
|
||||||
* @param int $pWorksheetId
|
* @param int $pWorksheetId
|
||||||
* @param boolean $includeCharts Flag indicating if we should write charts
|
* @param boolean $includeCharts Flag indicating if we should write charts
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeWorksheetRelationships(PHPExcel_Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = false)
|
public function writeWorksheetRelationships(\PHPExcel\Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = false)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -291,20 +292,20 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
|
||||||
/**
|
/**
|
||||||
* Write drawing relationships to XML format
|
* Write drawing relationships to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pWorksheet
|
* @param \PHPExcel\Worksheet $pWorksheet
|
||||||
* @param int &$chartRef Chart ID
|
* @param int &$chartRef Chart ID
|
||||||
* @param boolean $includeCharts Flag indicating if we should write charts
|
* @param boolean $includeCharts Flag indicating if we should write charts
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = false)
|
public function writeDrawingRelationships(\PHPExcel\Worksheet $pWorksheet = null, &$chartRef, $includeCharts = false)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -318,8 +319,8 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
|
||||||
$i = 1;
|
$i = 1;
|
||||||
$iterator = $pWorksheet->getDrawingCollection()->getIterator();
|
$iterator = $pWorksheet->getDrawingCollection()->getIterator();
|
||||||
while ($iterator->valid()) {
|
while ($iterator->valid()) {
|
||||||
if ($iterator->current() instanceof PHPExcel_Worksheet_Drawing
|
if ($iterator->current() instanceof \PHPExcel\Worksheet\Drawing
|
||||||
|| $iterator->current() instanceof PHPExcel_Worksheet_MemoryDrawing) {
|
|| $iterator->current() instanceof \PHPExcel\Worksheet\MemoryDrawing) {
|
||||||
// Write relationship for image drawing
|
// Write relationship for image drawing
|
||||||
$this->writeRelationship(
|
$this->writeRelationship(
|
||||||
$objWriter,
|
$objWriter,
|
||||||
|
@ -356,18 +357,18 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
|
||||||
/**
|
/**
|
||||||
* Write header/footer drawing relationships to XML format
|
* Write header/footer drawing relationships to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pWorksheet
|
* @param \PHPExcel\Worksheet $pWorksheet
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeHeaderFooterDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null)
|
public function writeHeaderFooterDrawingRelationships(\PHPExcel\Worksheet $pWorksheet = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -396,14 +397,14 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
|
||||||
/**
|
/**
|
||||||
* Write Override content type
|
* Write Override content type
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param int $pId Relationship ID. rId will be prepended!
|
* @param int $pId Relationship ID. rId will be prepended!
|
||||||
* @param string $pType Relationship type
|
* @param string $pType Relationship type
|
||||||
* @param string $pTarget Relationship target
|
* @param string $pTarget Relationship target
|
||||||
* @param string $pTargetMode Relationship target mode
|
* @param string $pTargetMode Relationship target mode
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeRelationship(PHPExcel_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '')
|
private function writeRelationship(\PHPExcel\Shared\XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '')
|
||||||
{
|
{
|
||||||
if ($pType != '' && $pTarget != '') {
|
if ($pType != '' && $pTarget != '') {
|
||||||
// Write relationship
|
// Write relationship
|
||||||
|
@ -418,7 +419,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
|
||||||
|
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid parameters passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_RelsRibbon
|
* PHPExcel_Writer_Excel2007_RelsRibbon
|
||||||
|
@ -25,23 +26,23 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_RelsRibbon extends PHPExcel_Writer_Excel2007_WriterPart
|
class RelsRibbon extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write relationships for additional objects of custom UI (ribbon)
|
* Write relationships for additional objects of custom UI (ribbon)
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeRibbonRelationships(PHPExcel $pPHPExcel = null)
|
public function writeRibbonRelationships(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_RelsVBA
|
* PHPExcel_Writer_Excel2007_RelsVBA
|
||||||
|
@ -25,23 +26,23 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_RelsVBA extends PHPExcel_Writer_Excel2007_WriterPart
|
class RelsVBA extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write relationships for a signed VBA Project
|
* Write relationships for a signed VBA Project
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeVBARelationships(PHPExcel $pPHPExcel = null)
|
public function writeVBARelationships(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
|
|
@ -35,7 +35,7 @@ class StringTable extends WriterPart
|
||||||
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @param string[] $pExistingTable Existing table to eventually merge with
|
* @param string[] $pExistingTable Existing table to eventually merge with
|
||||||
* @return string[] String table for worksheet
|
* @return string[] String table for worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function createStringTable($pSheet = null, $pExistingTable = null)
|
public function createStringTable($pSheet = null, $pExistingTable = null)
|
||||||
{
|
{
|
||||||
|
@ -61,10 +61,10 @@ class StringTable extends WriterPart
|
||||||
($cellValue !== null) &&
|
($cellValue !== null) &&
|
||||||
$cellValue !== '' &&
|
$cellValue !== '' &&
|
||||||
!isset($aFlippedStringTable[$cellValue]) &&
|
!isset($aFlippedStringTable[$cellValue]) &&
|
||||||
($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING2 || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_NULL)) {
|
($cell->getDataType() == \PHPExcel\Cell\DataType::TYPE_STRING || $cell->getDataType() == \PHPExcel\Cell\DataType::TYPE_STRING2 || $cell->getDataType() == \PHPExcel\Cell\DataType::TYPE_NULL)) {
|
||||||
$aStringTable[] = $cellValue;
|
$aStringTable[] = $cellValue;
|
||||||
$aFlippedStringTable[$cellValue] = true;
|
$aFlippedStringTable[$cellValue] = true;
|
||||||
} elseif ($cellValue instanceof PHPExcel_RichText &&
|
} elseif ($cellValue instanceof \PHPExcel\RichText &&
|
||||||
($cellValue !== null) &&
|
($cellValue !== null) &&
|
||||||
!isset($aFlippedStringTable[$cellValue->getHashCode()])) {
|
!isset($aFlippedStringTable[$cellValue->getHashCode()])) {
|
||||||
$aStringTable[] = $cellValue;
|
$aStringTable[] = $cellValue;
|
||||||
|
@ -74,7 +74,7 @@ class StringTable extends WriterPart
|
||||||
|
|
||||||
return $aStringTable;
|
return $aStringTable;
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid PHPExcel_Worksheet object passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid \PHPExcel\Worksheet object passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class StringTable extends WriterPart
|
||||||
*
|
*
|
||||||
* @param string[] $pStringTable
|
* @param string[] $pStringTable
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeStringTable($pStringTable = null)
|
public function writeStringTable($pStringTable = null)
|
||||||
{
|
{
|
||||||
|
@ -91,9 +91,9 @@ class StringTable extends WriterPart
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -108,15 +108,15 @@ class StringTable extends WriterPart
|
||||||
foreach ($pStringTable as $textElement) {
|
foreach ($pStringTable as $textElement) {
|
||||||
$objWriter->startElement('si');
|
$objWriter->startElement('si');
|
||||||
|
|
||||||
if (! $textElement instanceof PHPExcel_RichText) {
|
if (! $textElement instanceof \PHPExcel\RichText) {
|
||||||
$textToWrite = PHPExcel_Shared_String::ControlCharacterPHP2OOXML($textElement);
|
$textToWrite = \PHPExcel\Shared\String::ControlCharacterPHP2OOXML($textElement);
|
||||||
$objWriter->startElement('t');
|
$objWriter->startElement('t');
|
||||||
if ($textToWrite !== trim($textToWrite)) {
|
if ($textToWrite !== trim($textToWrite)) {
|
||||||
$objWriter->writeAttribute('xml:space', 'preserve');
|
$objWriter->writeAttribute('xml:space', 'preserve');
|
||||||
}
|
}
|
||||||
$objWriter->writeRawData($textToWrite);
|
$objWriter->writeRawData($textToWrite);
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
} elseif ($textElement instanceof PHPExcel_RichText) {
|
} elseif ($textElement instanceof \PHPExcel\RichText) {
|
||||||
$this->writeRichText($objWriter, $textElement);
|
$this->writeRichText($objWriter, $textElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,19 +127,19 @@ class StringTable extends WriterPart
|
||||||
|
|
||||||
return $objWriter->getData();
|
return $objWriter->getData();
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid string table array passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid string table array passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write Rich Text
|
* Write Rich Text
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_RichText $pRichText Rich text
|
* @param \PHPExcel\RichText $pRichText Rich text
|
||||||
* @param string $prefix Optional Namespace prefix
|
* @param string $prefix Optional Namespace prefix
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeRichText(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_RichText $pRichText = null, $prefix = null)
|
public function writeRichText(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\RichText $pRichText = null, $prefix = null)
|
||||||
{
|
{
|
||||||
if ($prefix !== null) {
|
if ($prefix !== null) {
|
||||||
$prefix .= ':';
|
$prefix .= ':';
|
||||||
|
@ -152,7 +152,7 @@ class StringTable extends WriterPart
|
||||||
$objWriter->startElement($prefix.'r');
|
$objWriter->startElement($prefix.'r');
|
||||||
|
|
||||||
// rPr
|
// rPr
|
||||||
if ($element instanceof PHPExcel_RichText_Run) {
|
if ($element instanceof \PHPExcel\RichText\Run) {
|
||||||
// rPr
|
// rPr
|
||||||
$objWriter->startElement($prefix.'rPr');
|
$objWriter->startElement($prefix.'rPr');
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ class StringTable extends WriterPart
|
||||||
// t
|
// t
|
||||||
$objWriter->startElement($prefix.'t');
|
$objWriter->startElement($prefix.'t');
|
||||||
$objWriter->writeAttribute('xml:space', 'preserve');
|
$objWriter->writeAttribute('xml:space', 'preserve');
|
||||||
$objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($element->getText()));
|
$objWriter->writeRawData(\PHPExcel\Shared\String::ControlCharacterPHP2OOXML($element->getText()));
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
@ -218,16 +218,16 @@ class StringTable extends WriterPart
|
||||||
/**
|
/**
|
||||||
* Write Rich Text
|
* Write Rich Text
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param string|PHPExcel_RichText $pRichText text string or Rich text
|
* @param string|\PHPExcel\RichText $pRichText text string or Rich text
|
||||||
* @param string $prefix Optional Namespace prefix
|
* @param string $prefix Optional Namespace prefix
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeRichTextForCharts(PHPExcel_Shared_XMLWriter $objWriter = null, $pRichText = null, $prefix = null)
|
public function writeRichTextForCharts(\PHPExcel\Shared\XMLWriter $objWriter = null, $pRichText = null, $prefix = null)
|
||||||
{
|
{
|
||||||
if (!$pRichText instanceof PHPExcel_RichText) {
|
if (!$pRichText instanceof \PHPExcel\RichText) {
|
||||||
$textRun = $pRichText;
|
$textRun = $pRichText;
|
||||||
$pRichText = new PHPExcel_RichText();
|
$pRichText = new \PHPExcel\RichText();
|
||||||
$pRichText->createTextRun($textRun);
|
$pRichText->createTextRun($textRun);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ class StringTable extends WriterPart
|
||||||
// t
|
// t
|
||||||
$objWriter->startElement($prefix.'t');
|
$objWriter->startElement($prefix.'t');
|
||||||
// $objWriter->writeAttribute('xml:space', 'preserve'); // Excel2010 accepts, Excel2007 complains
|
// $objWriter->writeAttribute('xml:space', 'preserve'); // Excel2010 accepts, Excel2007 complains
|
||||||
$objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($element->getText()));
|
$objWriter->writeRawData(\PHPExcel\Shared\String::ControlCharacterPHP2OOXML($element->getText()));
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
@ -303,9 +303,9 @@ class StringTable extends WriterPart
|
||||||
|
|
||||||
// Loop through stringtable and add flipped items to $returnValue
|
// Loop through stringtable and add flipped items to $returnValue
|
||||||
foreach ($stringTable as $key => $value) {
|
foreach ($stringTable as $key => $value) {
|
||||||
if (! $value instanceof PHPExcel_RichText) {
|
if (! $value instanceof \PHPExcel\RichText) {
|
||||||
$returnValue[$value] = $key;
|
$returnValue[$value] = $key;
|
||||||
} elseif ($value instanceof PHPExcel_RichText) {
|
} elseif ($value instanceof \PHPExcel\RichText) {
|
||||||
$returnValue[$value->getHashCode()] = $key;
|
$returnValue[$value->getHashCode()] = $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_Style
|
* PHPExcel_Writer_Excel2007_Style
|
||||||
|
@ -25,23 +26,23 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPart
|
class Style extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write styles to XML format
|
* Write styles to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeStyles(PHPExcel $pPHPExcel = null)
|
public function writeStyles(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -160,15 +161,15 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Fill
|
* Write Fill
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Style_Fill $pFill Fill style
|
* @param \PHPExcel\Style\Fill $pFill Fill style
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null)
|
private function writeFill(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\Fill $pFill = null)
|
||||||
{
|
{
|
||||||
// Check if this is a pattern type or gradient type
|
// Check if this is a pattern type or gradient type
|
||||||
if ($pFill->getFillType() === PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR ||
|
if ($pFill->getFillType() === \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR ||
|
||||||
$pFill->getFillType() === PHPExcel_Style_Fill::FILL_GRADIENT_PATH) {
|
$pFill->getFillType() === \PHPExcel\Style\Fill::FILL_GRADIENT_PATH) {
|
||||||
// Gradient fill
|
// Gradient fill
|
||||||
$this->writeGradientFill($objWriter, $pFill);
|
$this->writeGradientFill($objWriter, $pFill);
|
||||||
} elseif ($pFill->getFillType() !== null) {
|
} elseif ($pFill->getFillType() !== null) {
|
||||||
|
@ -180,11 +181,11 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Gradient Fill
|
* Write Gradient Fill
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Style_Fill $pFill Fill style
|
* @param \PHPExcel\Style\Fill $pFill Fill style
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeGradientFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null)
|
private function writeGradientFill(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\Fill $pFill = null)
|
||||||
{
|
{
|
||||||
// fill
|
// fill
|
||||||
$objWriter->startElement('fill');
|
$objWriter->startElement('fill');
|
||||||
|
@ -224,11 +225,11 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Pattern Fill
|
* Write Pattern Fill
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Style_Fill $pFill Fill style
|
* @param \PHPExcel\Style\Fill $pFill Fill style
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writePatternFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null)
|
private function writePatternFill(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\Fill $pFill = null)
|
||||||
{
|
{
|
||||||
// fill
|
// fill
|
||||||
$objWriter->startElement('fill');
|
$objWriter->startElement('fill');
|
||||||
|
@ -237,7 +238,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
$objWriter->startElement('patternFill');
|
$objWriter->startElement('patternFill');
|
||||||
$objWriter->writeAttribute('patternType', $pFill->getFillType());
|
$objWriter->writeAttribute('patternType', $pFill->getFillType());
|
||||||
|
|
||||||
if ($pFill->getFillType() !== PHPExcel_Style_Fill::FILL_NONE) {
|
if ($pFill->getFillType() !== \PHPExcel\Style\Fill::FILL_NONE) {
|
||||||
// fgColor
|
// fgColor
|
||||||
if ($pFill->getStartColor()->getARGB()) {
|
if ($pFill->getStartColor()->getARGB()) {
|
||||||
$objWriter->startElement('fgColor');
|
$objWriter->startElement('fgColor');
|
||||||
|
@ -245,7 +246,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($pFill->getFillType() !== PHPExcel_Style_Fill::FILL_NONE) {
|
if ($pFill->getFillType() !== \PHPExcel\Style\Fill::FILL_NONE) {
|
||||||
// bgColor
|
// bgColor
|
||||||
if ($pFill->getEndColor()->getARGB()) {
|
if ($pFill->getEndColor()->getARGB()) {
|
||||||
$objWriter->startElement('bgColor');
|
$objWriter->startElement('bgColor');
|
||||||
|
@ -262,11 +263,11 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Font
|
* Write Font
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Style_Font $pFont Font style
|
* @param \PHPExcel\Style\Font $pFont Font style
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeFont(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Font $pFont = null)
|
private function writeFont(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\Font $pFont = null)
|
||||||
{
|
{
|
||||||
// font
|
// font
|
||||||
$objWriter->startElement('font');
|
$objWriter->startElement('font');
|
||||||
|
@ -342,25 +343,25 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Border
|
* Write Border
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Style_Borders $pBorders Borders style
|
* @param \PHPExcel\Style\Borders $pBorders Borders style
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeBorder(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Borders $pBorders = null)
|
private function writeBorder(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\Borders $pBorders = null)
|
||||||
{
|
{
|
||||||
// Write border
|
// Write border
|
||||||
$objWriter->startElement('border');
|
$objWriter->startElement('border');
|
||||||
// Diagonal?
|
// Diagonal?
|
||||||
switch ($pBorders->getDiagonalDirection()) {
|
switch ($pBorders->getDiagonalDirection()) {
|
||||||
case PHPExcel_Style_Borders::DIAGONAL_UP:
|
case \PHPExcel\Style\Borders::DIAGONAL_UP:
|
||||||
$objWriter->writeAttribute('diagonalUp', 'true');
|
$objWriter->writeAttribute('diagonalUp', 'true');
|
||||||
$objWriter->writeAttribute('diagonalDown', 'false');
|
$objWriter->writeAttribute('diagonalDown', 'false');
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Borders::DIAGONAL_DOWN:
|
case \PHPExcel\Style\Borders::DIAGONAL_DOWN:
|
||||||
$objWriter->writeAttribute('diagonalUp', 'false');
|
$objWriter->writeAttribute('diagonalUp', 'false');
|
||||||
$objWriter->writeAttribute('diagonalDown', 'true');
|
$objWriter->writeAttribute('diagonalDown', 'true');
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Borders::DIAGONAL_BOTH:
|
case \PHPExcel\Style\Borders::DIAGONAL_BOTH:
|
||||||
$objWriter->writeAttribute('diagonalUp', 'true');
|
$objWriter->writeAttribute('diagonalUp', 'true');
|
||||||
$objWriter->writeAttribute('diagonalDown', 'true');
|
$objWriter->writeAttribute('diagonalDown', 'true');
|
||||||
break;
|
break;
|
||||||
|
@ -378,12 +379,12 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Cell Style Xf
|
* Write Cell Style Xf
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Style $pStyle Style
|
* @param \PHPExcel\Style $pStyle Style
|
||||||
* @param PHPExcel $pPHPExcel Workbook
|
* @param \PHPExcel\SpreadSheet $pPHPExcel Workbook
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeCellStyleXf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null, PHPExcel $pPHPExcel = null)
|
private function writeCellStyleXf(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style $pStyle = null, \PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// xf
|
// xf
|
||||||
$objWriter->startElement('xf');
|
$objWriter->startElement('xf');
|
||||||
|
@ -408,7 +409,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
$objWriter->writeAttribute('applyFill', ($pPHPExcel->getDefaultStyle()->getFill()->getHashCode() != $pStyle->getFill()->getHashCode()) ? '1' : '0');
|
$objWriter->writeAttribute('applyFill', ($pPHPExcel->getDefaultStyle()->getFill()->getHashCode() != $pStyle->getFill()->getHashCode()) ? '1' : '0');
|
||||||
$objWriter->writeAttribute('applyBorder', ($pPHPExcel->getDefaultStyle()->getBorders()->getHashCode() != $pStyle->getBorders()->getHashCode()) ? '1' : '0');
|
$objWriter->writeAttribute('applyBorder', ($pPHPExcel->getDefaultStyle()->getBorders()->getHashCode() != $pStyle->getBorders()->getHashCode()) ? '1' : '0');
|
||||||
$objWriter->writeAttribute('applyAlignment', ($pPHPExcel->getDefaultStyle()->getAlignment()->getHashCode() != $pStyle->getAlignment()->getHashCode()) ? '1' : '0');
|
$objWriter->writeAttribute('applyAlignment', ($pPHPExcel->getDefaultStyle()->getAlignment()->getHashCode() != $pStyle->getAlignment()->getHashCode()) ? '1' : '0');
|
||||||
if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
|
if ($pStyle->getProtection()->getLocked() != \PHPExcel\Style\Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != \PHPExcel\Style\Protection::PROTECTION_INHERIT) {
|
||||||
$objWriter->writeAttribute('applyProtection', 'true');
|
$objWriter->writeAttribute('applyProtection', 'true');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,13 +438,13 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
|
||||||
// protection
|
// protection
|
||||||
if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
|
if ($pStyle->getProtection()->getLocked() != \PHPExcel\Style\Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != \PHPExcel\Style\Protection::PROTECTION_INHERIT) {
|
||||||
$objWriter->startElement('protection');
|
$objWriter->startElement('protection');
|
||||||
if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
|
if ($pStyle->getProtection()->getLocked() != \PHPExcel\Style\Protection::PROTECTION_INHERIT) {
|
||||||
$objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
|
$objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
|
||||||
}
|
}
|
||||||
if ($pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
|
if ($pStyle->getProtection()->getHidden() != \PHPExcel\Style\Protection::PROTECTION_INHERIT) {
|
||||||
$objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
|
$objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
|
||||||
}
|
}
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
}
|
}
|
||||||
|
@ -454,11 +455,11 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write Cell Style Dxf
|
* Write Cell Style Dxf
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Style $pStyle Style
|
* @param \PHPExcel\Style $pStyle Style
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeCellStyleDxf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null)
|
private function writeCellStyleDxf(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style $pStyle = null)
|
||||||
{
|
{
|
||||||
// dxf
|
// dxf
|
||||||
$objWriter->startElement('dxf');
|
$objWriter->startElement('dxf');
|
||||||
|
@ -497,16 +498,16 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
|
|
||||||
// protection
|
// protection
|
||||||
if (($pStyle->getProtection()->getLocked() !== null) || ($pStyle->getProtection()->getHidden() !== null)) {
|
if (($pStyle->getProtection()->getLocked() !== null) || ($pStyle->getProtection()->getHidden() !== null)) {
|
||||||
if ($pStyle->getProtection()->getLocked() !== PHPExcel_Style_Protection::PROTECTION_INHERIT ||
|
if ($pStyle->getProtection()->getLocked() !== \PHPExcel\Style\Protection::PROTECTION_INHERIT ||
|
||||||
$pStyle->getProtection()->getHidden() !== PHPExcel_Style_Protection::PROTECTION_INHERIT) {
|
$pStyle->getProtection()->getHidden() !== \PHPExcel\Style\Protection::PROTECTION_INHERIT) {
|
||||||
$objWriter->startElement('protection');
|
$objWriter->startElement('protection');
|
||||||
if (($pStyle->getProtection()->getLocked() !== null) &&
|
if (($pStyle->getProtection()->getLocked() !== null) &&
|
||||||
($pStyle->getProtection()->getLocked() !== PHPExcel_Style_Protection::PROTECTION_INHERIT)) {
|
($pStyle->getProtection()->getLocked() !== \PHPExcel\Style\Protection::PROTECTION_INHERIT)) {
|
||||||
$objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
|
$objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
|
||||||
}
|
}
|
||||||
if (($pStyle->getProtection()->getHidden() !== null) &&
|
if (($pStyle->getProtection()->getHidden() !== null) &&
|
||||||
($pStyle->getProtection()->getHidden() !== PHPExcel_Style_Protection::PROTECTION_INHERIT)) {
|
($pStyle->getProtection()->getHidden() !== \PHPExcel\Style\Protection::PROTECTION_INHERIT)) {
|
||||||
$objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
|
$objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
|
||||||
}
|
}
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
}
|
}
|
||||||
|
@ -518,15 +519,15 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write BorderPr
|
* Write BorderPr
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param string $pName Element name
|
* @param string $pName Element name
|
||||||
* @param PHPExcel_Style_Border $pBorder Border style
|
* @param \PHPExcel\Style\Border $pBorder Border style
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeBorderPr(PHPExcel_Shared_XMLWriter $objWriter = null, $pName = 'left', PHPExcel_Style_Border $pBorder = null)
|
private function writeBorderPr(\PHPExcel\Shared\XMLWriter $objWriter = null, $pName = 'left', \PHPExcel\Style\Border $pBorder = null)
|
||||||
{
|
{
|
||||||
// Write BorderPr
|
// Write BorderPr
|
||||||
if ($pBorder->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
|
if ($pBorder->getBorderStyle() != \PHPExcel\Style\Border::BORDER_NONE) {
|
||||||
$objWriter->startElement($pName);
|
$objWriter->startElement($pName);
|
||||||
$objWriter->writeAttribute('style', $pBorder->getBorderStyle());
|
$objWriter->writeAttribute('style', $pBorder->getBorderStyle());
|
||||||
|
|
||||||
|
@ -542,12 +543,12 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write NumberFormat
|
* Write NumberFormat
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Style_NumberFormat $pNumberFormat Number Format
|
* @param \PHPExcel\Style\NumberFormat $pNumberFormat Number Format
|
||||||
* @param int $pId Number Format identifier
|
* @param int $pId Number Format identifier
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeNumFmt(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_NumberFormat $pNumberFormat = null, $pId = 0)
|
private function writeNumFmt(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\NumberFormat $pNumberFormat = null, $pId = 0)
|
||||||
{
|
{
|
||||||
// Translate formatcode
|
// Translate formatcode
|
||||||
$formatCode = $pNumberFormat->getFormatCode();
|
$formatCode = $pNumberFormat->getFormatCode();
|
||||||
|
@ -566,9 +567,9 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @return PHPExcel_Style[] All styles in PHPExcel
|
* @return PHPExcel_Style[] All styles in PHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function allStyles(PHPExcel $pPHPExcel = null)
|
public function allStyles(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
return $pPHPExcel->getCellXfCollection();
|
return $pPHPExcel->getCellXfCollection();
|
||||||
}
|
}
|
||||||
|
@ -576,11 +577,11 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Get an array of all conditional styles
|
* Get an array of all conditional styles
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return PHPExcel_Style_Conditional[] All conditional styles in PHPExcel
|
* @return \PHPExcel\Style\Conditional[] All conditional styles in PHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function allConditionalStyles(PHPExcel $pPHPExcel = null)
|
public function allConditionalStyles(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Get an array of all styles
|
// Get an array of all styles
|
||||||
$aStyles = array();
|
$aStyles = array();
|
||||||
|
@ -600,25 +601,26 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Get an array of all fills
|
* Get an array of all fills
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return PHPExcel_Style_Fill[] All fills in PHPExcel
|
* @return \PHPExcel\Style\Fill[] All fills in PHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function allFills(PHPExcel $pPHPExcel = null)
|
public function allFills(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Get an array of unique fills
|
// Get an array of unique fills
|
||||||
$aFills = array();
|
$aFills = array();
|
||||||
|
|
||||||
// Two first fills are predefined
|
// Two first fills are predefined
|
||||||
$fill0 = new PHPExcel_Style_Fill();
|
$fill0 = new \PHPExcel\Style\Fill();
|
||||||
$fill0->setFillType(PHPExcel_Style_Fill::FILL_NONE);
|
$fill0->setFillType(\PHPExcel\Style\Fill::FILL_NONE);
|
||||||
$aFills[] = $fill0;
|
$aFills[] = $fill0;
|
||||||
|
|
||||||
$fill1 = new PHPExcel_Style_Fill();
|
$fill1 = new \PHPExcel\Style\Fill();
|
||||||
$fill1->setFillType(PHPExcel_Style_Fill::FILL_PATTERN_GRAY125);
|
$fill1->setFillType(\PHPExcel\Style\Fill::FILL_PATTERN_GRAY125);
|
||||||
$aFills[] = $fill1;
|
$aFills[] = $fill1;
|
||||||
// The remaining fills
|
// The remaining fills
|
||||||
$aStyles = $this->allStyles($pPHPExcel);
|
$aStyles = $this->allStyles($pPHPExcel);
|
||||||
|
/** @var \PHPExcel\Style $style */
|
||||||
foreach ($aStyles as $style) {
|
foreach ($aStyles as $style) {
|
||||||
if (!array_key_exists($style->getFill()->getHashCode(), $aFills)) {
|
if (!array_key_exists($style->getFill()->getHashCode(), $aFills)) {
|
||||||
$aFills[ $style->getFill()->getHashCode() ] = $style->getFill();
|
$aFills[ $style->getFill()->getHashCode() ] = $style->getFill();
|
||||||
|
@ -631,16 +633,17 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Get an array of all fonts
|
* Get an array of all fonts
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return PHPExcel_Style_Font[] All fonts in PHPExcel
|
* @return \PHPExcel\Style\Font[] All fonts in PHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function allFonts(PHPExcel $pPHPExcel = null)
|
public function allFonts(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Get an array of unique fonts
|
// Get an array of unique fonts
|
||||||
$aFonts = array();
|
$aFonts = array();
|
||||||
$aStyles = $this->allStyles($pPHPExcel);
|
$aStyles = $this->allStyles($pPHPExcel);
|
||||||
|
|
||||||
|
/** @var \PHPExcel\Style $style */
|
||||||
foreach ($aStyles as $style) {
|
foreach ($aStyles as $style) {
|
||||||
if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) {
|
if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) {
|
||||||
$aFonts[ $style->getFont()->getHashCode() ] = $style->getFont();
|
$aFonts[ $style->getFont()->getHashCode() ] = $style->getFont();
|
||||||
|
@ -653,16 +656,17 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Get an array of all borders
|
* Get an array of all borders
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return PHPExcel_Style_Borders[] All borders in PHPExcel
|
* @return \PHPExcel\Style\Borders[] All borders in PHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function allBorders(PHPExcel $pPHPExcel = null)
|
public function allBorders(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Get an array of unique borders
|
// Get an array of unique borders
|
||||||
$aBorders = array();
|
$aBorders = array();
|
||||||
$aStyles = $this->allStyles($pPHPExcel);
|
$aStyles = $this->allStyles($pPHPExcel);
|
||||||
|
|
||||||
|
/** @var \PHPExcel\Style $style */
|
||||||
foreach ($aStyles as $style) {
|
foreach ($aStyles as $style) {
|
||||||
if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) {
|
if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) {
|
||||||
$aBorders[ $style->getBorders()->getHashCode() ] = $style->getBorders();
|
$aBorders[ $style->getBorders()->getHashCode() ] = $style->getBorders();
|
||||||
|
@ -675,16 +679,17 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Get an array of all number formats
|
* Get an array of all number formats
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return PHPExcel_Style_NumberFormat[] All number formats in PHPExcel
|
* @return \PHPExcel\Style\NumberFormat[] All number formats in PHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function allNumberFormats(PHPExcel $pPHPExcel = null)
|
public function allNumberFormats(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Get an array of unique number formats
|
// Get an array of unique number formats
|
||||||
$aNumFmts = array();
|
$aNumFmts = array();
|
||||||
$aStyles = $this->allStyles($pPHPExcel);
|
$aStyles = $this->allStyles($pPHPExcel);
|
||||||
|
|
||||||
|
/** @var \PHPExcel\Style $style */
|
||||||
foreach ($aStyles as $style) {
|
foreach ($aStyles as $style) {
|
||||||
if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_key_exists($style->getNumberFormat()->getHashCode(), $aNumFmts)) {
|
if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_key_exists($style->getNumberFormat()->getHashCode(), $aNumFmts)) {
|
||||||
$aNumFmts[ $style->getNumberFormat()->getHashCode() ] = $style->getNumberFormat();
|
$aNumFmts[ $style->getNumberFormat()->getHashCode() ] = $style->getNumberFormat();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
/**
|
/**
|
||||||
* PHPExcel
|
* PHPExcel
|
||||||
*
|
*
|
||||||
|
@ -33,7 +34,7 @@
|
||||||
* @package PHPExcel_Writer_Excel2007
|
* @package PHPExcel_Writer_Excel2007
|
||||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPart
|
class Theme extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Map of Major fonts to write
|
* Map of Major fonts to write
|
||||||
|
@ -132,18 +133,18 @@ class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write theme to XML format
|
* Write theme to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeTheme(PHPExcel $pPHPExcel = null)
|
public function writeTheme(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -816,11 +817,11 @@ class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write fonts to XML format
|
* Write fonts to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter
|
* @param \PHPExcel\Shared\XMLWriter $objWriter
|
||||||
* @param string $latinFont
|
* @param string $latinFont
|
||||||
* @param array of string $fontSet
|
* @param array of string $fontSet
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeFonts($objWriter, $latinFont, $fontSet)
|
private function writeFonts($objWriter, $latinFont, $fontSet)
|
||||||
{
|
{
|
||||||
|
@ -850,9 +851,9 @@ class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPa
|
||||||
/**
|
/**
|
||||||
* Write colour scheme to XML format
|
* Write colour scheme to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter
|
* @param \PHPExcel\Shared\XMLWriter $objWriter
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeColourScheme($objWriter)
|
private function writeColourScheme($objWriter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_Workbook
|
* PHPExcel_Writer_Excel2007_Workbook
|
||||||
|
@ -25,24 +26,24 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_WriterPart
|
class Workbook extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write workbook to XML format
|
* Write workbook to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing
|
* @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeWorkbook(PHPExcel $pPHPExcel = null, $recalcRequired = false)
|
public function writeWorkbook(\PHPExcel\SpreadSheet $pPHPExcel = null, $recalcRequired = false)
|
||||||
{
|
{
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -86,10 +87,10 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write file version
|
* Write file version
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeFileVersion(PHPExcel_Shared_XMLWriter $objWriter = null)
|
private function writeFileVersion(\PHPExcel\Shared\XMLWriter $objWriter = null)
|
||||||
{
|
{
|
||||||
$objWriter->startElement('fileVersion');
|
$objWriter->startElement('fileVersion');
|
||||||
$objWriter->writeAttribute('appName', 'xl');
|
$objWriter->writeAttribute('appName', 'xl');
|
||||||
|
@ -102,14 +103,14 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write WorkbookPr
|
* Write WorkbookPr
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeWorkbookPr(PHPExcel_Shared_XMLWriter $objWriter = null)
|
private function writeWorkbookPr(\PHPExcel\Shared\XMLWriter $objWriter = null)
|
||||||
{
|
{
|
||||||
$objWriter->startElement('workbookPr');
|
$objWriter->startElement('workbookPr');
|
||||||
|
|
||||||
if (PHPExcel_Shared_Date::getExcelCalendar() == PHPExcel_Shared_Date::CALENDAR_MAC_1904) {
|
if (\PHPExcel\Shared\Date::getExcelCalendar() == \PHPExcel\Shared\Date::CALENDAR_MAC_1904) {
|
||||||
$objWriter->writeAttribute('date1904', '1');
|
$objWriter->writeAttribute('date1904', '1');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,11 +122,11 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write BookViews
|
* Write BookViews
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeBookViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null)
|
private function writeBookViews(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// bookViews
|
// bookViews
|
||||||
$objWriter->startElement('bookViews');
|
$objWriter->startElement('bookViews');
|
||||||
|
@ -151,11 +152,11 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write WorkbookProtection
|
* Write WorkbookProtection
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeWorkbookProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null)
|
private function writeWorkbookProtection(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
if ($pPHPExcel->getSecurity()->isSecurityEnabled()) {
|
if ($pPHPExcel->getSecurity()->isSecurityEnabled()) {
|
||||||
$objWriter->startElement('workbookProtection');
|
$objWriter->startElement('workbookProtection');
|
||||||
|
@ -178,11 +179,11 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write calcPr
|
* Write calcPr
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing
|
* @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeCalcPr(PHPExcel_Shared_XMLWriter $objWriter = null, $recalcRequired = true)
|
private function writeCalcPr(\PHPExcel\Shared\XMLWriter $objWriter = null, $recalcRequired = true)
|
||||||
{
|
{
|
||||||
$objWriter->startElement('calcPr');
|
$objWriter->startElement('calcPr');
|
||||||
|
|
||||||
|
@ -201,11 +202,11 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write sheets
|
* Write sheets
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeSheets(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null)
|
private function writeSheets(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Write sheets
|
// Write sheets
|
||||||
$objWriter->startElement('sheets');
|
$objWriter->startElement('sheets');
|
||||||
|
@ -227,14 +228,14 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write sheet
|
* Write sheet
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param string $pSheetname Sheet name
|
* @param string $pSheetname Sheet name
|
||||||
* @param int $pSheetId Sheet id
|
* @param int $pSheetId Sheet id
|
||||||
* @param int $pRelId Relationship ID
|
* @param int $pRelId Relationship ID
|
||||||
* @param string $sheetState Sheet state (visible, hidden, veryHidden)
|
* @param string $sheetState Sheet state (visible, hidden, veryHidden)
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeSheet(PHPExcel_Shared_XMLWriter $objWriter = null, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible')
|
private function writeSheet(\PHPExcel\Shared\XMLWriter $objWriter = null, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible')
|
||||||
{
|
{
|
||||||
if ($pSheetname != '') {
|
if ($pSheetname != '') {
|
||||||
// Write sheet
|
// Write sheet
|
||||||
|
@ -247,18 +248,18 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
$objWriter->writeAttribute('r:id', 'rId' . $pRelId);
|
$objWriter->writeAttribute('r:id', 'rId' . $pRelId);
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid parameters passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write Defined Names
|
* Write Defined Names
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeDefinedNames(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null)
|
private function writeDefinedNames(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
// Write defined names
|
// Write defined names
|
||||||
$objWriter->startElement('definedNames');
|
$objWriter->startElement('definedNames');
|
||||||
|
@ -288,11 +289,11 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write named ranges
|
* Write named ranges
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeNamedRanges(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel)
|
private function writeNamedRanges(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\SpreadSheet $pPHPExcel)
|
||||||
{
|
{
|
||||||
// Loop named ranges
|
// Loop named ranges
|
||||||
$namedRanges = $pPHPExcel->getNamedRanges();
|
$namedRanges = $pPHPExcel->getNamedRanges();
|
||||||
|
@ -304,11 +305,11 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write Defined Name for named range
|
* Write Defined Name for named range
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_NamedRange $pNamedRange
|
* @param PHPExcel_NamedRange $pNamedRange
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeDefinedNameForNamedRange(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_NamedRange $pNamedRange)
|
private function writeDefinedNameForNamedRange(\PHPExcel\Shared\XMLWriter $objWriter = null, PHPExcel_NamedRange $pNamedRange)
|
||||||
{
|
{
|
||||||
// definedName for named range
|
// definedName for named range
|
||||||
$objWriter->startElement('definedName');
|
$objWriter->startElement('definedName');
|
||||||
|
@ -318,14 +319,14 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create absolute coordinate and write as raw text
|
// Create absolute coordinate and write as raw text
|
||||||
$range = PHPExcel_Cell::splitRange($pNamedRange->getRange());
|
$range = \PHPExcel\Cell::splitRange($pNamedRange->getRange());
|
||||||
for ($i = 0; $i < count($range); $i++) {
|
for ($i = 0; $i < count($range); $i++) {
|
||||||
$range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . PHPExcel_Cell::absoluteReference($range[$i][0]);
|
$range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . \PHPExcel\Cell::absoluteReference($range[$i][0]);
|
||||||
if (isset($range[$i][1])) {
|
if (isset($range[$i][1])) {
|
||||||
$range[$i][1] = PHPExcel_Cell::absoluteReference($range[$i][1]);
|
$range[$i][1] = \PHPExcel\Cell::absoluteReference($range[$i][1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$range = PHPExcel_Cell::buildRange($range);
|
$range = \PHPExcel\Cell::buildRange($range);
|
||||||
|
|
||||||
$objWriter->writeRawData($range);
|
$objWriter->writeRawData($range);
|
||||||
|
|
||||||
|
@ -335,12 +336,12 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write Defined Name for autoFilter
|
* Write Defined Name for autoFilter
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet
|
* @param \PHPExcel\Worksheet $pSheet
|
||||||
* @param int $pSheetId
|
* @param int $pSheetId
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeDefinedNameForAutofilter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0)
|
private function writeDefinedNameForAutofilter(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0)
|
||||||
{
|
{
|
||||||
// definedName for autoFilter
|
// definedName for autoFilter
|
||||||
$autoFilterRange = $pSheet->getAutoFilter()->getRange();
|
$autoFilterRange = $pSheet->getAutoFilter()->getRange();
|
||||||
|
@ -351,15 +352,15 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
$objWriter->writeAttribute('hidden', '1');
|
$objWriter->writeAttribute('hidden', '1');
|
||||||
|
|
||||||
// Create absolute coordinate and write as raw text
|
// Create absolute coordinate and write as raw text
|
||||||
$range = PHPExcel_Cell::splitRange($autoFilterRange);
|
$range = \PHPExcel\Cell::splitRange($autoFilterRange);
|
||||||
$range = $range[0];
|
$range = $range[0];
|
||||||
// Strip any worksheet ref so we can make the cell ref absolute
|
// Strip any worksheet ref so we can make the cell ref absolute
|
||||||
if (strpos($range[0], '!') !== false) {
|
if (strpos($range[0], '!') !== false) {
|
||||||
list($ws, $range[0]) = explode('!', $range[0]);
|
list($ws, $range[0]) = explode('!', $range[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$range[0] = PHPExcel_Cell::absoluteCoordinate($range[0]);
|
$range[0] = \PHPExcel\Cell::absoluteCoordinate($range[0]);
|
||||||
$range[1] = PHPExcel_Cell::absoluteCoordinate($range[1]);
|
$range[1] = \PHPExcel\Cell::absoluteCoordinate($range[1]);
|
||||||
$range = implode(':', $range);
|
$range = implode(':', $range);
|
||||||
|
|
||||||
$objWriter->writeRawData('\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . $range);
|
$objWriter->writeRawData('\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . $range);
|
||||||
|
@ -371,12 +372,12 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write Defined Name for PrintTitles
|
* Write Defined Name for PrintTitles
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet
|
* @param \PHPExcel\Worksheet $pSheet
|
||||||
* @param int $pSheetId
|
* @param int $pSheetId
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeDefinedNameForPrintTitles(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0)
|
private function writeDefinedNameForPrintTitles(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0)
|
||||||
{
|
{
|
||||||
// definedName for PrintTitles
|
// definedName for PrintTitles
|
||||||
if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) {
|
if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) {
|
||||||
|
@ -414,12 +415,12 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
/**
|
/**
|
||||||
* Write Defined Name for PrintTitles
|
* Write Defined Name for PrintTitles
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet
|
* @param \PHPExcel\Worksheet $pSheet
|
||||||
* @param int $pSheetId
|
* @param int $pSheetId
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeDefinedNameForPrintArea(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0)
|
private function writeDefinedNameForPrintArea(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0)
|
||||||
{
|
{
|
||||||
// definedName for PrintArea
|
// definedName for PrintArea
|
||||||
if ($pSheet->getPageSetup()->isPrintAreaSet()) {
|
if ($pSheet->getPageSetup()->isPrintAreaSet()) {
|
||||||
|
@ -431,12 +432,12 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
|
||||||
$settingString = '';
|
$settingString = '';
|
||||||
|
|
||||||
// Print area
|
// Print area
|
||||||
$printArea = PHPExcel_Cell::splitRange($pSheet->getPageSetup()->getPrintArea());
|
$printArea = \PHPExcel\Cell::splitRange($pSheet->getPageSetup()->getPrintArea());
|
||||||
|
|
||||||
$chunks = array();
|
$chunks = array();
|
||||||
foreach ($printArea as $printAreaRect) {
|
foreach ($printArea as $printAreaRect) {
|
||||||
$printAreaRect[0] = PHPExcel_Cell::absoluteReference($printAreaRect[0]);
|
$printAreaRect[0] = \PHPExcel\Cell::absoluteReference($printAreaRect[0]);
|
||||||
$printAreaRect[1] = PHPExcel_Cell::absoluteReference($printAreaRect[1]);
|
$printAreaRect[1] = \PHPExcel\Cell::absoluteReference($printAreaRect[1]);
|
||||||
$chunks[] = '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . implode(':', $printAreaRect);
|
$chunks[] = '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . implode(':', $printAreaRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
/**
|
/**
|
||||||
* PHPExcel
|
* PHPExcel
|
||||||
*
|
*
|
||||||
|
@ -33,16 +34,16 @@
|
||||||
* @package PHPExcel_Writer_Excel2007
|
* @package PHPExcel_Writer_Excel2007
|
||||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||||
*/
|
*/
|
||||||
class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_WriterPart
|
class Worksheet extends WriterPart
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Write worksheet to XML format
|
* Write worksheet to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pSheet
|
* @param \PHPExcel\Worksheet $pSheet
|
||||||
* @param string[] $pStringTable
|
* @param string[] $pStringTable
|
||||||
* @param boolean $includeCharts Flag indicating if we should write charts
|
* @param boolean $includeCharts Flag indicating if we should write charts
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeWorksheet($pSheet = null, $pStringTable = null, $includeCharts = false)
|
public function writeWorksheet($pSheet = null, $pStringTable = null, $includeCharts = false)
|
||||||
{
|
{
|
||||||
|
@ -50,9 +51,9 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
$objWriter = null;
|
$objWriter = null;
|
||||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
||||||
} else {
|
} else {
|
||||||
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XML header
|
// XML header
|
||||||
|
@ -132,18 +133,18 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
// Return
|
// Return
|
||||||
return $objWriter->getData();
|
return $objWriter->getData();
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid PHPExcel_Worksheet object passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid \\PHPExcel\\Worksheet object passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write SheetPr
|
* Write SheetPr
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeSheetPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeSheetPr(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// sheetPr
|
// sheetPr
|
||||||
$objWriter->startElement('sheetPr');
|
$objWriter->startElement('sheetPr');
|
||||||
|
@ -186,11 +187,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write Dimension
|
* Write Dimension
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeDimension(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeDimension(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// dimension
|
// dimension
|
||||||
$objWriter->startElement('dimension');
|
$objWriter->startElement('dimension');
|
||||||
|
@ -201,11 +202,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write SheetViews
|
* Write SheetViews
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeSheetViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeSheetViews(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// sheetViews
|
// sheetViews
|
||||||
$objWriter->startElement('sheetViews');
|
$objWriter->startElement('sheetViews');
|
||||||
|
@ -230,7 +231,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
}
|
}
|
||||||
|
|
||||||
// View Layout Type
|
// View Layout Type
|
||||||
if ($pSheet->getSheetView()->getView() !== PHPExcel_Worksheet_SheetView::SHEETVIEW_NORMAL) {
|
if ($pSheet->getSheetView()->getView() !== \PHPExcel\Worksheet\SheetView::SHEETVIEW_NORMAL) {
|
||||||
$objWriter->writeAttribute('view', $pSheet->getSheetView()->getView());
|
$objWriter->writeAttribute('view', $pSheet->getSheetView()->getView());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,8 +264,8 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
// Calculate freeze coordinates
|
// Calculate freeze coordinates
|
||||||
$xSplit = $ySplit = 0;
|
$xSplit = $ySplit = 0;
|
||||||
|
|
||||||
list($xSplit, $ySplit) = PHPExcel_Cell::coordinateFromString($topLeftCell);
|
list($xSplit, $ySplit) = \PHPExcel\Cell::coordinateFromString($topLeftCell);
|
||||||
$xSplit = PHPExcel_Cell::columnIndexFromString($xSplit);
|
$xSplit = \PHPExcel\Cell::columnIndexFromString($xSplit);
|
||||||
|
|
||||||
// pane
|
// pane
|
||||||
$pane = 'topRight';
|
$pane = 'topRight';
|
||||||
|
@ -313,11 +314,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write SheetFormatPr
|
* Write SheetFormatPr
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeSheetFormatPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeSheetFormatPr(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// sheetFormatPr
|
// sheetFormatPr
|
||||||
$objWriter->startElement('sheetFormatPr');
|
$objWriter->startElement('sheetFormatPr');
|
||||||
|
@ -325,7 +326,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
// Default row height
|
// Default row height
|
||||||
if ($pSheet->getDefaultRowDimension()->getRowHeight() >= 0) {
|
if ($pSheet->getDefaultRowDimension()->getRowHeight() >= 0) {
|
||||||
$objWriter->writeAttribute('customHeight', 'true');
|
$objWriter->writeAttribute('customHeight', 'true');
|
||||||
$objWriter->writeAttribute('defaultRowHeight', PHPExcel_Shared_String::FormatNumber($pSheet->getDefaultRowDimension()->getRowHeight()));
|
$objWriter->writeAttribute('defaultRowHeight', \PHPExcel\Shared\String::FormatNumber($pSheet->getDefaultRowDimension()->getRowHeight()));
|
||||||
} else {
|
} else {
|
||||||
$objWriter->writeAttribute('defaultRowHeight', '14.4');
|
$objWriter->writeAttribute('defaultRowHeight', '14.4');
|
||||||
}
|
}
|
||||||
|
@ -338,7 +339,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
|
|
||||||
// Default column width
|
// Default column width
|
||||||
if ($pSheet->getDefaultColumnDimension()->getWidth() >= 0) {
|
if ($pSheet->getDefaultColumnDimension()->getWidth() >= 0) {
|
||||||
$objWriter->writeAttribute('defaultColWidth', PHPExcel_Shared_String::FormatNumber($pSheet->getDefaultColumnDimension()->getWidth()));
|
$objWriter->writeAttribute('defaultColWidth', \PHPExcel\Shared\String::FormatNumber($pSheet->getDefaultColumnDimension()->getWidth()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Outline level - row
|
// Outline level - row
|
||||||
|
@ -365,11 +366,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write Cols
|
* Write Cols
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeCols(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeCols(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// cols
|
// cols
|
||||||
if (count($pSheet->getColumnDimensions()) > 0) {
|
if (count($pSheet->getColumnDimensions()) > 0) {
|
||||||
|
@ -381,15 +382,15 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
foreach ($pSheet->getColumnDimensions() as $colDimension) {
|
foreach ($pSheet->getColumnDimensions() as $colDimension) {
|
||||||
// col
|
// col
|
||||||
$objWriter->startElement('col');
|
$objWriter->startElement('col');
|
||||||
$objWriter->writeAttribute('min', PHPExcel_Cell::columnIndexFromString($colDimension->getColumnIndex()));
|
$objWriter->writeAttribute('min', \PHPExcel\Cell::columnIndexFromString($colDimension->getColumnIndex()));
|
||||||
$objWriter->writeAttribute('max', PHPExcel_Cell::columnIndexFromString($colDimension->getColumnIndex()));
|
$objWriter->writeAttribute('max', \PHPExcel\Cell::columnIndexFromString($colDimension->getColumnIndex()));
|
||||||
|
|
||||||
if ($colDimension->getWidth() < 0) {
|
if ($colDimension->getWidth() < 0) {
|
||||||
// No width set, apply default of 10
|
// No width set, apply default of 10
|
||||||
$objWriter->writeAttribute('width', '9.10');
|
$objWriter->writeAttribute('width', '9.10');
|
||||||
} else {
|
} else {
|
||||||
// Width set
|
// Width set
|
||||||
$objWriter->writeAttribute('width', PHPExcel_Shared_String::FormatNumber($colDimension->getWidth()));
|
$objWriter->writeAttribute('width', \PHPExcel\Shared\String::FormatNumber($colDimension->getWidth()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Column visibility
|
// Column visibility
|
||||||
|
@ -430,11 +431,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write SheetProtection
|
* Write SheetProtection
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeSheetProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeSheetProtection(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// sheetProtection
|
// sheetProtection
|
||||||
$objWriter->startElement('sheetProtection');
|
$objWriter->startElement('sheetProtection');
|
||||||
|
@ -465,11 +466,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write ConditionalFormatting
|
* Write ConditionalFormatting
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeConditionalFormatting(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeConditionalFormatting(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// Conditional id
|
// Conditional id
|
||||||
$id = 1;
|
$id = 1;
|
||||||
|
@ -481,7 +482,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
// if ($this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()) == '') {
|
// if ($this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()) == '') {
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
if ($conditional->getConditionType() != PHPExcel_Style_Conditional::CONDITION_NONE) {
|
if ($conditional->getConditionType() != \PHPExcel\Style\Conditional::CONDITION_NONE) {
|
||||||
// conditionalFormatting
|
// conditionalFormatting
|
||||||
$objWriter->startElement('conditionalFormatting');
|
$objWriter->startElement('conditionalFormatting');
|
||||||
$objWriter->writeAttribute('sqref', $cellCoordinate);
|
$objWriter->writeAttribute('sqref', $cellCoordinate);
|
||||||
|
@ -492,35 +493,35 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
$objWriter->writeAttribute('dxfId', $this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()));
|
$objWriter->writeAttribute('dxfId', $this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()));
|
||||||
$objWriter->writeAttribute('priority', $id++);
|
$objWriter->writeAttribute('priority', $id++);
|
||||||
|
|
||||||
if (($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT)
|
if (($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CELLIS || $conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT)
|
||||||
&& $conditional->getOperatorType() != PHPExcel_Style_Conditional::OPERATOR_NONE) {
|
&& $conditional->getOperatorType() != \PHPExcel\Style\Conditional::OPERATOR_NONE) {
|
||||||
$objWriter->writeAttribute('operator', $conditional->getOperatorType());
|
$objWriter->writeAttribute('operator', $conditional->getOperatorType());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
|
if ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT
|
||||||
&& !is_null($conditional->getText())) {
|
&& !is_null($conditional->getText())) {
|
||||||
$objWriter->writeAttribute('text', $conditional->getText());
|
$objWriter->writeAttribute('text', $conditional->getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
|
if ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT
|
||||||
&& $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_CONTAINSTEXT
|
&& $conditional->getOperatorType() == \PHPExcel\Style\Conditional::OPERATOR_CONTAINSTEXT
|
||||||
&& !is_null($conditional->getText())) {
|
&& !is_null($conditional->getText())) {
|
||||||
$objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))');
|
$objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))');
|
||||||
} elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
|
} elseif ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT
|
||||||
&& $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_BEGINSWITH
|
&& $conditional->getOperatorType() == \PHPExcel\Style\Conditional::OPERATOR_BEGINSWITH
|
||||||
&& !is_null($conditional->getText())) {
|
&& !is_null($conditional->getText())) {
|
||||||
$objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"');
|
$objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"');
|
||||||
} elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
|
} elseif ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT
|
||||||
&& $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_ENDSWITH
|
&& $conditional->getOperatorType() == \PHPExcel\Style\Conditional::OPERATOR_ENDSWITH
|
||||||
&& !is_null($conditional->getText())) {
|
&& !is_null($conditional->getText())) {
|
||||||
$objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"');
|
$objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"');
|
||||||
} elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
|
} elseif ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT
|
||||||
&& $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_NOTCONTAINS
|
&& $conditional->getOperatorType() == \PHPExcel\Style\Conditional::OPERATOR_NOTCONTAINS
|
||||||
&& !is_null($conditional->getText())) {
|
&& !is_null($conditional->getText())) {
|
||||||
$objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))');
|
$objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))');
|
||||||
} elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS
|
} elseif ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CELLIS
|
||||||
|| $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
|
|| $conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT
|
||||||
|| $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) {
|
|| $conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_EXPRESSION) {
|
||||||
foreach ($conditional->getConditions() as $formula) {
|
foreach ($conditional->getConditions() as $formula) {
|
||||||
// Formula
|
// Formula
|
||||||
$objWriter->writeElement('formula', $formula);
|
$objWriter->writeElement('formula', $formula);
|
||||||
|
@ -538,11 +539,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write DataValidations
|
* Write DataValidations
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeDataValidations(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeDataValidations(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// Datavalidation collection
|
// Datavalidation collection
|
||||||
$dataValidationCollection = $pSheet->getDataValidationCollection();
|
$dataValidationCollection = $pSheet->getDataValidationCollection();
|
||||||
|
@ -604,11 +605,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write Hyperlinks
|
* Write Hyperlinks
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeHyperlinks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeHyperlinks(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// Hyperlink collection
|
// Hyperlink collection
|
||||||
$hyperlinkCollection = $pSheet->getHyperlinkCollection();
|
$hyperlinkCollection = $pSheet->getHyperlinkCollection();
|
||||||
|
@ -645,11 +646,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write ProtectedRanges
|
* Write ProtectedRanges
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeProtectedRanges(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeProtectedRanges(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
if (count($pSheet->getProtectedCells()) > 0) {
|
if (count($pSheet->getProtectedCells()) > 0) {
|
||||||
// protectedRanges
|
// protectedRanges
|
||||||
|
@ -674,11 +675,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write MergeCells
|
* Write MergeCells
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeMergeCells(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeMergeCells(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
if (count($pSheet->getMergeCells()) > 0) {
|
if (count($pSheet->getMergeCells()) > 0) {
|
||||||
// mergeCells
|
// mergeCells
|
||||||
|
@ -699,11 +700,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write PrintOptions
|
* Write PrintOptions
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writePrintOptions(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writePrintOptions(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// printOptions
|
// printOptions
|
||||||
$objWriter->startElement('printOptions');
|
$objWriter->startElement('printOptions');
|
||||||
|
@ -725,31 +726,31 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write PageMargins
|
* Write PageMargins
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writePageMargins(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writePageMargins(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// pageMargins
|
// pageMargins
|
||||||
$objWriter->startElement('pageMargins');
|
$objWriter->startElement('pageMargins');
|
||||||
$objWriter->writeAttribute('left', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getLeft()));
|
$objWriter->writeAttribute('left', \PHPExcel\Shared\String::FormatNumber($pSheet->getPageMargins()->getLeft()));
|
||||||
$objWriter->writeAttribute('right', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getRight()));
|
$objWriter->writeAttribute('right', \PHPExcel\Shared\String::FormatNumber($pSheet->getPageMargins()->getRight()));
|
||||||
$objWriter->writeAttribute('top', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getTop()));
|
$objWriter->writeAttribute('top', \PHPExcel\Shared\String::FormatNumber($pSheet->getPageMargins()->getTop()));
|
||||||
$objWriter->writeAttribute('bottom', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getBottom()));
|
$objWriter->writeAttribute('bottom', \PHPExcel\Shared\String::FormatNumber($pSheet->getPageMargins()->getBottom()));
|
||||||
$objWriter->writeAttribute('header', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getHeader()));
|
$objWriter->writeAttribute('header', \PHPExcel\Shared\String::FormatNumber($pSheet->getPageMargins()->getHeader()));
|
||||||
$objWriter->writeAttribute('footer', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getFooter()));
|
$objWriter->writeAttribute('footer', \PHPExcel\Shared\String::FormatNumber($pSheet->getPageMargins()->getFooter()));
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write AutoFilter
|
* Write AutoFilter
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeAutoFilter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeAutoFilter(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
$autoFilterRange = $pSheet->getAutoFilter()->getRange();
|
$autoFilterRange = $pSheet->getAutoFilter()->getRange();
|
||||||
if (!empty($autoFilterRange)) {
|
if (!empty($autoFilterRange)) {
|
||||||
|
@ -757,7 +758,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
$objWriter->startElement('autoFilter');
|
$objWriter->startElement('autoFilter');
|
||||||
|
|
||||||
// Strip any worksheet reference from the filter coordinates
|
// Strip any worksheet reference from the filter coordinates
|
||||||
$range = PHPExcel_Cell::splitRange($autoFilterRange);
|
$range = \PHPExcel\Cell::splitRange($autoFilterRange);
|
||||||
$range = $range[0];
|
$range = $range[0];
|
||||||
// Strip any worksheet ref
|
// Strip any worksheet ref
|
||||||
if (strpos($range[0], '!') !== false) {
|
if (strpos($range[0], '!') !== false) {
|
||||||
|
@ -776,17 +777,17 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
$objWriter->writeAttribute('colId', $pSheet->getAutoFilter()->getColumnOffset($columnID));
|
$objWriter->writeAttribute('colId', $pSheet->getAutoFilter()->getColumnOffset($columnID));
|
||||||
|
|
||||||
$objWriter->startElement($column->getFilterType());
|
$objWriter->startElement($column->getFilterType());
|
||||||
if ($column->getJoin() == PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND) {
|
if ($column->getJoin() == \PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND) {
|
||||||
$objWriter->writeAttribute('and', 1);
|
$objWriter->writeAttribute('and', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($rules as $rule) {
|
foreach ($rules as $rule) {
|
||||||
if (($column->getFilterType() === PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER) &&
|
if (($column->getFilterType() === \PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) &&
|
||||||
($rule->getOperator() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL) &&
|
($rule->getOperator() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL) &&
|
||||||
($rule->getValue() === '')) {
|
($rule->getValue() === '')) {
|
||||||
// Filter rule for Blanks
|
// Filter rule for Blanks
|
||||||
$objWriter->writeAttribute('blank', 1);
|
$objWriter->writeAttribute('blank', 1);
|
||||||
} elseif ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER) {
|
} elseif ($rule->getRuleType() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER) {
|
||||||
// Dynamic Filter Rule
|
// Dynamic Filter Rule
|
||||||
$objWriter->writeAttribute('type', $rule->getGrouping());
|
$objWriter->writeAttribute('type', $rule->getGrouping());
|
||||||
$val = $column->getAttribute('val');
|
$val = $column->getAttribute('val');
|
||||||
|
@ -797,19 +798,19 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
if ($maxVal !== null) {
|
if ($maxVal !== null) {
|
||||||
$objWriter->writeAttribute('maxVal', $maxVal);
|
$objWriter->writeAttribute('maxVal', $maxVal);
|
||||||
}
|
}
|
||||||
} elseif ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) {
|
} elseif ($rule->getRuleType() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) {
|
||||||
// Top 10 Filter Rule
|
// Top 10 Filter Rule
|
||||||
$objWriter->writeAttribute('val', $rule->getValue());
|
$objWriter->writeAttribute('val', $rule->getValue());
|
||||||
$objWriter->writeAttribute('percent', (($rule->getOperator() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) ? '1' : '0'));
|
$objWriter->writeAttribute('percent', (($rule->getOperator() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) ? '1' : '0'));
|
||||||
$objWriter->writeAttribute('top', (($rule->getGrouping() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1': '0'));
|
$objWriter->writeAttribute('top', (($rule->getGrouping() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1': '0'));
|
||||||
} else {
|
} else {
|
||||||
// Filter, DateGroupItem or CustomFilter
|
// Filter, DateGroupItem or CustomFilter
|
||||||
$objWriter->startElement($rule->getRuleType());
|
$objWriter->startElement($rule->getRuleType());
|
||||||
|
|
||||||
if ($rule->getOperator() !== PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL) {
|
if ($rule->getOperator() !== \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL) {
|
||||||
$objWriter->writeAttribute('operator', $rule->getOperator());
|
$objWriter->writeAttribute('operator', $rule->getOperator());
|
||||||
}
|
}
|
||||||
if ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP) {
|
if ($rule->getRuleType() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP) {
|
||||||
// Date Group filters
|
// Date Group filters
|
||||||
foreach ($rule->getValue() as $key => $value) {
|
foreach ($rule->getValue() as $key => $value) {
|
||||||
if ($value > '') {
|
if ($value > '') {
|
||||||
|
@ -838,11 +839,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write PageSetup
|
* Write PageSetup
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writePageSetup(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writePageSetup(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// pageSetup
|
// pageSetup
|
||||||
$objWriter->startElement('pageSetup');
|
$objWriter->startElement('pageSetup');
|
||||||
|
@ -873,11 +874,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write Header / Footer
|
* Write Header / Footer
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeHeaderFooter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeHeaderFooter(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// headerFooter
|
// headerFooter
|
||||||
$objWriter->startElement('headerFooter');
|
$objWriter->startElement('headerFooter');
|
||||||
|
@ -898,19 +899,19 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write Breaks
|
* Write Breaks
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeBreaks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeBreaks(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// Get row and column breaks
|
// Get row and column breaks
|
||||||
$aRowBreaks = array();
|
$aRowBreaks = array();
|
||||||
$aColumnBreaks = array();
|
$aColumnBreaks = array();
|
||||||
foreach ($pSheet->getBreaks() as $cell => $breakType) {
|
foreach ($pSheet->getBreaks() as $cell => $breakType) {
|
||||||
if ($breakType == PHPExcel_Worksheet::BREAK_ROW) {
|
if ($breakType == \PHPExcel\Worksheet::BREAK_ROW) {
|
||||||
$aRowBreaks[] = $cell;
|
$aRowBreaks[] = $cell;
|
||||||
} elseif ($breakType == PHPExcel_Worksheet::BREAK_COLUMN) {
|
} elseif ($breakType == \PHPExcel\Worksheet::BREAK_COLUMN) {
|
||||||
$aColumnBreaks[] = $cell;
|
$aColumnBreaks[] = $cell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -922,7 +923,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
$objWriter->writeAttribute('manualBreakCount', count($aRowBreaks));
|
$objWriter->writeAttribute('manualBreakCount', count($aRowBreaks));
|
||||||
|
|
||||||
foreach ($aRowBreaks as $cell) {
|
foreach ($aRowBreaks as $cell) {
|
||||||
$coords = PHPExcel_Cell::coordinateFromString($cell);
|
$coords = \PHPExcel\Cell::coordinateFromString($cell);
|
||||||
|
|
||||||
$objWriter->startElement('brk');
|
$objWriter->startElement('brk');
|
||||||
$objWriter->writeAttribute('id', $coords[1]);
|
$objWriter->writeAttribute('id', $coords[1]);
|
||||||
|
@ -940,10 +941,10 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
$objWriter->writeAttribute('manualBreakCount', count($aColumnBreaks));
|
$objWriter->writeAttribute('manualBreakCount', count($aColumnBreaks));
|
||||||
|
|
||||||
foreach ($aColumnBreaks as $cell) {
|
foreach ($aColumnBreaks as $cell) {
|
||||||
$coords = PHPExcel_Cell::coordinateFromString($cell);
|
$coords = \PHPExcel\Cell::coordinateFromString($cell);
|
||||||
|
|
||||||
$objWriter->startElement('brk');
|
$objWriter->startElement('brk');
|
||||||
$objWriter->writeAttribute('id', PHPExcel_Cell::columnIndexFromString($coords[0]) - 1);
|
$objWriter->writeAttribute('id', \PHPExcel\Cell::columnIndexFromString($coords[0]) - 1);
|
||||||
$objWriter->writeAttribute('man', '1');
|
$objWriter->writeAttribute('man', '1');
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
}
|
}
|
||||||
|
@ -955,12 +956,12 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write SheetData
|
* Write SheetData
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @param string[] $pStringTable String table
|
* @param string[] $pStringTable String table
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeSheetData(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pStringTable = null)
|
private function writeSheetData(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $pStringTable = null)
|
||||||
{
|
{
|
||||||
if (is_array($pStringTable)) {
|
if (is_array($pStringTable)) {
|
||||||
// Flipped stringtable, for faster index searching
|
// Flipped stringtable, for faster index searching
|
||||||
|
@ -970,7 +971,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
$objWriter->startElement('sheetData');
|
$objWriter->startElement('sheetData');
|
||||||
|
|
||||||
// Get column count
|
// Get column count
|
||||||
$colCount = PHPExcel_Cell::columnIndexFromString($pSheet->getHighestColumn());
|
$colCount = \PHPExcel\Cell::columnIndexFromString($pSheet->getHighestColumn());
|
||||||
|
|
||||||
// Highest row number
|
// Highest row number
|
||||||
$highestRow = $pSheet->getHighestRow();
|
$highestRow = $pSheet->getHighestRow();
|
||||||
|
@ -978,7 +979,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
// Loop through cells
|
// Loop through cells
|
||||||
$cellsByRow = array();
|
$cellsByRow = array();
|
||||||
foreach ($pSheet->getCellCollection() as $cellID) {
|
foreach ($pSheet->getCellCollection() as $cellID) {
|
||||||
$cellAddress = PHPExcel_Cell::coordinateFromString($cellID);
|
$cellAddress = \PHPExcel\Cell::coordinateFromString($cellID);
|
||||||
$cellsByRow[$cellAddress[1]][] = $cellID;
|
$cellsByRow[$cellAddress[1]][] = $cellID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -999,7 +1000,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
// Row dimensions
|
// Row dimensions
|
||||||
if ($rowDimension->getRowHeight() >= 0) {
|
if ($rowDimension->getRowHeight() >= 0) {
|
||||||
$objWriter->writeAttribute('customHeight', '1');
|
$objWriter->writeAttribute('customHeight', '1');
|
||||||
$objWriter->writeAttribute('ht', PHPExcel_Shared_String::FormatNumber($rowDimension->getRowHeight()));
|
$objWriter->writeAttribute('ht', \PHPExcel\Shared\String::FormatNumber($rowDimension->getRowHeight()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Row visibility
|
// Row visibility
|
||||||
|
@ -1038,21 +1039,21 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
|
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid parameters passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write Cell
|
* Write Cell
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @param PHPExcel_Cell $pCellAddress Cell Address
|
* @param \PHPExcel\Cell $pCellAddress Cell Address
|
||||||
* @param string[] $pStringTable String table
|
* @param string[] $pStringTable String table
|
||||||
* @param string[] $pFlippedStringTable String table (flipped), for faster index searching
|
* @param string[] $pFlippedStringTable String table (flipped), for faster index searching
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeCell(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pCellAddress = null, $pStringTable = null, $pFlippedStringTable = null)
|
private function writeCell(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $pCellAddress = null, $pStringTable = null, $pFlippedStringTable = null)
|
||||||
{
|
{
|
||||||
if (is_array($pStringTable) && is_array($pFlippedStringTable)) {
|
if (is_array($pStringTable) && is_array($pFlippedStringTable)) {
|
||||||
// Cell
|
// Cell
|
||||||
|
@ -1093,9 +1094,9 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
// Write data depending on its type
|
// Write data depending on its type
|
||||||
switch (strtolower($mappedType)) {
|
switch (strtolower($mappedType)) {
|
||||||
case 'inlinestr': // Inline string
|
case 'inlinestr': // Inline string
|
||||||
if (! $cellValue instanceof PHPExcel_RichText) {
|
if (! $cellValue instanceof \PHPExcel\RichText) {
|
||||||
$objWriter->writeElement('t', PHPExcel_Shared_String::ControlCharacterPHP2OOXML(htmlspecialchars($cellValue)));
|
$objWriter->writeElement('t', \PHPExcel\Shared\String::ControlCharacterPHP2OOXML(htmlspecialchars($cellValue)));
|
||||||
} elseif ($cellValue instanceof PHPExcel_RichText) {
|
} elseif ($cellValue instanceof \PHPExcel\RichText) {
|
||||||
$objWriter->startElement('is');
|
$objWriter->startElement('is');
|
||||||
$this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $cellValue);
|
$this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $cellValue);
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
|
@ -1103,11 +1104,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 's': // String
|
case 's': // String
|
||||||
if (! $cellValue instanceof PHPExcel_RichText) {
|
if (! $cellValue instanceof \PHPExcel\RichText) {
|
||||||
if (isset($pFlippedStringTable[$cellValue])) {
|
if (isset($pFlippedStringTable[$cellValue])) {
|
||||||
$objWriter->writeElement('v', $pFlippedStringTable[$cellValue]);
|
$objWriter->writeElement('v', $pFlippedStringTable[$cellValue]);
|
||||||
}
|
}
|
||||||
} elseif ($cellValue instanceof PHPExcel_RichText) {
|
} elseif ($cellValue instanceof \PHPExcel\RichText) {
|
||||||
$objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]);
|
$objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1129,7 +1130,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
if ($this->getParentWriter()->getPreCalculateFormulas()) {
|
if ($this->getParentWriter()->getPreCalculateFormulas()) {
|
||||||
// $calculatedValue = $pCell->getCalculatedValue();
|
// $calculatedValue = $pCell->getCalculatedValue();
|
||||||
if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') {
|
if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') {
|
||||||
$objWriter->writeElement('v', PHPExcel_Shared_String::FormatNumber($calculatedValue));
|
$objWriter->writeElement('v', \PHPExcel\Shared\String::FormatNumber($calculatedValue));
|
||||||
} else {
|
} else {
|
||||||
$objWriter->writeElement('v', '0');
|
$objWriter->writeElement('v', '0');
|
||||||
}
|
}
|
||||||
|
@ -1159,19 +1160,19 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
|
|
||||||
$objWriter->endElement();
|
$objWriter->endElement();
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid parameters passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write Drawings
|
* Write Drawings
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @param boolean $includeCharts Flag indicating if we should include drawing details for charts
|
* @param boolean $includeCharts Flag indicating if we should include drawing details for charts
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeDrawings(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $includeCharts = false)
|
private function writeDrawings(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $includeCharts = false)
|
||||||
{
|
{
|
||||||
$chartCount = ($includeCharts) ? $pSheet->getChartCollection()->count() : 0;
|
$chartCount = ($includeCharts) ? $pSheet->getChartCollection()->count() : 0;
|
||||||
// If sheet contains drawings, add the relationships
|
// If sheet contains drawings, add the relationships
|
||||||
|
@ -1186,11 +1187,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write LegacyDrawing
|
* Write LegacyDrawing
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeLegacyDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeLegacyDrawing(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// If sheet contains comments, add the relationships
|
// If sheet contains comments, add the relationships
|
||||||
if (count($pSheet->getComments()) > 0) {
|
if (count($pSheet->getComments()) > 0) {
|
||||||
|
@ -1203,11 +1204,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
|
||||||
/**
|
/**
|
||||||
* Write LegacyDrawingHF
|
* Write LegacyDrawingHF
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
|
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
|
||||||
* @param PHPExcel_Worksheet $pSheet Worksheet
|
* @param \PHPExcel\Worksheet $pSheet Worksheet
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeLegacyDrawingHF(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
|
private function writeLegacyDrawingHF(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null)
|
||||||
{
|
{
|
||||||
// If sheet contains images, add the relationships
|
// If sheet contains images, add the relationships
|
||||||
if (count($pSheet->getHeaderFooter()->getImages()) > 0) {
|
if (count($pSheet->getHeaderFooter()->getImages()) > 0) {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace PHPExcel\Writer\Excel2007;
|
namespace PHPExcel\Writer\Excel2007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Excel2007_WriterPart
|
* \PHPExcel\Writer\Excel2007\WriterPart
|
||||||
*
|
*
|
||||||
* Copyright (c) 2006 - 2015 PHPExcel
|
* Copyright (c) 2006 - 2015 PHPExcel
|
||||||
*
|
*
|
||||||
|
@ -58,7 +58,7 @@ abstract class WriterPart
|
||||||
if (!is_null($this->parentWriter)) {
|
if (!is_null($this->parentWriter)) {
|
||||||
return $this->parentWriter;
|
return $this->parentWriter;
|
||||||
} else {
|
} else {
|
||||||
throw new \PHPExcel\Writer\Exception("No parent \PHPExcel\Writer\IWriter assigned.");
|
throw new \PHPExcel\Writer\Exception("No parent \\PHPExcel\\Writer\\IWriter assigned.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||||
* Save PHPExcel to file
|
* Save PHPExcel to file
|
||||||
*
|
*
|
||||||
* @param string $pFilename
|
* @param string $pFilename
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename = null)
|
||||||
{
|
{
|
||||||
|
@ -116,8 +116,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||||
|
|
||||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog();
|
$saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog();
|
||||||
PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false);
|
PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false);
|
||||||
$saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType();
|
$saveDateReturnType = \PHPExcel\Calculation\Functions::getReturnDateType();
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
\PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
|
||||||
|
|
||||||
// initialize colors array
|
// initialize colors array
|
||||||
$this->colors = array();
|
$this->colors = array();
|
||||||
|
@ -152,10 +152,10 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||||
foreach ($this->writerWorksheets[$i]->phpSheet->getCellCollection() as $cellID) {
|
foreach ($this->writerWorksheets[$i]->phpSheet->getCellCollection() as $cellID) {
|
||||||
$cell = $this->writerWorksheets[$i]->phpSheet->getCell($cellID);
|
$cell = $this->writerWorksheets[$i]->phpSheet->getCell($cellID);
|
||||||
$cVal = $cell->getValue();
|
$cVal = $cell->getValue();
|
||||||
if ($cVal instanceof PHPExcel_RichText) {
|
if ($cVal instanceof \PHPExcel\RichText) {
|
||||||
$elements = $cVal->getRichTextElements();
|
$elements = $cVal->getRichTextElements();
|
||||||
foreach ($elements as $element) {
|
foreach ($elements as $element) {
|
||||||
if ($element instanceof PHPExcel_RichText_Run) {
|
if ($element instanceof \PHPExcel\RichText\Run) {
|
||||||
$font = $element->getFont();
|
$font = $element->getFont();
|
||||||
$this->writerWorksheets[$i]->fontHashIndex[$font->getHashCode()] = $this->writerWorkbook->addFont($font);
|
$this->writerWorksheets[$i]->fontHashIndex[$font->getHashCode()] = $this->writerWorkbook->addFont($font);
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||||
// save the OLE file
|
// save the OLE file
|
||||||
$res = $root->save($pFilename);
|
$res = $root->save($pFilename);
|
||||||
|
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType);
|
\PHPExcel\Calculation\Functions::setReturnDateType($saveDateReturnType);
|
||||||
PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog);
|
PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||||
*
|
*
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @param string $pValue Temporary storage directory
|
* @param string $pValue Temporary storage directory
|
||||||
* @throws PHPExcel_Writer_Exception when directory does not exist
|
* @throws \PHPExcel\Writer\Exception when directory does not exist
|
||||||
* @return PHPExcel_Writer_Excel5
|
* @return PHPExcel_Writer_Excel5
|
||||||
*/
|
*/
|
||||||
public function setTempDir($pValue = '')
|
public function setTempDir($pValue = '')
|
||||||
|
@ -337,7 +337,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||||
++$countShapes[$sheetIndex];
|
++$countShapes[$sheetIndex];
|
||||||
|
|
||||||
// create an Drawing Object for the dropdown
|
// create an Drawing Object for the dropdown
|
||||||
$oDrawing = new PHPExcel_Worksheet_BaseDrawing();
|
$oDrawing = new \PHPExcel\Worksheet\BaseDrawing();
|
||||||
// get the coordinates of drawing
|
// get the coordinates of drawing
|
||||||
$cDrawing = PHPExcel_Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1];
|
$cDrawing = PHPExcel_Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1];
|
||||||
$oDrawing->setCoordinates($cDrawing);
|
$oDrawing->setCoordinates($cDrawing);
|
||||||
|
@ -458,7 +458,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||||
// the BSE's (all the images)
|
// the BSE's (all the images)
|
||||||
foreach ($this->phpExcel->getAllsheets() as $sheet) {
|
foreach ($this->phpExcel->getAllsheets() as $sheet) {
|
||||||
foreach ($sheet->getDrawingCollection() as $drawing) {
|
foreach ($sheet->getDrawingCollection() as $drawing) {
|
||||||
if ($drawing instanceof PHPExcel_Worksheet_Drawing) {
|
if ($drawing instanceof \PHPExcel\Worksheet\Drawing) {
|
||||||
$filename = $drawing->getPath();
|
$filename = $drawing->getPath();
|
||||||
|
|
||||||
list($imagesx, $imagesy, $imageFormat) = getimagesize($filename);
|
list($imagesx, $imagesy, $imageFormat) = getimagesize($filename);
|
||||||
|
@ -482,7 +482,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||||
case 6: // Windows DIB (BMP), we convert to PNG
|
case 6: // Windows DIB (BMP), we convert to PNG
|
||||||
$blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG;
|
$blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG;
|
||||||
ob_start();
|
ob_start();
|
||||||
imagepng(PHPExcel_Shared_Drawing::imagecreatefrombmp($filename));
|
imagepng(\PHPExcel\Shared\Drawing::imagecreatefrombmp($filename));
|
||||||
$blipData = ob_get_contents();
|
$blipData = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
break;
|
break;
|
||||||
|
@ -498,15 +498,15 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||||
$BSE->setBlip($blip);
|
$BSE->setBlip($blip);
|
||||||
|
|
||||||
$bstoreContainer->addBSE($BSE);
|
$bstoreContainer->addBSE($BSE);
|
||||||
} elseif ($drawing instanceof PHPExcel_Worksheet_MemoryDrawing) {
|
} elseif ($drawing instanceof \PHPExcel\Worksheet\MemoryDrawing) {
|
||||||
switch ($drawing->getRenderingFunction()) {
|
switch ($drawing->getRenderingFunction()) {
|
||||||
case PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG:
|
case \PHPExcel\Worksheet\MemoryDrawing::RENDERING_JPEG:
|
||||||
$blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG;
|
$blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG;
|
||||||
$renderingFunction = 'imagejpeg';
|
$renderingFunction = 'imagejpeg';
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Worksheet_MemoryDrawing::RENDERING_GIF:
|
case \PHPExcel\Worksheet\MemoryDrawing::RENDERING_GIF:
|
||||||
case PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG:
|
case \PHPExcel\Worksheet\MemoryDrawing::RENDERING_PNG:
|
||||||
case PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT:
|
case \PHPExcel\Worksheet\MemoryDrawing::RENDERING_DEFAULT:
|
||||||
$blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG;
|
$blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG;
|
||||||
$renderingFunction = 'imagepng';
|
$renderingFunction = 'imagepng';
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -114,7 +114,7 @@ class PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$byte_order = 1; // Big Endian
|
$byte_order = 1; // Big Endian
|
||||||
} else {
|
} else {
|
||||||
// Give up. I'll fix this in a later version.
|
// Give up. I'll fix this in a later version.
|
||||||
throw new PHPExcel_Writer_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::$byteOrder = $byte_order;
|
self::$byteOrder = $byte_order;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,16 +37,16 @@ class PHPExcel_Writer_Excel5_Font
|
||||||
/**
|
/**
|
||||||
* Font
|
* Font
|
||||||
*
|
*
|
||||||
* @var PHPExcel_Style_Font
|
* @var \PHPExcel\Style\Font
|
||||||
*/
|
*/
|
||||||
private $font;
|
private $font;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Style_Font $font
|
* @param \PHPExcel\Style\Font $font
|
||||||
*/
|
*/
|
||||||
public function __construct(PHPExcel_Style_Font $font = null)
|
public function __construct(\PHPExcel\Style\Font $font = null)
|
||||||
{
|
{
|
||||||
$this->colorIndex = 0x7FFF;
|
$this->colorIndex = 0x7FFF;
|
||||||
$this->font = $font;
|
$this->font = $font;
|
||||||
|
@ -143,11 +143,11 @@ class PHPExcel_Writer_Excel5_Font
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static $mapUnderline = array(
|
private static $mapUnderline = array(
|
||||||
PHPExcel_Style_Font::UNDERLINE_NONE => 0x00,
|
\PHPExcel\Style\Font::UNDERLINE_NONE => 0x00,
|
||||||
PHPExcel_Style_Font::UNDERLINE_SINGLE => 0x01,
|
\PHPExcel\Style\Font::UNDERLINE_SINGLE => 0x01,
|
||||||
PHPExcel_Style_Font::UNDERLINE_DOUBLE => 0x02,
|
\PHPExcel\Style\Font::UNDERLINE_DOUBLE => 0x02,
|
||||||
PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING => 0x21,
|
\PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING => 0x21,
|
||||||
PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING => 0x22,
|
\PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING => 0x22,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -556,7 +556,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: use real error codes
|
// TODO: use real error codes
|
||||||
throw new PHPExcel_Writer_Exception("Unknown token $token");
|
throw new \PHPExcel\Writer\Exception("Unknown token $token");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -590,7 +590,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
// chop away beggining and ending quotes
|
// chop away beggining and ending quotes
|
||||||
$string = substr($string, 1, strlen($string) - 2);
|
$string = substr($string, 1, strlen($string) - 2);
|
||||||
if (strlen($string) > 255) {
|
if (strlen($string) > 255) {
|
||||||
throw new PHPExcel_Writer_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);
|
return pack('C', $this->ptg['ptgStr']) . PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($string);
|
||||||
|
@ -636,7 +636,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
list($cell1, $cell2) = explode(':', $range);
|
list($cell1, $cell2) = explode(':', $range);
|
||||||
} else {
|
} else {
|
||||||
// TODO: use real error codes
|
// TODO: use real error codes
|
||||||
throw new PHPExcel_Writer_Exception("Unknown range separator");
|
throw new \PHPExcel\Writer\Exception("Unknown range separator");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the cell references
|
// Convert the cell references
|
||||||
|
@ -652,7 +652,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
$ptgArea = pack("C", $this->ptg['ptgAreaA']);
|
$ptgArea = pack("C", $this->ptg['ptgAreaA']);
|
||||||
} else {
|
} else {
|
||||||
// TODO: use real error codes
|
// TODO: use real error codes
|
||||||
throw new PHPExcel_Writer_Exception("Unknown class $class");
|
throw new \PHPExcel\Writer\Exception("Unknown class $class");
|
||||||
}
|
}
|
||||||
return $ptgArea . $row1 . $row2 . $col1. $col2;
|
return $ptgArea . $row1 . $row2 . $col1. $col2;
|
||||||
}
|
}
|
||||||
|
@ -694,7 +694,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
// } elseif ($class == 2) {
|
// } elseif ($class == 2) {
|
||||||
// $ptgArea = pack("C", $this->ptg['ptgArea3dA']);
|
// $ptgArea = pack("C", $this->ptg['ptgArea3dA']);
|
||||||
// } else {
|
// } else {
|
||||||
// throw new PHPExcel_Writer_Exception("Unknown class $class");
|
// throw new \PHPExcel\Writer\Exception("Unknown class $class");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return $ptgArea . $ext_ref . $row1 . $row2 . $col1. $col2;
|
return $ptgArea . $ext_ref . $row1 . $row2 . $col1. $col2;
|
||||||
|
@ -724,7 +724,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
$ptgRef = pack("C", $this->ptg['ptgRefA']);
|
$ptgRef = pack("C", $this->ptg['ptgRefA']);
|
||||||
// } else {
|
// } else {
|
||||||
// // TODO: use real error codes
|
// // TODO: use real error codes
|
||||||
// throw new PHPExcel_Writer_Exception("Unknown class $class");
|
// throw new \PHPExcel\Writer\Exception("Unknown class $class");
|
||||||
// }
|
// }
|
||||||
return $ptgRef.$row.$col;
|
return $ptgRef.$row.$col;
|
||||||
}
|
}
|
||||||
|
@ -758,7 +758,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
// } elseif ($class == 2) {
|
// } elseif ($class == 2) {
|
||||||
$ptgRef = pack("C", $this->ptg['ptgRef3dA']);
|
$ptgRef = pack("C", $this->ptg['ptgRef3dA']);
|
||||||
// } else {
|
// } else {
|
||||||
// throw new PHPExcel_Writer_Exception("Unknown class $class");
|
// throw new \PHPExcel\Writer\Exception("Unknown class $class");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return $ptgRef . $ext_ref. $row . $col;
|
return $ptgRef . $ext_ref. $row . $col;
|
||||||
|
@ -811,11 +811,11 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
|
|
||||||
$sheet1 = $this->getSheetIndex($sheet_name1);
|
$sheet1 = $this->getSheetIndex($sheet_name1);
|
||||||
if ($sheet1 == -1) {
|
if ($sheet1 == -1) {
|
||||||
throw new PHPExcel_Writer_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);
|
$sheet2 = $this->getSheetIndex($sheet_name2);
|
||||||
if ($sheet2 == -1) {
|
if ($sheet2 == -1) {
|
||||||
throw new PHPExcel_Writer_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
|
// Reverse max and min sheet numbers if necessary
|
||||||
|
@ -825,7 +825,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
} else { // Single sheet name only.
|
} else { // Single sheet name only.
|
||||||
$sheet1 = $this->getSheetIndex($ext_ref);
|
$sheet1 = $this->getSheetIndex($ext_ref);
|
||||||
if ($sheet1 == -1) {
|
if ($sheet1 == -1) {
|
||||||
throw new PHPExcel_Writer_Exception("Unknown sheet name $ext_ref in formula");
|
throw new \PHPExcel\Writer\Exception("Unknown sheet name $ext_ref in formula");
|
||||||
}
|
}
|
||||||
$sheet2 = $sheet1;
|
$sheet2 = $sheet1;
|
||||||
}
|
}
|
||||||
|
@ -857,11 +857,11 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
|
|
||||||
$sheet1 = $this->getSheetIndex($sheet_name1);
|
$sheet1 = $this->getSheetIndex($sheet_name1);
|
||||||
if ($sheet1 == -1) {
|
if ($sheet1 == -1) {
|
||||||
throw new PHPExcel_Writer_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);
|
$sheet2 = $this->getSheetIndex($sheet_name2);
|
||||||
if ($sheet2 == -1) {
|
if ($sheet2 == -1) {
|
||||||
throw new PHPExcel_Writer_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
|
// Reverse max and min sheet numbers if necessary
|
||||||
|
@ -871,7 +871,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
} else { // Single sheet name only.
|
} else { // Single sheet name only.
|
||||||
$sheet1 = $this->getSheetIndex($ext_ref);
|
$sheet1 = $this->getSheetIndex($ext_ref);
|
||||||
if ($sheet1 == -1) {
|
if ($sheet1 == -1) {
|
||||||
throw new PHPExcel_Writer_Exception("Unknown sheet name $ext_ref in formula");
|
throw new \PHPExcel\Writer\Exception("Unknown sheet name $ext_ref in formula");
|
||||||
}
|
}
|
||||||
$sheet2 = $sheet1;
|
$sheet2 = $sheet1;
|
||||||
}
|
}
|
||||||
|
@ -941,10 +941,10 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
$cell = strtoupper($cell);
|
$cell = strtoupper($cell);
|
||||||
list($row, $col, $row_rel, $col_rel) = $this->cellToRowcol($cell);
|
list($row, $col, $row_rel, $col_rel) = $this->cellToRowcol($cell);
|
||||||
if ($col >= 256) {
|
if ($col >= 256) {
|
||||||
throw new PHPExcel_Writer_Exception("Column in: $cell greater than 255");
|
throw new \PHPExcel\Writer\Exception("Column in: $cell greater than 255");
|
||||||
}
|
}
|
||||||
if ($row >= 65536) {
|
if ($row >= 65536) {
|
||||||
throw new PHPExcel_Writer_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.
|
// Set the high bits to indicate if row or col are relative.
|
||||||
|
@ -982,7 +982,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
|
|
||||||
// FIXME: this changes for BIFF8
|
// FIXME: this changes for BIFF8
|
||||||
if (($row1 >= 65536) or ($row2 >= 65536)) {
|
if (($row1 >= 65536) or ($row2 >= 65536)) {
|
||||||
throw new PHPExcel_Writer_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.
|
// Set the high bits to indicate if rows are relative.
|
||||||
|
@ -1342,7 +1342,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
$this->advance(); // eat the "("
|
$this->advance(); // eat the "("
|
||||||
$result = $this->parenthesizedExpression();
|
$result = $this->parenthesizedExpression();
|
||||||
if ($this->currentToken != ")") {
|
if ($this->currentToken != ")") {
|
||||||
throw new PHPExcel_Writer_Exception("')' token expected.");
|
throw new \PHPExcel\Writer\Exception("')' token expected.");
|
||||||
}
|
}
|
||||||
$this->advance(); // eat the ")"
|
$this->advance(); // eat the ")"
|
||||||
return $result;
|
return $result;
|
||||||
|
@ -1398,7 +1398,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
$result = $this->func();
|
$result = $this->func();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
throw new PHPExcel_Writer_Exception("Syntax error: ".$this->currentToken.", lookahead: ".$this->lookAhead.", current char: ".$this->currentCharacter);
|
throw new \PHPExcel\Writer\Exception("Syntax error: ".$this->currentToken.", lookahead: ".$this->lookAhead.", current char: ".$this->currentCharacter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1421,7 +1421,7 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
if ($this->currentToken == "," || $this->currentToken == ";") {
|
if ($this->currentToken == "," || $this->currentToken == ";") {
|
||||||
$this->advance(); // eat the "," or ";"
|
$this->advance(); // eat the "," or ";"
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Syntax error: comma expected in function $function, arg #{$num_args}");
|
throw new \PHPExcel\Writer\Exception("Syntax error: comma expected in function $function, arg #{$num_args}");
|
||||||
}
|
}
|
||||||
$result2 = $this->condition();
|
$result2 = $this->condition();
|
||||||
$result = $this->createTree('arg', $result, $result2);
|
$result = $this->createTree('arg', $result, $result2);
|
||||||
|
@ -1432,12 +1432,12 @@ class PHPExcel_Writer_Excel5_Parser
|
||||||
++$num_args;
|
++$num_args;
|
||||||
}
|
}
|
||||||
if (!isset($this->functions[$function])) {
|
if (!isset($this->functions[$function])) {
|
||||||
throw new PHPExcel_Writer_Exception("Function $function() doesn't exist");
|
throw new \PHPExcel\Writer\Exception("Function $function() doesn't exist");
|
||||||
}
|
}
|
||||||
$args = $this->functions[$function][1];
|
$args = $this->functions[$function][1];
|
||||||
// If fixed number of args eg. TIME($i, $j, $k). Check that the number of args is valid.
|
// 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)) {
|
if (($args >= 0) and ($args != $num_args)) {
|
||||||
throw new PHPExcel_Writer_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);
|
$result = $this->createTree($function, $result, $num_args);
|
||||||
|
|
|
@ -287,10 +287,10 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
/**
|
/**
|
||||||
* Add a font to added fonts
|
* Add a font to added fonts
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Style_Font $font
|
* @param \PHPExcel\Style\Font $font
|
||||||
* @return int Index to FONT record
|
* @return int Index to FONT record
|
||||||
*/
|
*/
|
||||||
public function addFont(PHPExcel_Style_Font $font)
|
public function addFont(\PHPExcel\Style\Font $font)
|
||||||
{
|
{
|
||||||
$fontHashCode = $font->getHashCode();
|
$fontHashCode = $font->getHashCode();
|
||||||
if (isset($this->addedFonts[$fontHashCode])) {
|
if (isset($this->addedFonts[$fontHashCode])) {
|
||||||
|
@ -907,7 +907,7 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
/**
|
/**
|
||||||
* Writes Excel BIFF BOUNDSHEET record.
|
* Writes Excel BIFF BOUNDSHEET record.
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $sheet Worksheet name
|
* @param \PHPExcel\Worksheet $sheet Worksheet name
|
||||||
* @param integer $offset Location of worksheet BOF
|
* @param integer $offset Location of worksheet BOF
|
||||||
*/
|
*/
|
||||||
private function writeBoundSheet($sheet, $offset)
|
private function writeBoundSheet($sheet, $offset)
|
||||||
|
@ -917,13 +917,13 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
|
|
||||||
// sheet state
|
// sheet state
|
||||||
switch ($sheet->getSheetState()) {
|
switch ($sheet->getSheetState()) {
|
||||||
case PHPExcel_Worksheet::SHEETSTATE_VISIBLE:
|
case \PHPExcel\Worksheet::SHEETSTATE_VISIBLE:
|
||||||
$ss = 0x00;
|
$ss = 0x00;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Worksheet::SHEETSTATE_HIDDEN:
|
case \PHPExcel\Worksheet::SHEETSTATE_HIDDEN:
|
||||||
$ss = 0x01;
|
$ss = 0x01;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN:
|
case \PHPExcel\Worksheet::SHEETSTATE_VERYHIDDEN:
|
||||||
$ss = 0x02;
|
$ss = 0x02;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -166,7 +166,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sheet object
|
* Sheet object
|
||||||
* @var PHPExcel_Worksheet
|
* @var \PHPExcel\Worksheet
|
||||||
*/
|
*/
|
||||||
public $phpSheet;
|
public $phpSheet;
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
* @param mixed $parser The formula parser created for the Workbook
|
* @param mixed $parser The formula parser created for the Workbook
|
||||||
* @param boolean $preCalculateFormulas Flag indicating whether formulas should be calculated or just written
|
* @param boolean $preCalculateFormulas Flag indicating whether formulas should be calculated or just written
|
||||||
* @param string $phpSheet The worksheet to write
|
* @param string $phpSheet The worksheet to write
|
||||||
* @param PHPExcel_Worksheet $phpSheet
|
* @param \PHPExcel\Worksheet $phpSheet
|
||||||
*/
|
*/
|
||||||
public function __construct(&$str_total, &$str_unique, &$str_table, &$colors, $parser, $preCalculateFormulas, $phpSheet)
|
public function __construct(&$str_total, &$str_unique, &$str_table, &$colors, $parser, $preCalculateFormulas, $phpSheet)
|
||||||
{
|
{
|
||||||
|
@ -398,7 +398,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$xfIndex = $cell->getXfIndex() + 15; // there are 15 cell style Xfs
|
$xfIndex = $cell->getXfIndex() + 15; // there are 15 cell style Xfs
|
||||||
|
|
||||||
$cVal = $cell->getValue();
|
$cVal = $cell->getValue();
|
||||||
if ($cVal instanceof PHPExcel_RichText) {
|
if ($cVal instanceof \PHPExcel\RichText) {
|
||||||
// $this->writeString($row, $column, $cVal->getPlainText(), $xfIndex);
|
// $this->writeString($row, $column, $cVal->getPlainText(), $xfIndex);
|
||||||
$arrcRun = array();
|
$arrcRun = array();
|
||||||
$str_len = PHPExcel_Shared_String::CountCharacters($cVal->getPlainText(), 'UTF-8');
|
$str_len = PHPExcel_Shared_String::CountCharacters($cVal->getPlainText(), 'UTF-8');
|
||||||
|
@ -406,7 +406,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$elements = $cVal->getRichTextElements();
|
$elements = $cVal->getRichTextElements();
|
||||||
foreach ($elements as $element) {
|
foreach ($elements as $element) {
|
||||||
// FONT Index
|
// FONT Index
|
||||||
if ($element instanceof PHPExcel_RichText_Run) {
|
if ($element instanceof \PHPExcel\RichText\Run) {
|
||||||
$str_fontidx = $this->fontHashIndex[$element->getFont()->getHashCode()];
|
$str_fontidx = $this->fontHashIndex[$element->getFont()->getHashCode()];
|
||||||
} else {
|
} else {
|
||||||
$str_fontidx = 0;
|
$str_fontidx = 0;
|
||||||
|
@ -418,8 +418,8 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$this->writeRichTextString($row, $column, $cVal->getPlainText(), $xfIndex, $arrcRun);
|
$this->writeRichTextString($row, $column, $cVal->getPlainText(), $xfIndex, $arrcRun);
|
||||||
} else {
|
} else {
|
||||||
switch ($cell->getDatatype()) {
|
switch ($cell->getDatatype()) {
|
||||||
case PHPExcel_Cell_DataType::TYPE_STRING:
|
case \PHPExcel\Cell\DataType::TYPE_STRING:
|
||||||
case PHPExcel_Cell_DataType::TYPE_NULL:
|
case \PHPExcel\Cell\DataType::TYPE_NULL:
|
||||||
if ($cVal === '' || $cVal === null) {
|
if ($cVal === '' || $cVal === null) {
|
||||||
$this->writeBlank($row, $column, $xfIndex);
|
$this->writeBlank($row, $column, $xfIndex);
|
||||||
} else {
|
} else {
|
||||||
|
@ -427,21 +427,21 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PHPExcel_Cell_DataType::TYPE_NUMERIC:
|
case \PHPExcel\Cell\DataType::TYPE_NUMERIC:
|
||||||
$this->writeNumber($row, $column, $cVal, $xfIndex);
|
$this->writeNumber($row, $column, $cVal, $xfIndex);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PHPExcel_Cell_DataType::TYPE_FORMULA:
|
case \PHPExcel\Cell\DataType::TYPE_FORMULA:
|
||||||
$calculatedValue = $this->_preCalculateFormulas ?
|
$calculatedValue = $this->_preCalculateFormulas ?
|
||||||
$cell->getCalculatedValue() : null;
|
$cell->getCalculatedValue() : null;
|
||||||
$this->writeFormula($row, $column, $cVal, $xfIndex, $calculatedValue);
|
$this->writeFormula($row, $column, $cVal, $xfIndex, $calculatedValue);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PHPExcel_Cell_DataType::TYPE_BOOL:
|
case \PHPExcel\Cell\DataType::TYPE_BOOL:
|
||||||
$this->writeBoolErr($row, $column, $cVal, 0, $xfIndex);
|
$this->writeBoolErr($row, $column, $cVal, 0, $xfIndex);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PHPExcel_Cell_DataType::TYPE_ERROR:
|
case \PHPExcel\Cell\DataType::TYPE_ERROR:
|
||||||
$this->writeBoolErr($row, $column, self::mapErrorCode($cVal), 1, $xfIndex);
|
$this->writeBoolErr($row, $column, self::mapErrorCode($cVal), 1, $xfIndex);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -508,8 +508,8 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
// Write ConditionalFormattingTable records
|
// Write ConditionalFormattingTable records
|
||||||
foreach ($arrConditionalStyles as $cellCoordinate => $conditionalStyles) {
|
foreach ($arrConditionalStyles as $cellCoordinate => $conditionalStyles) {
|
||||||
foreach ($conditionalStyles as $conditional) {
|
foreach ($conditionalStyles as $conditional) {
|
||||||
if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION
|
if ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_EXPRESSION
|
||||||
|| $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS) {
|
|| $conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CELLIS) {
|
||||||
if (!in_array($conditional->getHashCode(), $arrConditional)) {
|
if (!in_array($conditional->getHashCode(), $arrConditional)) {
|
||||||
$arrConditional[] = $conditional->getHashCode();
|
$arrConditional[] = $conditional->getHashCode();
|
||||||
// Write CFRULE record
|
// Write CFRULE record
|
||||||
|
@ -853,7 +853,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
// Numeric value
|
// Numeric value
|
||||||
$num = pack('d', $calculatedValue);
|
$num = pack('d', $calculatedValue);
|
||||||
} elseif (is_string($calculatedValue)) {
|
} elseif (is_string($calculatedValue)) {
|
||||||
if (array_key_exists($calculatedValue, PHPExcel_Cell_DataType::getErrorCodes())) {
|
if (array_key_exists($calculatedValue, \PHPExcel\Cell\DataType::getErrorCodes())) {
|
||||||
// Error value
|
// Error value
|
||||||
$num = pack('CCCvCv', 0x02, 0x00, self::mapErrorCode($calculatedValue), 0x00, 0x00, 0xFFFF);
|
$num = pack('CCCvCv', 0x02, 0x00, self::mapErrorCode($calculatedValue), 0x00, 0x00, 0xFFFF);
|
||||||
} elseif ($calculatedValue === '') {
|
} elseif ($calculatedValue === '') {
|
||||||
|
@ -1274,7 +1274,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
// no support in PHPExcel for selected sheet, therefore sheet is only selected if it is the active sheet
|
// no support in PHPExcel for selected sheet, therefore sheet is only selected if it is the active sheet
|
||||||
$fSelected = ($this->phpSheet === $this->phpSheet->getParent()->getActiveSheet()) ? 1 : 0;
|
$fSelected = ($this->phpSheet === $this->phpSheet->getParent()->getActiveSheet()) ? 1 : 0;
|
||||||
$fPaged = 1; // 2
|
$fPaged = 1; // 2
|
||||||
$fPageBreakPreview = $this->phpSheet->getSheetView()->getView() === PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW;
|
$fPageBreakPreview = $this->phpSheet->getSheetView()->getView() === \PHPExcel\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW;
|
||||||
|
|
||||||
$grbit = $fDspFmla;
|
$grbit = $fDspFmla;
|
||||||
$grbit |= $fDspGrid << 1;
|
$grbit |= $fDspGrid << 1;
|
||||||
|
@ -1795,7 +1795,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$fLeftToRight = 0x0; // Print over then down
|
$fLeftToRight = 0x0; // Print over then down
|
||||||
|
|
||||||
// Page orientation
|
// Page orientation
|
||||||
$fLandscape = ($this->phpSheet->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ?
|
$fLandscape = ($this->phpSheet->getPageSetup()->getOrientation() == \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ?
|
||||||
0x0 : 0x1;
|
0x0 : 0x1;
|
||||||
|
|
||||||
$fNoPls = 0x0; // Setup not read from printer
|
$fNoPls = 0x0; // Setup not read from printer
|
||||||
|
@ -2146,15 +2146,15 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
|
|
||||||
// Decide what to do by the type of break
|
// Decide what to do by the type of break
|
||||||
switch ($breakType) {
|
switch ($breakType) {
|
||||||
case PHPExcel_Worksheet::BREAK_COLUMN:
|
case \PHPExcel\Worksheet::BREAK_COLUMN:
|
||||||
// Add to list of vertical breaks
|
// Add to list of vertical breaks
|
||||||
$vbreaks[] = PHPExcel_Cell::columnIndexFromString($coordinates[0]) - 1;
|
$vbreaks[] = PHPExcel_Cell::columnIndexFromString($coordinates[0]) - 1;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Worksheet::BREAK_ROW:
|
case \PHPExcel\Worksheet::BREAK_ROW:
|
||||||
// Add to list of horizontal breaks
|
// Add to list of horizontal breaks
|
||||||
$hbreaks[] = $coordinates[1];
|
$hbreaks[] = $coordinates[1];
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Worksheet::BREAK_NONE:
|
case \PHPExcel\Worksheet::BREAK_NONE:
|
||||||
default:
|
default:
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
break;
|
break;
|
||||||
|
@ -2564,7 +2564,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
// Open file.
|
// Open file.
|
||||||
$bmp_fd = @fopen($bitmap, "rb");
|
$bmp_fd = @fopen($bitmap, "rb");
|
||||||
if (!$bmp_fd) {
|
if (!$bmp_fd) {
|
||||||
throw new PHPExcel_Writer_Exception("Couldn't import $bitmap");
|
throw new \PHPExcel\Writer\Exception("Couldn't import $bitmap");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slurp the file into a string.
|
// Slurp the file into a string.
|
||||||
|
@ -2572,13 +2572,13 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
|
|
||||||
// Check that the file is big enough to be a bitmap.
|
// Check that the file is big enough to be a bitmap.
|
||||||
if (strlen($data) <= 0x36) {
|
if (strlen($data) <= 0x36) {
|
||||||
throw new PHPExcel_Writer_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.
|
// The first 2 bytes are used to identify the bitmap.
|
||||||
$identity = unpack("A2ident", $data);
|
$identity = unpack("A2ident", $data);
|
||||||
if ($identity['ident'] != "BM") {
|
if ($identity['ident'] != "BM") {
|
||||||
throw new PHPExcel_Writer_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.
|
// Remove bitmap data: ID.
|
||||||
|
@ -2602,20 +2602,20 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$height = $width_and_height[2];
|
$height = $width_and_height[2];
|
||||||
$data = substr($data, 8);
|
$data = substr($data, 8);
|
||||||
if ($width > 0xFFFF) {
|
if ($width > 0xFFFF) {
|
||||||
throw new PHPExcel_Writer_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) {
|
if ($height > 0xFFFF) {
|
||||||
throw new PHPExcel_Writer_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.
|
// Read and remove the bitmap planes and bpp data. Verify them.
|
||||||
$planes_and_bitcount = unpack("v2", substr($data, 0, 4));
|
$planes_and_bitcount = unpack("v2", substr($data, 0, 4));
|
||||||
$data = substr($data, 4);
|
$data = substr($data, 4);
|
||||||
if ($planes_and_bitcount[2] != 24) { // Bitcount
|
if ($planes_and_bitcount[2] != 24) { // Bitcount
|
||||||
throw new PHPExcel_Writer_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) {
|
if ($planes_and_bitcount[1] != 1) {
|
||||||
throw new PHPExcel_Writer_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.
|
// Read and remove the bitmap compression. Verify compression.
|
||||||
|
@ -2624,7 +2624,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
|
|
||||||
//$compression = 0;
|
//$compression = 0;
|
||||||
if ($compression['comp'] != 0) {
|
if ($compression['comp'] != 0) {
|
||||||
throw new PHPExcel_Writer_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.
|
// Remove bitmap data: data size, hres, vres, colours, imp. colours.
|
||||||
|
@ -2928,7 +2928,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
try {
|
try {
|
||||||
$formula2 = $dataValidation->getFormula2();
|
$formula2 = $dataValidation->getFormula2();
|
||||||
if ($formula2 === '') {
|
if ($formula2 === '') {
|
||||||
throw new PHPExcel_Writer_Exception('No formula2');
|
throw new \PHPExcel\Writer\Exception('No formula2');
|
||||||
}
|
}
|
||||||
$this->parser->parse($formula2);
|
$this->parser->parse($formula2);
|
||||||
$formula2 = $this->parser->toReversePolish();
|
$formula2 = $this->parser->toReversePolish();
|
||||||
|
@ -2994,7 +2994,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$wScalvePLV = $this->phpSheet->getSheetView()->getZoomScale(); // 2
|
$wScalvePLV = $this->phpSheet->getSheetView()->getZoomScale(); // 2
|
||||||
|
|
||||||
// The options flags that comprise $grbit
|
// The options flags that comprise $grbit
|
||||||
if ($this->phpSheet->getSheetView()->getView() == PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_LAYOUT) {
|
if ($this->phpSheet->getSheetView()->getView() == \PHPExcel\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT) {
|
||||||
$fPageLayoutView = 1;
|
$fPageLayoutView = 1;
|
||||||
} else {
|
} else {
|
||||||
$fPageLayoutView = 0;
|
$fPageLayoutView = 0;
|
||||||
|
@ -3013,43 +3013,43 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write CFRule Record
|
* Write CFRule Record
|
||||||
* @param PHPExcel_Style_Conditional $conditional
|
* @param \PHPExcel\Style\Conditional $conditional
|
||||||
*/
|
*/
|
||||||
private function writeCFRule(PHPExcel_Style_Conditional $conditional)
|
private function writeCFRule(\PHPExcel\Style\Conditional $conditional)
|
||||||
{
|
{
|
||||||
$record = 0x01B1; // Record identifier
|
$record = 0x01B1; // Record identifier
|
||||||
|
|
||||||
// $type : Type of the CF
|
// $type : Type of the CF
|
||||||
// $operatorType : Comparison operator
|
// $operatorType : Comparison operator
|
||||||
if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) {
|
if ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_EXPRESSION) {
|
||||||
$type = 0x02;
|
$type = 0x02;
|
||||||
$operatorType = 0x00;
|
$operatorType = 0x00;
|
||||||
} elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS) {
|
} elseif ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CELLIS) {
|
||||||
$type = 0x01;
|
$type = 0x01;
|
||||||
|
|
||||||
switch ($conditional->getOperatorType()) {
|
switch ($conditional->getOperatorType()) {
|
||||||
case PHPExcel_Style_Conditional::OPERATOR_NONE:
|
case \PHPExcel\Style\Conditional::OPERATOR_NONE:
|
||||||
$operatorType = 0x00;
|
$operatorType = 0x00;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Conditional::OPERATOR_EQUAL:
|
case \PHPExcel\Style\Conditional::OPERATOR_EQUAL:
|
||||||
$operatorType = 0x03;
|
$operatorType = 0x03;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Conditional::OPERATOR_GREATERTHAN:
|
case \PHPExcel\Style\Conditional::OPERATOR_GREATERTHAN:
|
||||||
$operatorType = 0x05;
|
$operatorType = 0x05;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Conditional::OPERATOR_GREATERTHANOREQUAL:
|
case \PHPExcel\Style\Conditional::OPERATOR_GREATERTHANOREQUAL:
|
||||||
$operatorType = 0x07;
|
$operatorType = 0x07;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Conditional::OPERATOR_LESSTHAN:
|
case \PHPExcel\Style\Conditional::OPERATOR_LESSTHAN:
|
||||||
$operatorType = 0x06;
|
$operatorType = 0x06;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Conditional::OPERATOR_LESSTHANOREQUAL:
|
case \PHPExcel\Style\Conditional::OPERATOR_LESSTHANOREQUAL:
|
||||||
$operatorType = 0x08;
|
$operatorType = 0x08;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Conditional::OPERATOR_NOTEQUAL:
|
case \PHPExcel\Style\Conditional::OPERATOR_NOTEQUAL:
|
||||||
$operatorType = 0x04;
|
$operatorType = 0x04;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Conditional::OPERATOR_BETWEEN:
|
case \PHPExcel\Style\Conditional::OPERATOR_BETWEEN:
|
||||||
$operatorType = 0x01;
|
$operatorType = 0x01;
|
||||||
break;
|
break;
|
||||||
// not OPERATOR_NOTBETWEEN 0x02
|
// not OPERATOR_NOTBETWEEN 0x02
|
||||||
|
@ -3065,7 +3065,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$szValue2 = 0x0000;
|
$szValue2 = 0x0000;
|
||||||
$operand1 = pack('Cv', 0x1E, $arrConditions[0]);
|
$operand1 = pack('Cv', 0x1E, $arrConditions[0]);
|
||||||
$operand2 = null;
|
$operand2 = null;
|
||||||
} elseif ($numConditions == 2 && ($conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_BETWEEN)) {
|
} elseif ($numConditions == 2 && ($conditional->getOperatorType() == \PHPExcel\Style\Conditional::OPERATOR_BETWEEN)) {
|
||||||
$szValue1 = ($arrConditions[0] <= 65535 ? 3 : 0x0000);
|
$szValue1 = ($arrConditions[0] <= 65535 ? 3 : 0x0000);
|
||||||
$szValue2 = ($arrConditions[1] <= 65535 ? 3 : 0x0000);
|
$szValue2 = ($arrConditions[1] <= 65535 ? 3 : 0x0000);
|
||||||
$operand1 = pack('Cv', 0x1E, $arrConditions[0]);
|
$operand1 = pack('Cv', 0x1E, $arrConditions[0]);
|
||||||
|
@ -3099,14 +3099,14 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$bFormatProt = 0;
|
$bFormatProt = 0;
|
||||||
}
|
}
|
||||||
// Border
|
// Border
|
||||||
$bBorderLeft = ($conditional->getStyle()->getBorders()->getLeft()->getColor()->getARGB() == PHPExcel_Style_Color::COLOR_BLACK
|
$bBorderLeft = ($conditional->getStyle()->getBorders()->getLeft()->getColor()->getARGB() == \PHPExcel\Style\Color::COLOR_BLACK
|
||||||
&& $conditional->getStyle()->getBorders()->getLeft()->getBorderStyle() == PHPExcel_Style_Border::BORDER_NONE ? 1 : 0);
|
&& $conditional->getStyle()->getBorders()->getLeft()->getBorderStyle() == \PHPExcel\Style\Border::BORDER_NONE ? 1 : 0);
|
||||||
$bBorderRight = ($conditional->getStyle()->getBorders()->getRight()->getColor()->getARGB() == PHPExcel_Style_Color::COLOR_BLACK
|
$bBorderRight = ($conditional->getStyle()->getBorders()->getRight()->getColor()->getARGB() == \PHPExcel\Style\Color::COLOR_BLACK
|
||||||
&& $conditional->getStyle()->getBorders()->getRight()->getBorderStyle() == PHPExcel_Style_Border::BORDER_NONE ? 1 : 0);
|
&& $conditional->getStyle()->getBorders()->getRight()->getBorderStyle() == \PHPExcel\Style\Border::BORDER_NONE ? 1 : 0);
|
||||||
$bBorderTop = ($conditional->getStyle()->getBorders()->getTop()->getColor()->getARGB() == PHPExcel_Style_Color::COLOR_BLACK
|
$bBorderTop = ($conditional->getStyle()->getBorders()->getTop()->getColor()->getARGB() == \PHPExcel\Style\Color::COLOR_BLACK
|
||||||
&& $conditional->getStyle()->getBorders()->getTop()->getBorderStyle() == PHPExcel_Style_Border::BORDER_NONE ? 1 : 0);
|
&& $conditional->getStyle()->getBorders()->getTop()->getBorderStyle() == \PHPExcel\Style\Border::BORDER_NONE ? 1 : 0);
|
||||||
$bBorderBottom = ($conditional->getStyle()->getBorders()->getBottom()->getColor()->getARGB() == PHPExcel_Style_Color::COLOR_BLACK
|
$bBorderBottom = ($conditional->getStyle()->getBorders()->getBottom()->getColor()->getARGB() == \PHPExcel\Style\Color::COLOR_BLACK
|
||||||
&& $conditional->getStyle()->getBorders()->getBottom()->getBorderStyle() == PHPExcel_Style_Border::BORDER_NONE ? 1 : 0);
|
&& $conditional->getStyle()->getBorders()->getBottom()->getBorderStyle() == \PHPExcel\Style\Border::BORDER_NONE ? 1 : 0);
|
||||||
if ($bBorderLeft == 0 || $bBorderRight == 0 || $bBorderTop == 0 || $bBorderBottom == 0) {
|
if ($bBorderLeft == 0 || $bBorderRight == 0 || $bBorderTop == 0 || $bBorderBottom == 0) {
|
||||||
$bFormatBorder = 1;
|
$bFormatBorder = 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3211,23 +3211,23 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
}
|
}
|
||||||
// Underline type
|
// Underline type
|
||||||
switch ($conditional->getStyle()->getFont()->getUnderline()) {
|
switch ($conditional->getStyle()->getFont()->getUnderline()) {
|
||||||
case PHPExcel_Style_Font::UNDERLINE_NONE:
|
case \PHPExcel\Style\Font::UNDERLINE_NONE:
|
||||||
$dataBlockFont .= pack('C', 0x00);
|
$dataBlockFont .= pack('C', 0x00);
|
||||||
$fontUnderline = 0;
|
$fontUnderline = 0;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Font::UNDERLINE_DOUBLE:
|
case \PHPExcel\Style\Font::UNDERLINE_DOUBLE:
|
||||||
$dataBlockFont .= pack('C', 0x02);
|
$dataBlockFont .= pack('C', 0x02);
|
||||||
$fontUnderline = 0;
|
$fontUnderline = 0;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING:
|
case \PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING:
|
||||||
$dataBlockFont .= pack('C', 0x22);
|
$dataBlockFont .= pack('C', 0x22);
|
||||||
$fontUnderline = 0;
|
$fontUnderline = 0;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Font::UNDERLINE_SINGLE:
|
case \PHPExcel\Style\Font::UNDERLINE_SINGLE:
|
||||||
$dataBlockFont .= pack('C', 0x01);
|
$dataBlockFont .= pack('C', 0x01);
|
||||||
$fontUnderline = 0;
|
$fontUnderline = 0;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING:
|
case \PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING:
|
||||||
$dataBlockFont .= pack('C', 0x21);
|
$dataBlockFont .= pack('C', 0x21);
|
||||||
$fontUnderline = 0;
|
$fontUnderline = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -3440,22 +3440,22 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$blockAlign = 0;
|
$blockAlign = 0;
|
||||||
// Alignment and text break
|
// Alignment and text break
|
||||||
switch ($conditional->getStyle()->getAlignment()->getHorizontal()) {
|
switch ($conditional->getStyle()->getAlignment()->getHorizontal()) {
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_GENERAL:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL:
|
||||||
$blockAlign = 0;
|
$blockAlign = 0;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_LEFT:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_LEFT:
|
||||||
$blockAlign = 1;
|
$blockAlign = 1;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_RIGHT:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT:
|
||||||
$blockAlign = 3;
|
$blockAlign = 3;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_CENTER:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_CENTER:
|
||||||
$blockAlign = 2;
|
$blockAlign = 2;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS:
|
||||||
$blockAlign = 6;
|
$blockAlign = 6;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY:
|
||||||
$blockAlign = 5;
|
$blockAlign = 5;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3465,16 +3465,16 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$blockAlign |= 0 << 3;
|
$blockAlign |= 0 << 3;
|
||||||
}
|
}
|
||||||
switch ($conditional->getStyle()->getAlignment()->getVertical()) {
|
switch ($conditional->getStyle()->getAlignment()->getVertical()) {
|
||||||
case PHPExcel_Style_Alignment::VERTICAL_BOTTOM:
|
case \PHPExcel\Style\Alignment::VERTICAL_BOTTOM:
|
||||||
$blockAlign = 2 << 4;
|
$blockAlign = 2 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Alignment::VERTICAL_TOP:
|
case \PHPExcel\Style\Alignment::VERTICAL_TOP:
|
||||||
$blockAlign = 0 << 4;
|
$blockAlign = 0 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Alignment::VERTICAL_CENTER:
|
case \PHPExcel\Style\Alignment::VERTICAL_CENTER:
|
||||||
$blockAlign = 1 << 4;
|
$blockAlign = 1 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Alignment::VERTICAL_JUSTIFY:
|
case \PHPExcel\Style\Alignment::VERTICAL_JUSTIFY:
|
||||||
$blockAlign = 3 << 4;
|
$blockAlign = 3 << 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3500,178 +3500,178 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
if ($bFormatBorder == 1) {
|
if ($bFormatBorder == 1) {
|
||||||
$blockLineStyle = 0;
|
$blockLineStyle = 0;
|
||||||
switch ($conditional->getStyle()->getBorders()->getLeft()->getBorderStyle()) {
|
switch ($conditional->getStyle()->getBorders()->getLeft()->getBorderStyle()) {
|
||||||
case PHPExcel_Style_Border::BORDER_NONE:
|
case \PHPExcel\Style\Border::BORDER_NONE:
|
||||||
$blockLineStyle |= 0x00;
|
$blockLineStyle |= 0x00;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_THIN:
|
case \PHPExcel\Style\Border::BORDER_THIN:
|
||||||
$blockLineStyle |= 0x01;
|
$blockLineStyle |= 0x01;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUM:
|
case \PHPExcel\Style\Border::BORDER_MEDIUM:
|
||||||
$blockLineStyle |= 0x02;
|
$blockLineStyle |= 0x02;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHED:
|
case \PHPExcel\Style\Border::BORDER_DASHED:
|
||||||
$blockLineStyle |= 0x03;
|
$blockLineStyle |= 0x03;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DOTTED:
|
case \PHPExcel\Style\Border::BORDER_DOTTED:
|
||||||
$blockLineStyle |= 0x04;
|
$blockLineStyle |= 0x04;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_THICK:
|
case \PHPExcel\Style\Border::BORDER_THICK:
|
||||||
$blockLineStyle |= 0x05;
|
$blockLineStyle |= 0x05;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DOUBLE:
|
case \PHPExcel\Style\Border::BORDER_DOUBLE:
|
||||||
$blockLineStyle |= 0x06;
|
$blockLineStyle |= 0x06;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_HAIR:
|
case \PHPExcel\Style\Border::BORDER_HAIR:
|
||||||
$blockLineStyle |= 0x07;
|
$blockLineStyle |= 0x07;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHED:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED:
|
||||||
$blockLineStyle |= 0x08;
|
$blockLineStyle |= 0x08;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOT:
|
||||||
$blockLineStyle |= 0x09;
|
$blockLineStyle |= 0x09;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT:
|
||||||
$blockLineStyle |= 0x0A;
|
$blockLineStyle |= 0x0A;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOTDOT:
|
||||||
$blockLineStyle |= 0x0B;
|
$blockLineStyle |= 0x0B;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT:
|
||||||
$blockLineStyle |= 0x0C;
|
$blockLineStyle |= 0x0C;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_SLANTDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT:
|
||||||
$blockLineStyle |= 0x0D;
|
$blockLineStyle |= 0x0D;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch ($conditional->getStyle()->getBorders()->getRight()->getBorderStyle()) {
|
switch ($conditional->getStyle()->getBorders()->getRight()->getBorderStyle()) {
|
||||||
case PHPExcel_Style_Border::BORDER_NONE:
|
case \PHPExcel\Style\Border::BORDER_NONE:
|
||||||
$blockLineStyle |= 0x00 << 4;
|
$blockLineStyle |= 0x00 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_THIN:
|
case \PHPExcel\Style\Border::BORDER_THIN:
|
||||||
$blockLineStyle |= 0x01 << 4;
|
$blockLineStyle |= 0x01 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUM:
|
case \PHPExcel\Style\Border::BORDER_MEDIUM:
|
||||||
$blockLineStyle |= 0x02 << 4;
|
$blockLineStyle |= 0x02 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHED:
|
case \PHPExcel\Style\Border::BORDER_DASHED:
|
||||||
$blockLineStyle |= 0x03 << 4;
|
$blockLineStyle |= 0x03 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DOTTED:
|
case \PHPExcel\Style\Border::BORDER_DOTTED:
|
||||||
$blockLineStyle |= 0x04 << 4;
|
$blockLineStyle |= 0x04 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_THICK:
|
case \PHPExcel\Style\Border::BORDER_THICK:
|
||||||
$blockLineStyle |= 0x05 << 4;
|
$blockLineStyle |= 0x05 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DOUBLE:
|
case \PHPExcel\Style\Border::BORDER_DOUBLE:
|
||||||
$blockLineStyle |= 0x06 << 4;
|
$blockLineStyle |= 0x06 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_HAIR:
|
case \PHPExcel\Style\Border::BORDER_HAIR:
|
||||||
$blockLineStyle |= 0x07 << 4;
|
$blockLineStyle |= 0x07 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHED:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED:
|
||||||
$blockLineStyle |= 0x08 << 4;
|
$blockLineStyle |= 0x08 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOT:
|
||||||
$blockLineStyle |= 0x09 << 4;
|
$blockLineStyle |= 0x09 << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT:
|
||||||
$blockLineStyle |= 0x0A << 4;
|
$blockLineStyle |= 0x0A << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOTDOT:
|
||||||
$blockLineStyle |= 0x0B << 4;
|
$blockLineStyle |= 0x0B << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT:
|
||||||
$blockLineStyle |= 0x0C << 4;
|
$blockLineStyle |= 0x0C << 4;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_SLANTDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT:
|
||||||
$blockLineStyle |= 0x0D << 4;
|
$blockLineStyle |= 0x0D << 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch ($conditional->getStyle()->getBorders()->getTop()->getBorderStyle()) {
|
switch ($conditional->getStyle()->getBorders()->getTop()->getBorderStyle()) {
|
||||||
case PHPExcel_Style_Border::BORDER_NONE:
|
case \PHPExcel\Style\Border::BORDER_NONE:
|
||||||
$blockLineStyle |= 0x00 << 8;
|
$blockLineStyle |= 0x00 << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_THIN:
|
case \PHPExcel\Style\Border::BORDER_THIN:
|
||||||
$blockLineStyle |= 0x01 << 8;
|
$blockLineStyle |= 0x01 << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUM:
|
case \PHPExcel\Style\Border::BORDER_MEDIUM:
|
||||||
$blockLineStyle |= 0x02 << 8;
|
$blockLineStyle |= 0x02 << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHED:
|
case \PHPExcel\Style\Border::BORDER_DASHED:
|
||||||
$blockLineStyle |= 0x03 << 8;
|
$blockLineStyle |= 0x03 << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DOTTED:
|
case \PHPExcel\Style\Border::BORDER_DOTTED:
|
||||||
$blockLineStyle |= 0x04 << 8;
|
$blockLineStyle |= 0x04 << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_THICK:
|
case \PHPExcel\Style\Border::BORDER_THICK:
|
||||||
$blockLineStyle |= 0x05 << 8;
|
$blockLineStyle |= 0x05 << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DOUBLE:
|
case \PHPExcel\Style\Border::BORDER_DOUBLE:
|
||||||
$blockLineStyle |= 0x06 << 8;
|
$blockLineStyle |= 0x06 << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_HAIR:
|
case \PHPExcel\Style\Border::BORDER_HAIR:
|
||||||
$blockLineStyle |= 0x07 << 8;
|
$blockLineStyle |= 0x07 << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHED:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED:
|
||||||
$blockLineStyle |= 0x08 << 8;
|
$blockLineStyle |= 0x08 << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOT:
|
||||||
$blockLineStyle |= 0x09 << 8;
|
$blockLineStyle |= 0x09 << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT:
|
||||||
$blockLineStyle |= 0x0A << 8;
|
$blockLineStyle |= 0x0A << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOTDOT:
|
||||||
$blockLineStyle |= 0x0B << 8;
|
$blockLineStyle |= 0x0B << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT:
|
||||||
$blockLineStyle |= 0x0C << 8;
|
$blockLineStyle |= 0x0C << 8;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_SLANTDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT:
|
||||||
$blockLineStyle |= 0x0D << 8;
|
$blockLineStyle |= 0x0D << 8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch ($conditional->getStyle()->getBorders()->getBottom()->getBorderStyle()) {
|
switch ($conditional->getStyle()->getBorders()->getBottom()->getBorderStyle()) {
|
||||||
case PHPExcel_Style_Border::BORDER_NONE:
|
case \PHPExcel\Style\Border::BORDER_NONE:
|
||||||
$blockLineStyle |= 0x00 << 12;
|
$blockLineStyle |= 0x00 << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_THIN:
|
case \PHPExcel\Style\Border::BORDER_THIN:
|
||||||
$blockLineStyle |= 0x01 << 12;
|
$blockLineStyle |= 0x01 << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUM:
|
case \PHPExcel\Style\Border::BORDER_MEDIUM:
|
||||||
$blockLineStyle |= 0x02 << 12;
|
$blockLineStyle |= 0x02 << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHED:
|
case \PHPExcel\Style\Border::BORDER_DASHED:
|
||||||
$blockLineStyle |= 0x03 << 12;
|
$blockLineStyle |= 0x03 << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DOTTED:
|
case \PHPExcel\Style\Border::BORDER_DOTTED:
|
||||||
$blockLineStyle |= 0x04 << 12;
|
$blockLineStyle |= 0x04 << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_THICK:
|
case \PHPExcel\Style\Border::BORDER_THICK:
|
||||||
$blockLineStyle |= 0x05 << 12;
|
$blockLineStyle |= 0x05 << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DOUBLE:
|
case \PHPExcel\Style\Border::BORDER_DOUBLE:
|
||||||
$blockLineStyle |= 0x06 << 12;
|
$blockLineStyle |= 0x06 << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_HAIR:
|
case \PHPExcel\Style\Border::BORDER_HAIR:
|
||||||
$blockLineStyle |= 0x07 << 12;
|
$blockLineStyle |= 0x07 << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHED:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED:
|
||||||
$blockLineStyle |= 0x08 << 12;
|
$blockLineStyle |= 0x08 << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOT:
|
||||||
$blockLineStyle |= 0x09 << 12;
|
$blockLineStyle |= 0x09 << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT:
|
||||||
$blockLineStyle |= 0x0A << 12;
|
$blockLineStyle |= 0x0A << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOTDOT:
|
||||||
$blockLineStyle |= 0x0B << 12;
|
$blockLineStyle |= 0x0B << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT:
|
||||||
$blockLineStyle |= 0x0C << 12;
|
$blockLineStyle |= 0x0C << 12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_SLANTDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT:
|
||||||
$blockLineStyle |= 0x0D << 12;
|
$blockLineStyle |= 0x0D << 12;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3684,46 +3684,46 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
//@todo writeCFRule() => $blockColor => Index Color for bottom line
|
//@todo writeCFRule() => $blockColor => Index Color for bottom line
|
||||||
//@todo writeCFRule() => $blockColor => Index Color for diagonal line
|
//@todo writeCFRule() => $blockColor => Index Color for diagonal line
|
||||||
switch ($conditional->getStyle()->getBorders()->getDiagonal()->getBorderStyle()) {
|
switch ($conditional->getStyle()->getBorders()->getDiagonal()->getBorderStyle()) {
|
||||||
case PHPExcel_Style_Border::BORDER_NONE:
|
case \PHPExcel\Style\Border::BORDER_NONE:
|
||||||
$blockColor |= 0x00 << 21;
|
$blockColor |= 0x00 << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_THIN:
|
case \PHPExcel\Style\Border::BORDER_THIN:
|
||||||
$blockColor |= 0x01 << 21;
|
$blockColor |= 0x01 << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUM:
|
case \PHPExcel\Style\Border::BORDER_MEDIUM:
|
||||||
$blockColor |= 0x02 << 21;
|
$blockColor |= 0x02 << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHED:
|
case \PHPExcel\Style\Border::BORDER_DASHED:
|
||||||
$blockColor |= 0x03 << 21;
|
$blockColor |= 0x03 << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DOTTED:
|
case \PHPExcel\Style\Border::BORDER_DOTTED:
|
||||||
$blockColor |= 0x04 << 21;
|
$blockColor |= 0x04 << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_THICK:
|
case \PHPExcel\Style\Border::BORDER_THICK:
|
||||||
$blockColor |= 0x05 << 21;
|
$blockColor |= 0x05 << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DOUBLE:
|
case \PHPExcel\Style\Border::BORDER_DOUBLE:
|
||||||
$blockColor |= 0x06 << 21;
|
$blockColor |= 0x06 << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_HAIR:
|
case \PHPExcel\Style\Border::BORDER_HAIR:
|
||||||
$blockColor |= 0x07 << 21;
|
$blockColor |= 0x07 << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHED:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED:
|
||||||
$blockColor |= 0x08 << 21;
|
$blockColor |= 0x08 << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOT:
|
||||||
$blockColor |= 0x09 << 21;
|
$blockColor |= 0x09 << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT:
|
||||||
$blockColor |= 0x0A << 21;
|
$blockColor |= 0x0A << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOTDOT:
|
||||||
$blockColor |= 0x0B << 21;
|
$blockColor |= 0x0B << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT:
|
||||||
$blockColor |= 0x0C << 21;
|
$blockColor |= 0x0C << 21;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Border::BORDER_SLANTDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT:
|
||||||
$blockColor |= 0x0D << 21;
|
$blockColor |= 0x0D << 21;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3733,67 +3733,67 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
// Fill Patern Style
|
// Fill Patern Style
|
||||||
$blockFillPatternStyle = 0;
|
$blockFillPatternStyle = 0;
|
||||||
switch ($conditional->getStyle()->getFill()->getFillType()) {
|
switch ($conditional->getStyle()->getFill()->getFillType()) {
|
||||||
case PHPExcel_Style_Fill::FILL_NONE:
|
case \PHPExcel\Style\Fill::FILL_NONE:
|
||||||
$blockFillPatternStyle = 0x00;
|
$blockFillPatternStyle = 0x00;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_SOLID:
|
case \PHPExcel\Style\Fill::FILL_SOLID:
|
||||||
$blockFillPatternStyle = 0x01;
|
$blockFillPatternStyle = 0x01;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_MEDIUMGRAY:
|
||||||
$blockFillPatternStyle = 0x02;
|
$blockFillPatternStyle = 0x02;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRAY:
|
||||||
$blockFillPatternStyle = 0x03;
|
$blockFillPatternStyle = 0x03;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRAY:
|
||||||
$blockFillPatternStyle = 0x04;
|
$blockFillPatternStyle = 0x04;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_DARKHORIZONTAL:
|
||||||
$blockFillPatternStyle = 0x05;
|
$blockFillPatternStyle = 0x05;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_DARKVERTICAL:
|
||||||
$blockFillPatternStyle = 0x06;
|
$blockFillPatternStyle = 0x06;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_DARKDOWN:
|
||||||
$blockFillPatternStyle = 0x07;
|
$blockFillPatternStyle = 0x07;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_DARKUP:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_DARKUP:
|
||||||
$blockFillPatternStyle = 0x08;
|
$blockFillPatternStyle = 0x08;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRID:
|
||||||
$blockFillPatternStyle = 0x09;
|
$blockFillPatternStyle = 0x09;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_DARKTRELLIS:
|
||||||
$blockFillPatternStyle = 0x0A;
|
$blockFillPatternStyle = 0x0A;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL:
|
||||||
$blockFillPatternStyle = 0x0B;
|
$blockFillPatternStyle = 0x0B;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTVERTICAL:
|
||||||
$blockFillPatternStyle = 0x0C;
|
$blockFillPatternStyle = 0x0C;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTDOWN:
|
||||||
$blockFillPatternStyle = 0x0D;
|
$blockFillPatternStyle = 0x0D;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTUP:
|
||||||
$blockFillPatternStyle = 0x0E;
|
$blockFillPatternStyle = 0x0E;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRID:
|
||||||
$blockFillPatternStyle = 0x0F;
|
$blockFillPatternStyle = 0x0F;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTTRELLIS:
|
||||||
$blockFillPatternStyle = 0x10;
|
$blockFillPatternStyle = 0x10;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_GRAY125:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_GRAY125:
|
||||||
$blockFillPatternStyle = 0x11;
|
$blockFillPatternStyle = 0x11;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625:
|
case \PHPExcel\Style\Fill::FILL_PATTERN_GRAY0625:
|
||||||
$blockFillPatternStyle = 0x12;
|
$blockFillPatternStyle = 0x12;
|
||||||
break;
|
break;
|
||||||
case PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR:
|
case \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR:
|
||||||
$blockFillPatternStyle = 0x00;
|
$blockFillPatternStyle = 0x00;
|
||||||
break; // does not exist in BIFF8
|
break; // does not exist in BIFF8
|
||||||
case PHPExcel_Style_Fill::FILL_GRADIENT_PATH:
|
case \PHPExcel\Style\Fill::FILL_GRADIENT_PATH:
|
||||||
$blockFillPatternStyle = 0x00;
|
$blockFillPatternStyle = 0x00;
|
||||||
break; // does not exist in BIFF8
|
break; // does not exist in BIFF8
|
||||||
default:
|
default:
|
||||||
|
@ -4153,10 +4153,10 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
}
|
}
|
||||||
if ($bFormatProt == 1) {
|
if ($bFormatProt == 1) {
|
||||||
$dataBlockProtection = 0;
|
$dataBlockProtection = 0;
|
||||||
if ($conditional->getStyle()->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED) {
|
if ($conditional->getStyle()->getProtection()->getLocked() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED) {
|
||||||
$dataBlockProtection = 1;
|
$dataBlockProtection = 1;
|
||||||
}
|
}
|
||||||
if ($conditional->getStyle()->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED) {
|
if ($conditional->getStyle()->getProtection()->getHidden() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED) {
|
||||||
$dataBlockProtection = 1 << 1;
|
$dataBlockProtection = 1 << 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4202,8 +4202,8 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
|
||||||
$arrConditional = array();
|
$arrConditional = array();
|
||||||
foreach ($this->phpSheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) {
|
foreach ($this->phpSheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) {
|
||||||
foreach ($conditionalStyles as $conditional) {
|
foreach ($conditionalStyles as $conditional) {
|
||||||
if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION
|
if ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_EXPRESSION
|
||||||
|| $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS) {
|
|| $conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CELLIS) {
|
||||||
if (!in_array($conditional->getHashCode(), $arrConditional)) {
|
if (!in_array($conditional->getHashCode(), $arrConditional)) {
|
||||||
$arrConditional[] = $conditional->getHashCode();
|
$arrConditional[] = $conditional->getHashCode();
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,9 +127,9 @@ class PHPExcel_Writer_Excel5_Xf
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param PHPExcel_Style The XF format
|
* @param \PHPExcel\Style The XF format
|
||||||
*/
|
*/
|
||||||
public function __construct(PHPExcel_Style $style = null)
|
public function __construct(\PHPExcel\Style $style = null)
|
||||||
{
|
{
|
||||||
$this->isStyleXf = false;
|
$this->isStyleXf = false;
|
||||||
$this->fontIndex = 0;
|
$this->fontIndex = 0;
|
||||||
|
@ -228,10 +228,10 @@ class PHPExcel_Writer_Excel5_Xf
|
||||||
$border1 |= $this->rightBorderColor << 23;
|
$border1 |= $this->rightBorderColor << 23;
|
||||||
|
|
||||||
$diagonalDirection = $this->_style->getBorders()->getDiagonalDirection();
|
$diagonalDirection = $this->_style->getBorders()->getDiagonalDirection();
|
||||||
$diag_tl_to_rb = $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_BOTH
|
$diag_tl_to_rb = $diagonalDirection == \PHPExcel\Style\Borders::DIAGONAL_BOTH
|
||||||
|| $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_DOWN;
|
|| $diagonalDirection == \PHPExcel\Style\Borders::DIAGONAL_DOWN;
|
||||||
$diag_tr_to_lb = $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_BOTH
|
$diag_tr_to_lb = $diagonalDirection == \PHPExcel\Style\Borders::DIAGONAL_BOTH
|
||||||
|| $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_UP;
|
|| $diagonalDirection == \PHPExcel\Style\Borders::DIAGONAL_UP;
|
||||||
$border1 |= $diag_tl_to_rb << 30;
|
$border1 |= $diag_tl_to_rb << 30;
|
||||||
$border1 |= $diag_tr_to_lb << 31;
|
$border1 |= $diag_tr_to_lb << 31;
|
||||||
|
|
||||||
|
@ -370,20 +370,20 @@ class PHPExcel_Writer_Excel5_Xf
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static $mapBorderStyles = array(
|
private static $mapBorderStyles = array(
|
||||||
PHPExcel_Style_Border::BORDER_NONE => 0x00,
|
\PHPExcel\Style\Border::BORDER_NONE => 0x00,
|
||||||
PHPExcel_Style_Border::BORDER_THIN => 0x01,
|
\PHPExcel\Style\Border::BORDER_THIN => 0x01,
|
||||||
PHPExcel_Style_Border::BORDER_MEDIUM => 0x02,
|
\PHPExcel\Style\Border::BORDER_MEDIUM => 0x02,
|
||||||
PHPExcel_Style_Border::BORDER_DASHED => 0x03,
|
\PHPExcel\Style\Border::BORDER_DASHED => 0x03,
|
||||||
PHPExcel_Style_Border::BORDER_DOTTED => 0x04,
|
\PHPExcel\Style\Border::BORDER_DOTTED => 0x04,
|
||||||
PHPExcel_Style_Border::BORDER_THICK => 0x05,
|
\PHPExcel\Style\Border::BORDER_THICK => 0x05,
|
||||||
PHPExcel_Style_Border::BORDER_DOUBLE => 0x06,
|
\PHPExcel\Style\Border::BORDER_DOUBLE => 0x06,
|
||||||
PHPExcel_Style_Border::BORDER_HAIR => 0x07,
|
\PHPExcel\Style\Border::BORDER_HAIR => 0x07,
|
||||||
PHPExcel_Style_Border::BORDER_MEDIUMDASHED => 0x08,
|
\PHPExcel\Style\Border::BORDER_MEDIUMDASHED => 0x08,
|
||||||
PHPExcel_Style_Border::BORDER_DASHDOT => 0x09,
|
\PHPExcel\Style\Border::BORDER_DASHDOT => 0x09,
|
||||||
PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT => 0x0A,
|
\PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT => 0x0A,
|
||||||
PHPExcel_Style_Border::BORDER_DASHDOTDOT => 0x0B,
|
\PHPExcel\Style\Border::BORDER_DASHDOTDOT => 0x0B,
|
||||||
PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT => 0x0C,
|
\PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT => 0x0C,
|
||||||
PHPExcel_Style_Border::BORDER_SLANTDASHDOT => 0x0D,
|
\PHPExcel\Style\Border::BORDER_SLANTDASHDOT => 0x0D,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -406,27 +406,27 @@ class PHPExcel_Writer_Excel5_Xf
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static $mapFillTypes = array(
|
private static $mapFillTypes = array(
|
||||||
PHPExcel_Style_Fill::FILL_NONE => 0x00,
|
\PHPExcel\Style\Fill::FILL_NONE => 0x00,
|
||||||
PHPExcel_Style_Fill::FILL_SOLID => 0x01,
|
\PHPExcel\Style\Fill::FILL_SOLID => 0x01,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY => 0x02,
|
\PHPExcel\Style\Fill::FILL_PATTERN_MEDIUMGRAY => 0x02,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY => 0x03,
|
\PHPExcel\Style\Fill::FILL_PATTERN_DARKGRAY => 0x03,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY => 0x04,
|
\PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRAY => 0x04,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL => 0x05,
|
\PHPExcel\Style\Fill::FILL_PATTERN_DARKHORIZONTAL => 0x05,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL => 0x06,
|
\PHPExcel\Style\Fill::FILL_PATTERN_DARKVERTICAL => 0x06,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN => 0x07,
|
\PHPExcel\Style\Fill::FILL_PATTERN_DARKDOWN => 0x07,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_DARKUP => 0x08,
|
\PHPExcel\Style\Fill::FILL_PATTERN_DARKUP => 0x08,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID => 0x09,
|
\PHPExcel\Style\Fill::FILL_PATTERN_DARKGRID => 0x09,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS => 0x0A,
|
\PHPExcel\Style\Fill::FILL_PATTERN_DARKTRELLIS => 0x0A,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL => 0x0B,
|
\PHPExcel\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL => 0x0B,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL => 0x0C,
|
\PHPExcel\Style\Fill::FILL_PATTERN_LIGHTVERTICAL => 0x0C,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN => 0x0D,
|
\PHPExcel\Style\Fill::FILL_PATTERN_LIGHTDOWN => 0x0D,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP => 0x0E,
|
\PHPExcel\Style\Fill::FILL_PATTERN_LIGHTUP => 0x0E,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID => 0x0F,
|
\PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRID => 0x0F,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS => 0x10,
|
\PHPExcel\Style\Fill::FILL_PATTERN_LIGHTTRELLIS => 0x10,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_GRAY125 => 0x11,
|
\PHPExcel\Style\Fill::FILL_PATTERN_GRAY125 => 0x11,
|
||||||
PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625 => 0x12,
|
\PHPExcel\Style\Fill::FILL_PATTERN_GRAY0625 => 0x12,
|
||||||
PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR => 0x00, // does not exist in BIFF8
|
\PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR => 0x00, // does not exist in BIFF8
|
||||||
PHPExcel_Style_Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8
|
\PHPExcel\Style\Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -449,13 +449,13 @@ class PHPExcel_Writer_Excel5_Xf
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static $mapHAlignments = array(
|
private static $mapHAlignments = array(
|
||||||
PHPExcel_Style_Alignment::HORIZONTAL_GENERAL => 0,
|
\PHPExcel\Style\Alignment::HORIZONTAL_GENERAL => 0,
|
||||||
PHPExcel_Style_Alignment::HORIZONTAL_LEFT => 1,
|
\PHPExcel\Style\Alignment::HORIZONTAL_LEFT => 1,
|
||||||
PHPExcel_Style_Alignment::HORIZONTAL_CENTER => 2,
|
\PHPExcel\Style\Alignment::HORIZONTAL_CENTER => 2,
|
||||||
PHPExcel_Style_Alignment::HORIZONTAL_RIGHT => 3,
|
\PHPExcel\Style\Alignment::HORIZONTAL_RIGHT => 3,
|
||||||
PHPExcel_Style_Alignment::HORIZONTAL_FILL => 4,
|
\PHPExcel\Style\Alignment::HORIZONTAL_FILL => 4,
|
||||||
PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY => 5,
|
\PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY => 5,
|
||||||
PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS => 6,
|
\PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS => 6,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -478,10 +478,10 @@ class PHPExcel_Writer_Excel5_Xf
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static $mapVAlignments = array(
|
private static $mapVAlignments = array(
|
||||||
PHPExcel_Style_Alignment::VERTICAL_TOP => 0,
|
\PHPExcel\Style\Alignment::VERTICAL_TOP => 0,
|
||||||
PHPExcel_Style_Alignment::VERTICAL_CENTER => 1,
|
\PHPExcel\Style\Alignment::VERTICAL_CENTER => 1,
|
||||||
PHPExcel_Style_Alignment::VERTICAL_BOTTOM => 2,
|
\PHPExcel\Style\Alignment::VERTICAL_BOTTOM => 2,
|
||||||
PHPExcel_Style_Alignment::VERTICAL_JUSTIFY => 3,
|
\PHPExcel\Style\Alignment::VERTICAL_JUSTIFY => 3,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -524,11 +524,11 @@ class PHPExcel_Writer_Excel5_Xf
|
||||||
private static function mapLocked($locked)
|
private static function mapLocked($locked)
|
||||||
{
|
{
|
||||||
switch ($locked) {
|
switch ($locked) {
|
||||||
case PHPExcel_Style_Protection::PROTECTION_INHERIT:
|
case \PHPExcel\Style\Protection::PROTECTION_INHERIT:
|
||||||
return 1;
|
return 1;
|
||||||
case PHPExcel_Style_Protection::PROTECTION_PROTECTED:
|
case \PHPExcel\Style\Protection::PROTECTION_PROTECTED:
|
||||||
return 1;
|
return 1;
|
||||||
case PHPExcel_Style_Protection::PROTECTION_UNPROTECTED:
|
case \PHPExcel\Style\Protection::PROTECTION_UNPROTECTED:
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -544,11 +544,11 @@ class PHPExcel_Writer_Excel5_Xf
|
||||||
private static function mapHidden($hidden)
|
private static function mapHidden($hidden)
|
||||||
{
|
{
|
||||||
switch ($hidden) {
|
switch ($hidden) {
|
||||||
case PHPExcel_Style_Protection::PROTECTION_INHERIT:
|
case \PHPExcel\Style\Protection::PROTECTION_INHERIT:
|
||||||
return 0;
|
return 0;
|
||||||
case PHPExcel_Style_Protection::PROTECTION_PROTECTED:
|
case \PHPExcel\Style\Protection::PROTECTION_PROTECTED:
|
||||||
return 1;
|
return 1;
|
||||||
case PHPExcel_Style_Protection::PROTECTION_UNPROTECTED:
|
case \PHPExcel\Style\Protection::PROTECTION_UNPROTECTED:
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace PHPExcel\Writer;
|
namespace PHPExcel\Writer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Writer_Exception
|
* \PHPExcel\Writer\Exception
|
||||||
*
|
*
|
||||||
* Copyright (c) 2006 - 2015 PHPExcel
|
* Copyright (c) 2006 - 2015 PHPExcel
|
||||||
*
|
*
|
||||||
|
|
|
@ -79,7 +79,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
/**
|
/**
|
||||||
* Default font
|
* Default font
|
||||||
*
|
*
|
||||||
* @var PHPExcel_Style_Font
|
* @var \PHPExcel\Style\Font
|
||||||
*/
|
*/
|
||||||
private $defaultFont;
|
private $defaultFont;
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
* Save PHPExcel to file
|
* Save PHPExcel to file
|
||||||
*
|
*
|
||||||
* @param string $pFilename
|
* @param string $pFilename
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename = null)
|
||||||
{
|
{
|
||||||
|
@ -158,7 +158,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
// Open file
|
// Open file
|
||||||
$fileHandle = fopen($pFilename, 'wb+');
|
$fileHandle = fopen($pFilename, 'wb+');
|
||||||
if ($fileHandle === false) {
|
if ($fileHandle === false) {
|
||||||
throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing.");
|
throw new \PHPExcel\Writer\Exception("Could not open file $pFilename for writing.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write headers
|
// Write headers
|
||||||
|
@ -191,12 +191,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
private function mapVAlign($vAlign)
|
private function mapVAlign($vAlign)
|
||||||
{
|
{
|
||||||
switch ($vAlign) {
|
switch ($vAlign) {
|
||||||
case PHPExcel_Style_Alignment::VERTICAL_BOTTOM:
|
case \PHPExcel\Style\Alignment::VERTICAL_BOTTOM:
|
||||||
return 'bottom';
|
return 'bottom';
|
||||||
case PHPExcel_Style_Alignment::VERTICAL_TOP:
|
case \PHPExcel\Style\Alignment::VERTICAL_TOP:
|
||||||
return 'top';
|
return 'top';
|
||||||
case PHPExcel_Style_Alignment::VERTICAL_CENTER:
|
case \PHPExcel\Style\Alignment::VERTICAL_CENTER:
|
||||||
case PHPExcel_Style_Alignment::VERTICAL_JUSTIFY:
|
case \PHPExcel\Style\Alignment::VERTICAL_JUSTIFY:
|
||||||
return 'middle';
|
return 'middle';
|
||||||
default:
|
default:
|
||||||
return 'baseline';
|
return 'baseline';
|
||||||
|
@ -212,16 +212,16 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
private function mapHAlign($hAlign)
|
private function mapHAlign($hAlign)
|
||||||
{
|
{
|
||||||
switch ($hAlign) {
|
switch ($hAlign) {
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_GENERAL:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL:
|
||||||
return false;
|
return false;
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_LEFT:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_LEFT:
|
||||||
return 'left';
|
return 'left';
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_RIGHT:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT:
|
||||||
return 'right';
|
return 'right';
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_CENTER:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_CENTER:
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS:
|
||||||
return 'center';
|
return 'center';
|
||||||
case PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY:
|
case \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY:
|
||||||
return 'justify';
|
return 'justify';
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -237,33 +237,33 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
private function mapBorderStyle($borderStyle)
|
private function mapBorderStyle($borderStyle)
|
||||||
{
|
{
|
||||||
switch ($borderStyle) {
|
switch ($borderStyle) {
|
||||||
case PHPExcel_Style_Border::BORDER_NONE:
|
case \PHPExcel\Style\Border::BORDER_NONE:
|
||||||
return 'none';
|
return 'none';
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOT:
|
||||||
return '1px dashed';
|
return '1px dashed';
|
||||||
case PHPExcel_Style_Border::BORDER_DASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_DASHDOTDOT:
|
||||||
return '1px dotted';
|
return '1px dotted';
|
||||||
case PHPExcel_Style_Border::BORDER_DASHED:
|
case \PHPExcel\Style\Border::BORDER_DASHED:
|
||||||
return '1px dashed';
|
return '1px dashed';
|
||||||
case PHPExcel_Style_Border::BORDER_DOTTED:
|
case \PHPExcel\Style\Border::BORDER_DOTTED:
|
||||||
return '1px dotted';
|
return '1px dotted';
|
||||||
case PHPExcel_Style_Border::BORDER_DOUBLE:
|
case \PHPExcel\Style\Border::BORDER_DOUBLE:
|
||||||
return '3px double';
|
return '3px double';
|
||||||
case PHPExcel_Style_Border::BORDER_HAIR:
|
case \PHPExcel\Style\Border::BORDER_HAIR:
|
||||||
return '1px solid';
|
return '1px solid';
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUM:
|
case \PHPExcel\Style\Border::BORDER_MEDIUM:
|
||||||
return '2px solid';
|
return '2px solid';
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT:
|
||||||
return '2px dashed';
|
return '2px dashed';
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT:
|
||||||
return '2px dotted';
|
return '2px dotted';
|
||||||
case PHPExcel_Style_Border::BORDER_MEDIUMDASHED:
|
case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED:
|
||||||
return '2px dashed';
|
return '2px dashed';
|
||||||
case PHPExcel_Style_Border::BORDER_SLANTDASHDOT:
|
case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT:
|
||||||
return '2px dashed';
|
return '2px dashed';
|
||||||
case PHPExcel_Style_Border::BORDER_THICK:
|
case \PHPExcel\Style\Border::BORDER_THICK:
|
||||||
return '3px solid';
|
return '3px solid';
|
||||||
case PHPExcel_Style_Border::BORDER_THIN:
|
case \PHPExcel\Style\Border::BORDER_THIN:
|
||||||
return '1px solid';
|
return '1px solid';
|
||||||
default:
|
default:
|
||||||
// map others to thin
|
// map others to thin
|
||||||
|
@ -329,13 +329,13 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
*
|
*
|
||||||
* @param boolean $pIncludeStyles Include styles?
|
* @param boolean $pIncludeStyles Include styles?
|
||||||
* @return string
|
* @return string
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function generateHTMLHeader($pIncludeStyles = false)
|
public function generateHTMLHeader($pIncludeStyles = false)
|
||||||
{
|
{
|
||||||
// PHPExcel object known?
|
// PHPExcel object known?
|
||||||
if (is_null($this->phpExcel)) {
|
if (is_null($this->phpExcel)) {
|
||||||
throw new PHPExcel_Writer_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
|
// Construct HTML
|
||||||
|
@ -388,13 +388,13 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
* Generate sheet data
|
* Generate sheet data
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function generateSheetData()
|
public function generateSheetData()
|
||||||
{
|
{
|
||||||
// PHPExcel object known?
|
// PHPExcel object known?
|
||||||
if (is_null($this->phpExcel)) {
|
if (is_null($this->phpExcel)) {
|
||||||
throw new PHPExcel_Writer_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?
|
// Ensure that Spans have been calculated?
|
||||||
|
@ -507,13 +507,13 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
* Generate sheet tabs
|
* Generate sheet tabs
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function generateNavigation()
|
public function generateNavigation()
|
||||||
{
|
{
|
||||||
// PHPExcel object known?
|
// PHPExcel object known?
|
||||||
if (is_null($this->phpExcel)) {
|
if (is_null($this->phpExcel)) {
|
||||||
throw new PHPExcel_Writer_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
|
// Fetch sheets
|
||||||
|
@ -545,7 +545,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function extendRowsForChartsAndImages(PHPExcel_Worksheet $pSheet, $row)
|
private function extendRowsForChartsAndImages(\PHPExcel\Worksheet $pSheet, $row)
|
||||||
{
|
{
|
||||||
$rowMax = $row;
|
$rowMax = $row;
|
||||||
$colMax = 'A';
|
$colMax = 'A';
|
||||||
|
@ -566,7 +566,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($pSheet->getDrawingCollection() as $drawing) {
|
foreach ($pSheet->getDrawingCollection() as $drawing) {
|
||||||
if ($drawing instanceof PHPExcel_Worksheet_Drawing) {
|
if ($drawing instanceof \PHPExcel\Worksheet\Drawing) {
|
||||||
$imageTL = PHPExcel_Cell::coordinateFromString($drawing->getCoordinates());
|
$imageTL = PHPExcel_Cell::coordinateFromString($drawing->getCoordinates());
|
||||||
$imageCol = PHPExcel_Cell::columnIndexFromString($imageTL[0]);
|
$imageCol = PHPExcel_Cell::columnIndexFromString($imageTL[0]);
|
||||||
if ($imageTL[1] > $rowMax) {
|
if ($imageTL[1] > $rowMax) {
|
||||||
|
@ -599,19 +599,19 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
/**
|
/**
|
||||||
* Generate image tag in cell
|
* Generate image tag in cell
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet
|
* @param \PHPExcel\Worksheet $pSheet \PHPExcel\Worksheet
|
||||||
* @param string $coordinates Cell coordinates
|
* @param string $coordinates Cell coordinates
|
||||||
* @return string
|
* @return string
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeImageInCell(PHPExcel_Worksheet $pSheet, $coordinates)
|
private function writeImageInCell(\PHPExcel\Worksheet $pSheet, $coordinates)
|
||||||
{
|
{
|
||||||
// Construct HTML
|
// Construct HTML
|
||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
// Write images
|
// Write images
|
||||||
foreach ($pSheet->getDrawingCollection() as $drawing) {
|
foreach ($pSheet->getDrawingCollection() as $drawing) {
|
||||||
if ($drawing instanceof PHPExcel_Worksheet_Drawing) {
|
if ($drawing instanceof \PHPExcel\Worksheet\Drawing) {
|
||||||
if ($drawing->getCoordinates() == $coordinates) {
|
if ($drawing->getCoordinates() == $coordinates) {
|
||||||
$filename = $drawing->getPath();
|
$filename = $drawing->getPath();
|
||||||
|
|
||||||
|
@ -664,12 +664,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
/**
|
/**
|
||||||
* Generate chart tag in cell
|
* Generate chart tag in cell
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet
|
* @param \PHPExcel\Worksheet $pSheet \PHPExcel\Worksheet
|
||||||
* @param string $coordinates Cell coordinates
|
* @param string $coordinates Cell coordinates
|
||||||
* @return string
|
* @return string
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeChartInCell(PHPExcel_Worksheet $pSheet, $coordinates)
|
private function writeChartInCell(\PHPExcel\Worksheet $pSheet, $coordinates)
|
||||||
{
|
{
|
||||||
// Construct HTML
|
// Construct HTML
|
||||||
$html = '';
|
$html = '';
|
||||||
|
@ -713,13 +713,13 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
*
|
*
|
||||||
* @param boolean $generateSurroundingHTML Generate surrounding HTML tags? (<style> and </style>)
|
* @param boolean $generateSurroundingHTML Generate surrounding HTML tags? (<style> and </style>)
|
||||||
* @return string
|
* @return string
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function generateStyles($generateSurroundingHTML = true)
|
public function generateStyles($generateSurroundingHTML = true)
|
||||||
{
|
{
|
||||||
// PHPExcel object known?
|
// PHPExcel object known?
|
||||||
if (is_null($this->phpExcel)) {
|
if (is_null($this->phpExcel)) {
|
||||||
throw new PHPExcel_Writer_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
|
// Build CSS
|
||||||
|
@ -755,13 +755,13 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
*
|
*
|
||||||
* @param boolean $generateSurroundingHTML Generate surrounding HTML style? (html { })
|
* @param boolean $generateSurroundingHTML Generate surrounding HTML style? (html { })
|
||||||
* @return array
|
* @return array
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function buildCSS($generateSurroundingHTML = true)
|
public function buildCSS($generateSurroundingHTML = true)
|
||||||
{
|
{
|
||||||
// PHPExcel object known?
|
// PHPExcel object known?
|
||||||
if (is_null($this->phpExcel)) {
|
if (is_null($this->phpExcel)) {
|
||||||
throw new PHPExcel_Writer_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?
|
// Cached?
|
||||||
|
@ -847,8 +847,8 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
|
|
||||||
// col elements, loop through columnDimensions and set width
|
// col elements, loop through columnDimensions and set width
|
||||||
foreach ($sheet->getColumnDimensions() as $columnDimension) {
|
foreach ($sheet->getColumnDimensions() as $columnDimension) {
|
||||||
if (($width = PHPExcel_Shared_Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->defaultFont)) >= 0) {
|
if (($width = \PHPExcel\Shared\Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->defaultFont)) >= 0) {
|
||||||
$width = PHPExcel_Shared_Drawing::pixelsToPoints($width);
|
$width = \PHPExcel\Shared\Drawing::pixelsToPoints($width);
|
||||||
$column = PHPExcel_Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1;
|
$column = PHPExcel_Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1;
|
||||||
$this->columnWidths[$sheetIndex][$column] = $width;
|
$this->columnWidths[$sheetIndex][$column] = $width;
|
||||||
$css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = $width . 'pt';
|
$css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = $width . 'pt';
|
||||||
|
@ -909,10 +909,10 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
/**
|
/**
|
||||||
* Create CSS style
|
* Create CSS style
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Style $pStyle PHPExcel_Style
|
* @param \PHPExcel\Style $pStyle PHPExcel_Style
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function createCSSStyle(PHPExcel_Style $pStyle)
|
private function createCSSStyle(\PHPExcel\Style $pStyle)
|
||||||
{
|
{
|
||||||
// Construct CSS
|
// Construct CSS
|
||||||
$css = '';
|
$css = '';
|
||||||
|
@ -930,12 +930,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create CSS style (PHPExcel_Style_Alignment)
|
* Create CSS style (\PHPExcel\Style\Alignment)
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment
|
* @param \PHPExcel\Style\Alignment $pStyle \PHPExcel\Style\Alignment
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle)
|
private function createCSSStyleAlignment(\PHPExcel\Style\Alignment $pStyle)
|
||||||
{
|
{
|
||||||
// Construct CSS
|
// Construct CSS
|
||||||
$css = array();
|
$css = array();
|
||||||
|
@ -953,12 +953,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create CSS style (PHPExcel_Style_Font)
|
* Create CSS style (\PHPExcel\Style\Font)
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Style_Font $pStyle PHPExcel_Style_Font
|
* @param \PHPExcel\Style\Font $pStyle \PHPExcel\Style\Font
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function createCSSStyleFont(PHPExcel_Style_Font $pStyle)
|
private function createCSSStyleFont(\PHPExcel\Style\Font $pStyle)
|
||||||
{
|
{
|
||||||
// Construct CSS
|
// Construct CSS
|
||||||
$css = array();
|
$css = array();
|
||||||
|
@ -967,9 +967,9 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
if ($pStyle->getBold()) {
|
if ($pStyle->getBold()) {
|
||||||
$css['font-weight'] = 'bold';
|
$css['font-weight'] = 'bold';
|
||||||
}
|
}
|
||||||
if ($pStyle->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) {
|
if ($pStyle->getUnderline() != \PHPExcel\Style\Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) {
|
||||||
$css['text-decoration'] = 'underline line-through';
|
$css['text-decoration'] = 'underline line-through';
|
||||||
} elseif ($pStyle->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE) {
|
} elseif ($pStyle->getUnderline() != \PHPExcel\Style\Font::UNDERLINE_NONE) {
|
||||||
$css['text-decoration'] = 'underline';
|
$css['text-decoration'] = 'underline';
|
||||||
} elseif ($pStyle->getStrikethrough()) {
|
} elseif ($pStyle->getStrikethrough()) {
|
||||||
$css['text-decoration'] = 'line-through';
|
$css['text-decoration'] = 'line-through';
|
||||||
|
@ -986,12 +986,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create CSS style (PHPExcel_Style_Borders)
|
* Create CSS style (\PHPExcel\Style\Borders)
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Style_Borders $pStyle PHPExcel_Style_Borders
|
* @param \PHPExcel\Style\Borders $pStyle \PHPExcel\Style\Borders
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function createCSSStyleBorders(PHPExcel_Style_Borders $pStyle)
|
private function createCSSStyleBorders(\PHPExcel\Style\Borders $pStyle)
|
||||||
{
|
{
|
||||||
// Construct CSS
|
// Construct CSS
|
||||||
$css = array();
|
$css = array();
|
||||||
|
@ -1006,12 +1006,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create CSS style (PHPExcel_Style_Border)
|
* Create CSS style (\PHPExcel\Style\Border)
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Style_Border $pStyle PHPExcel_Style_Border
|
* @param \PHPExcel\Style\Border $pStyle \PHPExcel\Style\Border
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function createCSSStyleBorder(PHPExcel_Style_Border $pStyle)
|
private function createCSSStyleBorder(\PHPExcel\Style\Border $pStyle)
|
||||||
{
|
{
|
||||||
// Create CSS
|
// Create CSS
|
||||||
// $css = $this->mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB();
|
// $css = $this->mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB();
|
||||||
|
@ -1023,18 +1023,18 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create CSS style (PHPExcel_Style_Fill)
|
* Create CSS style (\PHPExcel\Style\Fill)
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Style_Fill $pStyle PHPExcel_Style_Fill
|
* @param \PHPExcel\Style\Fill $pStyle \PHPExcel\Style\Fill
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function createCSSStyleFill(PHPExcel_Style_Fill $pStyle)
|
private function createCSSStyleFill(\PHPExcel\Style\Fill $pStyle)
|
||||||
{
|
{
|
||||||
// Construct HTML
|
// Construct HTML
|
||||||
$css = array();
|
$css = array();
|
||||||
|
|
||||||
// Create CSS
|
// Create CSS
|
||||||
$value = $pStyle->getFillType() == PHPExcel_Style_Fill::FILL_NONE ?
|
$value = $pStyle->getFillType() == \PHPExcel\Style\Fill::FILL_NONE ?
|
||||||
'white' : '#' . $pStyle->getStartColor()->getRGB();
|
'white' : '#' . $pStyle->getStartColor()->getRGB();
|
||||||
$css['background-color'] = $value;
|
$css['background-color'] = $value;
|
||||||
|
|
||||||
|
@ -1057,9 +1057,9 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
/**
|
/**
|
||||||
* Generate table header
|
* Generate table header
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pSheet The worksheet for the table we are writing
|
* @param \PHPExcel\Worksheet $pSheet The worksheet for the table we are writing
|
||||||
* @return string
|
* @return string
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function generateTableHeader($pSheet)
|
private function generateTableHeader($pSheet)
|
||||||
{
|
{
|
||||||
|
@ -1104,7 +1104,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
/**
|
/**
|
||||||
* Generate table footer
|
* Generate table footer
|
||||||
*
|
*
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function generateTableFooter()
|
private function generateTableFooter()
|
||||||
{
|
{
|
||||||
|
@ -1116,13 +1116,13 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
/**
|
/**
|
||||||
* Generate row
|
* Generate row
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet
|
* @param \PHPExcel\Worksheet $pSheet \PHPExcel\Worksheet
|
||||||
* @param array $pValues Array containing cells in a row
|
* @param array $pValues Array containing cells in a row
|
||||||
* @param int $pRow Row number (0-based)
|
* @param int $pRow Row number (0-based)
|
||||||
* @return string
|
* @return string
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function generateRow(PHPExcel_Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td')
|
private function generateRow(\PHPExcel\Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td')
|
||||||
{
|
{
|
||||||
if (is_array($pValues)) {
|
if (is_array($pValues)) {
|
||||||
// Construct HTML
|
// Construct HTML
|
||||||
|
@ -1191,12 +1191,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
$cell->attach($pSheet);
|
$cell->attach($pSheet);
|
||||||
}
|
}
|
||||||
// Value
|
// Value
|
||||||
if ($cell->getValue() instanceof PHPExcel_RichText) {
|
if ($cell->getValue() instanceof \PHPExcel\RichText) {
|
||||||
// Loop through rich text elements
|
// Loop through rich text elements
|
||||||
$elements = $cell->getValue()->getRichTextElements();
|
$elements = $cell->getValue()->getRichTextElements();
|
||||||
foreach ($elements as $element) {
|
foreach ($elements as $element) {
|
||||||
// Rich text start?
|
// Rich text start?
|
||||||
if ($element instanceof PHPExcel_RichText_Run) {
|
if ($element instanceof \PHPExcel\RichText\Run) {
|
||||||
$cellData .= '<span style="' . $this->assembleCSS($this->createCSSStyleFont($element->getFont())) . '">';
|
$cellData .= '<span style="' . $this->assembleCSS($this->createCSSStyleFont($element->getFont())) . '">';
|
||||||
|
|
||||||
if ($element->getFont()->getSuperScript()) {
|
if ($element->getFont()->getSuperScript()) {
|
||||||
|
@ -1210,7 +1210,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
$cellText = $element->getText();
|
$cellText = $element->getText();
|
||||||
$cellData .= htmlspecialchars($cellText);
|
$cellData .= htmlspecialchars($cellText);
|
||||||
|
|
||||||
if ($element instanceof PHPExcel_RichText_Run) {
|
if ($element instanceof \PHPExcel\RichText\Run) {
|
||||||
if ($element->getFont()->getSuperScript()) {
|
if ($element->getFont()->getSuperScript()) {
|
||||||
$cellData .= '</sup>';
|
$cellData .= '</sup>';
|
||||||
} elseif ($element->getFont()->getSubScript()) {
|
} elseif ($element->getFont()->getSubScript()) {
|
||||||
|
@ -1222,13 +1222,13 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($this->preCalculateFormulas) {
|
if ($this->preCalculateFormulas) {
|
||||||
$cellData = PHPExcel_Style_NumberFormat::toFormattedString(
|
$cellData = \PHPExcel\Style\NumberFormat::toFormattedString(
|
||||||
$cell->getCalculatedValue(),
|
$cell->getCalculatedValue(),
|
||||||
$pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(),
|
$pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(),
|
||||||
array($this, 'formatColor')
|
array($this, 'formatColor')
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$cellData = PHPExcel_Style_NumberFormat::toFormattedString(
|
$cellData = \PHPExcel\Style\NumberFormat::toFormattedString(
|
||||||
$cell->getValue(),
|
$cell->getValue(),
|
||||||
$pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(),
|
$pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(),
|
||||||
array($this, 'formatColor')
|
array($this, 'formatColor')
|
||||||
|
@ -1266,7 +1266,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
|
|
||||||
// General horizontal alignment: Actual horizontal alignment depends on dataType
|
// General horizontal alignment: Actual horizontal alignment depends on dataType
|
||||||
$sharedStyle = $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex());
|
$sharedStyle = $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex());
|
||||||
if ($sharedStyle->getAlignment()->getHorizontal() == PHPExcel_Style_Alignment::HORIZONTAL_GENERAL
|
if ($sharedStyle->getAlignment()->getHorizontal() == \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL
|
||||||
&& isset($this->cssStyles['.' . $cell->getDataType()]['text-align'])) {
|
&& isset($this->cssStyles['.' . $cell->getDataType()]['text-align'])) {
|
||||||
$cssClass['text-align'] = $this->cssStyles['.' . $cell->getDataType()]['text-align'];
|
$cssClass['text-align'] = $this->cssStyles['.' . $cell->getDataType()]['text-align'];
|
||||||
}
|
}
|
||||||
|
@ -1361,7 +1361,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
// Return
|
// Return
|
||||||
return $html;
|
return $html;
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
|
throw new \PHPExcel\Writer\Exception("Invalid parameters passed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1569,7 +1569,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||||
$this->spansAreCalculated = true;
|
$this->spansAreCalculated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setMargins(PHPExcel_Worksheet $pSheet)
|
private function setMargins(\PHPExcel\Worksheet $pSheet)
|
||||||
{
|
{
|
||||||
$htmlPage = '@page { ';
|
$htmlPage = '@page { ';
|
||||||
$htmlBody = 'body { ';
|
$htmlBody = 'body { ';
|
||||||
|
|
|
@ -33,7 +33,7 @@ interface IWriter
|
||||||
* Save PHPExcel to file
|
* Save PHPExcel to file
|
||||||
*
|
*
|
||||||
* @param string $pFilename Name of the file to save
|
* @param string $pFilename Name of the file to save
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null);
|
public function save($pFilename = null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,9 +44,9 @@ class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements P
|
||||||
/**
|
/**
|
||||||
* Create a new PHPExcel_Writer_OpenDocument
|
* Create a new PHPExcel_Writer_OpenDocument
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
*/
|
*/
|
||||||
public function __construct(PHPExcel $pPHPExcel = null)
|
public function __construct(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
$this->setPHPExcel($pPHPExcel);
|
$this->setPHPExcel($pPHPExcel);
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements P
|
||||||
* Get writer part
|
* Get writer part
|
||||||
*
|
*
|
||||||
* @param string $pPartName Writer part name
|
* @param string $pPartName Writer part name
|
||||||
* @return PHPExcel_Writer_Excel2007_WriterPart
|
* @return \PHPExcel\Writer\Excel2007\WriterPart
|
||||||
*/
|
*/
|
||||||
public function getWriterPart($pPartName = '')
|
public function getWriterPart($pPartName = '')
|
||||||
{
|
{
|
||||||
|
@ -84,12 +84,12 @@ class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements P
|
||||||
* Save PHPExcel to file
|
* Save PHPExcel to file
|
||||||
*
|
*
|
||||||
* @param string $pFilename
|
* @param string $pFilename
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename = null)
|
||||||
{
|
{
|
||||||
if (!$this->spreadSheet) {
|
if (!$this->spreadSheet) {
|
||||||
throw new PHPExcel_Writer_Exception('PHPExcel object unassigned.');
|
throw new \PHPExcel\Writer\Exception('PHPExcel object unassigned.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// garbage collect
|
// garbage collect
|
||||||
|
@ -116,13 +116,13 @@ class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements P
|
||||||
|
|
||||||
// Close file
|
// Close file
|
||||||
if ($objZip->close() === false) {
|
if ($objZip->close() === false) {
|
||||||
throw new PHPExcel_Writer_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 a temporary file was used, copy it to the correct file stream
|
||||||
if ($originalFilename != $pFilename) {
|
if ($originalFilename != $pFilename) {
|
||||||
if (copy($pFilename, $originalFilename) === false) {
|
if (copy($pFilename, $originalFilename) === false) {
|
||||||
throw new PHPExcel_Writer_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);
|
@unlink($pFilename);
|
||||||
}
|
}
|
||||||
|
@ -132,13 +132,13 @@ class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements P
|
||||||
* Create zip object
|
* Create zip object
|
||||||
*
|
*
|
||||||
* @param string $pFilename
|
* @param string $pFilename
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
* @return ZipArchive
|
* @return ZipArchive
|
||||||
*/
|
*/
|
||||||
private function createZip($pFilename)
|
private function createZip($pFilename)
|
||||||
{
|
{
|
||||||
// Create new ZIP file and open it for writing
|
// Create new ZIP file and open it for writing
|
||||||
$zipClass = PHPExcel_Settings::getZipClass();
|
$zipClass = \PHPExcel\Settings::getZipClass();
|
||||||
$objZip = new $zipClass();
|
$objZip = new $zipClass();
|
||||||
|
|
||||||
// Retrieve OVERWRITE and CREATE constants from the instantiated zip class
|
// Retrieve OVERWRITE and CREATE constants from the instantiated zip class
|
||||||
|
@ -153,7 +153,7 @@ class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements P
|
||||||
// Try opening the ZIP file
|
// Try opening the ZIP file
|
||||||
if ($objZip->open($pFilename, $zipOverWrite) !== true) {
|
if ($objZip->open($pFilename, $zipOverWrite) !== true) {
|
||||||
if ($objZip->open($pFilename, $zipCreate) !== true) {
|
if ($objZip->open($pFilename, $zipCreate) !== true) {
|
||||||
throw new PHPExcel_Writer_Exception("Could not open $pFilename for writing.");
|
throw new \PHPExcel\Writer\Exception("Could not open $pFilename for writing.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,14 +164,14 @@ class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements P
|
||||||
* Get PHPExcel object
|
* Get PHPExcel object
|
||||||
*
|
*
|
||||||
* @return PHPExcel
|
* @return PHPExcel
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function getPHPExcel()
|
public function getPHPExcel()
|
||||||
{
|
{
|
||||||
if ($this->spreadSheet !== null) {
|
if ($this->spreadSheet !== null) {
|
||||||
return $this->spreadSheet;
|
return $this->spreadSheet;
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception('No PHPExcel assigned.');
|
throw new \PHPExcel\Writer\Exception('No PHPExcel assigned.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,10 +179,10 @@ class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements P
|
||||||
* Set PHPExcel object
|
* Set PHPExcel object
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel PHPExcel object
|
* @param PHPExcel $pPHPExcel PHPExcel object
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
* @return PHPExcel_Writer_Excel2007
|
* @return PHPExcel_Writer_Excel2007
|
||||||
*/
|
*/
|
||||||
public function setPHPExcel(PHPExcel $pPHPExcel = null)
|
public function setPHPExcel(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
$this->spreadSheet = $pPHPExcel;
|
$this->spreadSheet = $pPHPExcel;
|
||||||
return $this;
|
return $this;
|
||||||
|
|
|
@ -44,9 +44,9 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function write(PHPExcel $pPHPExcel = null)
|
public function write(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
if (!$pPHPExcel) {
|
if (!$pPHPExcel) {
|
||||||
$pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */
|
$pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */
|
||||||
|
@ -141,9 +141,9 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
|
||||||
* Write rows of the specified sheet
|
* Write rows of the specified sheet
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter
|
* @param PHPExcel_Shared_XMLWriter $objWriter
|
||||||
* @param PHPExcel_Worksheet $sheet
|
* @param \PHPExcel\Worksheet $sheet
|
||||||
*/
|
*/
|
||||||
private function writeRows(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet $sheet)
|
private function writeRows(PHPExcel_Shared_XMLWriter $objWriter, \PHPExcel\Worksheet $sheet)
|
||||||
{
|
{
|
||||||
$number_rows_repeated = self::NUMBER_ROWS_REPEATED_MAX;
|
$number_rows_repeated = self::NUMBER_ROWS_REPEATED_MAX;
|
||||||
$span_row = 0;
|
$span_row = 0;
|
||||||
|
@ -177,10 +177,10 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
|
||||||
* Write cells of the specified row
|
* Write cells of the specified row
|
||||||
*
|
*
|
||||||
* @param PHPExcel_Shared_XMLWriter $objWriter
|
* @param PHPExcel_Shared_XMLWriter $objWriter
|
||||||
* @param PHPExcel_Worksheet_Row $row
|
* @param \PHPExcel\Worksheet\Row $row
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
private function writeCells(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet_Row $row)
|
private function writeCells(PHPExcel_Shared_XMLWriter $objWriter, \PHPExcel\Worksheet\Row $row)
|
||||||
{
|
{
|
||||||
$number_cols_repeated = self::NUMBER_COLS_REPEATED_MAX;
|
$number_cols_repeated = self::NUMBER_COLS_REPEATED_MAX;
|
||||||
$prev_column = -1;
|
$prev_column = -1;
|
||||||
|
@ -193,17 +193,17 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
|
||||||
$objWriter->startElement('table:table-cell');
|
$objWriter->startElement('table:table-cell');
|
||||||
|
|
||||||
switch ($cell->getDataType()) {
|
switch ($cell->getDataType()) {
|
||||||
case PHPExcel_Cell_DataType::TYPE_BOOL:
|
case \PHPExcel\Cell\DataType::TYPE_BOOL:
|
||||||
$objWriter->writeAttribute('office:value-type', 'boolean');
|
$objWriter->writeAttribute('office:value-type', 'boolean');
|
||||||
$objWriter->writeAttribute('office:value', $cell->getValue());
|
$objWriter->writeAttribute('office:value', $cell->getValue());
|
||||||
$objWriter->writeElement('text:p', $cell->getValue());
|
$objWriter->writeElement('text:p', $cell->getValue());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PHPExcel_Cell_DataType::TYPE_ERROR:
|
case \PHPExcel\Cell\DataType::TYPE_ERROR:
|
||||||
throw new PHPExcel_Writer_Exception('Writing of error not implemented yet.');
|
throw new \PHPExcel\Writer\Exception('Writing of error not implemented yet.');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PHPExcel_Cell_DataType::TYPE_FORMULA:
|
case \PHPExcel\Cell\DataType::TYPE_FORMULA:
|
||||||
try {
|
try {
|
||||||
$formula_value = $cell->getCalculatedValue();
|
$formula_value = $cell->getCalculatedValue();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
@ -219,17 +219,17 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
|
||||||
$objWriter->writeElement('text:p', $formula_value);
|
$objWriter->writeElement('text:p', $formula_value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PHPExcel_Cell_DataType::TYPE_INLINE:
|
case \PHPExcel\Cell\DataType::TYPE_INLINE:
|
||||||
throw new PHPExcel_Writer_Exception('Writing of inline not implemented yet.');
|
throw new \PHPExcel\Writer\Exception('Writing of inline not implemented yet.');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PHPExcel_Cell_DataType::TYPE_NUMERIC:
|
case \PHPExcel\Cell\DataType::TYPE_NUMERIC:
|
||||||
$objWriter->writeAttribute('office:value-type', 'float');
|
$objWriter->writeAttribute('office:value-type', 'float');
|
||||||
$objWriter->writeAttribute('office:value', $cell->getValue());
|
$objWriter->writeAttribute('office:value', $cell->getValue());
|
||||||
$objWriter->writeElement('text:p', $cell->getValue());
|
$objWriter->writeElement('text:p', $cell->getValue());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PHPExcel_Cell_DataType::TYPE_STRING:
|
case \PHPExcel\Cell\DataType::TYPE_STRING:
|
||||||
$objWriter->writeAttribute('office:value-type', 'string');
|
$objWriter->writeAttribute('office:value-type', 'string');
|
||||||
$objWriter->writeElement('text:p', $cell->getValue());
|
$objWriter->writeElement('text:p', $cell->getValue());
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -32,9 +32,9 @@ class PHPExcel_Writer_OpenDocument_Meta extends PHPExcel_Writer_OpenDocument_Wri
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function write(PHPExcel $pPHPExcel = null)
|
public function write(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
if (!$pPHPExcel) {
|
if (!$pPHPExcel) {
|
||||||
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
||||||
|
|
|
@ -30,11 +30,11 @@ class PHPExcel_Writer_OpenDocument_MetaInf extends PHPExcel_Writer_OpenDocument_
|
||||||
/**
|
/**
|
||||||
* Write META-INF/manifest.xml to XML format
|
* Write META-INF/manifest.xml to XML format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeManifest(PHPExcel $pPHPExcel = null)
|
public function writeManifest(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
if (!$pPHPExcel) {
|
if (!$pPHPExcel) {
|
||||||
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
||||||
|
|
|
@ -30,11 +30,11 @@ class PHPExcel_Writer_OpenDocument_Mimetype extends PHPExcel_Writer_OpenDocument
|
||||||
/**
|
/**
|
||||||
* Write mimetype to plain text format
|
* Write mimetype to plain text format
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param \PHPExcel\SpreadSheet $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function write(PHPExcel $pPHPExcel = null)
|
public function write(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
return 'application/vnd.oasis.opendocument.spreadsheet';
|
return 'application/vnd.oasis.opendocument.spreadsheet';
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,9 +32,9 @@ class PHPExcel_Writer_OpenDocument_Settings extends PHPExcel_Writer_OpenDocument
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function write(PHPExcel $pPHPExcel = null)
|
public function write(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
if (!$pPHPExcel) {
|
if (!$pPHPExcel) {
|
||||||
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
||||||
|
|
|
@ -32,9 +32,9 @@ class PHPExcel_Writer_OpenDocument_Styles extends PHPExcel_Writer_OpenDocument_W
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function write(PHPExcel $pPHPExcel = null)
|
public function write(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
if (!$pPHPExcel) {
|
if (!$pPHPExcel) {
|
||||||
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
||||||
|
|
|
@ -32,9 +32,9 @@ class PHPExcel_Writer_OpenDocument_Thumbnails extends PHPExcel_Writer_OpenDocume
|
||||||
*
|
*
|
||||||
* @param PHPExcel $pPHPExcel
|
* @param PHPExcel $pPHPExcel
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function writeThumbnail(PHPExcel $pPHPExcel = null)
|
public function writeThumbnail(\PHPExcel\SpreadSheet $pPHPExcel = null)
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
abstract class PHPExcel_Writer_OpenDocument_WriterPart extends PHPExcel_Writer_Excel2007_WriterPart
|
abstract class PHPExcel_Writer_OpenDocument_WriterPart extends \PHPExcel\Writer\Excel2007\WriterPart
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,137 +71,137 @@ abstract class Core extends \PHPExcel\Writer\HTML
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected static $paperSizes = array(
|
protected static $paperSizes = array(
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER
|
||||||
=> 'LETTER', // (8.5 in. by 11 in.)
|
=> 'LETTER', // (8.5 in. by 11 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_SMALL
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER_SMALL
|
||||||
=> 'LETTER', // (8.5 in. by 11 in.)
|
=> 'LETTER', // (8.5 in. by 11 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_TABLOID
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_TABLOID
|
||||||
=> array(792.00, 1224.00), // (11 in. by 17 in.)
|
=> array(792.00, 1224.00), // (11 in. by 17 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEDGER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_LEDGER
|
||||||
=> array(1224.00, 792.00), // (17 in. by 11 in.)
|
=> array(1224.00, 792.00), // (17 in. by 11 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_LEGAL
|
||||||
=> 'LEGAL', // (8.5 in. by 14 in.)
|
=> 'LEGAL', // (8.5 in. by 14 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STATEMENT
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_STATEMENT
|
||||||
=> array(396.00, 612.00), // (5.5 in. by 8.5 in.)
|
=> array(396.00, 612.00), // (5.5 in. by 8.5 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_EXECUTIVE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_EXECUTIVE
|
||||||
=> 'EXECUTIVE', // (7.25 in. by 10.5 in.)
|
=> 'EXECUTIVE', // (7.25 in. by 10.5 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A3
|
||||||
=> 'A3', // (297 mm by 420 mm)
|
=> 'A3', // (297 mm by 420 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4
|
||||||
=> 'A4', // (210 mm by 297 mm)
|
=> 'A4', // (210 mm by 297 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_SMALL
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4_SMALL
|
||||||
=> 'A4', // (210 mm by 297 mm)
|
=> 'A4', // (210 mm by 297 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A5
|
||||||
=> 'A5', // (148 mm by 210 mm)
|
=> 'A5', // (148 mm by 210 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_B4
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_B4
|
||||||
=> 'B4', // (250 mm by 353 mm)
|
=> 'B4', // (250 mm by 353 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_B5
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_B5
|
||||||
=> 'B5', // (176 mm by 250 mm)
|
=> 'B5', // (176 mm by 250 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_FOLIO
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_FOLIO
|
||||||
=> 'FOLIO', // (8.5 in. by 13 in.)
|
=> 'FOLIO', // (8.5 in. by 13 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_QUARTO
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_QUARTO
|
||||||
=> array(609.45, 779.53), // (215 mm by 275 mm)
|
=> array(609.45, 779.53), // (215 mm by 275 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_1
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_STANDARD_1
|
||||||
=> array(720.00, 1008.00), // (10 in. by 14 in.)
|
=> array(720.00, 1008.00), // (10 in. by 14 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_2
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_STANDARD_2
|
||||||
=> array(792.00, 1224.00), // (11 in. by 17 in.)
|
=> array(792.00, 1224.00), // (11 in. by 17 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NOTE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_NOTE
|
||||||
=> 'LETTER', // (8.5 in. by 11 in.)
|
=> 'LETTER', // (8.5 in. by 11 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO9_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_NO9_ENVELOPE
|
||||||
=> array(279.00, 639.00), // (3.875 in. by 8.875 in.)
|
=> array(279.00, 639.00), // (3.875 in. by 8.875 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO10_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_NO10_ENVELOPE
|
||||||
=> array(297.00, 684.00), // (4.125 in. by 9.5 in.)
|
=> array(297.00, 684.00), // (4.125 in. by 9.5 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO11_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_NO11_ENVELOPE
|
||||||
=> array(324.00, 747.00), // (4.5 in. by 10.375 in.)
|
=> array(324.00, 747.00), // (4.5 in. by 10.375 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO12_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_NO12_ENVELOPE
|
||||||
=> array(342.00, 792.00), // (4.75 in. by 11 in.)
|
=> array(342.00, 792.00), // (4.75 in. by 11 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO14_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_NO14_ENVELOPE
|
||||||
=> array(360.00, 828.00), // (5 in. by 11.5 in.)
|
=> array(360.00, 828.00), // (5 in. by 11.5 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_C
|
||||||
=> array(1224.00, 1584.00), // (17 in. by 22 in.)
|
=> array(1224.00, 1584.00), // (17 in. by 22 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_D
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_D
|
||||||
=> array(1584.00, 2448.00), // (22 in. by 34 in.)
|
=> array(1584.00, 2448.00), // (22 in. by 34 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_E
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_E
|
||||||
=> array(2448.00, 3168.00), // (34 in. by 44 in.)
|
=> array(2448.00, 3168.00), // (34 in. by 44 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_DL_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_DL_ENVELOPE
|
||||||
=> array(311.81, 623.62), // (110 mm by 220 mm)
|
=> array(311.81, 623.62), // (110 mm by 220 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C5_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_C5_ENVELOPE
|
||||||
=> 'C5', // (162 mm by 229 mm)
|
=> 'C5', // (162 mm by 229 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C3_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_C3_ENVELOPE
|
||||||
=> 'C3', // (324 mm by 458 mm)
|
=> 'C3', // (324 mm by 458 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C4_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_C4_ENVELOPE
|
||||||
=> 'C4', // (229 mm by 324 mm)
|
=> 'C4', // (229 mm by 324 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C6_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_C6_ENVELOPE
|
||||||
=> 'C6', // (114 mm by 162 mm)
|
=> 'C6', // (114 mm by 162 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_C65_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_C65_ENVELOPE
|
||||||
=> array(323.15, 649.13), // (114 mm by 229 mm)
|
=> array(323.15, 649.13), // (114 mm by 229 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_B4_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_B4_ENVELOPE
|
||||||
=> 'B4', // (250 mm by 353 mm)
|
=> 'B4', // (250 mm by 353 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_B5_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_B5_ENVELOPE
|
||||||
=> 'B5', // (176 mm by 250 mm)
|
=> 'B5', // (176 mm by 250 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_B6_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_B6_ENVELOPE
|
||||||
=> array(498.90, 354.33), // (176 mm by 125 mm)
|
=> array(498.90, 354.33), // (176 mm by 125 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_ITALY_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_ITALY_ENVELOPE
|
||||||
=> array(311.81, 651.97), // (110 mm by 230 mm)
|
=> array(311.81, 651.97), // (110 mm by 230 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_MONARCH_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_MONARCH_ENVELOPE
|
||||||
=> array(279.00, 540.00), // (3.875 in. by 7.5 in.)
|
=> array(279.00, 540.00), // (3.875 in. by 7.5 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_6_3_4_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_6_3_4_ENVELOPE
|
||||||
=> array(261.00, 468.00), // (3.625 in. by 6.5 in.)
|
=> array(261.00, 468.00), // (3.625 in. by 6.5 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_US_STANDARD_FANFOLD
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_US_STANDARD_FANFOLD
|
||||||
=> array(1071.00, 792.00), // (14.875 in. by 11 in.)
|
=> array(1071.00, 792.00), // (14.875 in. by 11 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD
|
||||||
=> array(612.00, 864.00), // (8.5 in. by 12 in.)
|
=> array(612.00, 864.00), // (8.5 in. by 12 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD
|
||||||
=> 'FOLIO', // (8.5 in. by 13 in.)
|
=> 'FOLIO', // (8.5 in. by 13 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_ISO_B4
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_ISO_B4
|
||||||
=> 'B4', // (250 mm by 353 mm)
|
=> 'B4', // (250 mm by 353 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD
|
||||||
=> array(566.93, 419.53), // (200 mm by 148 mm)
|
=> array(566.93, 419.53), // (200 mm by 148 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_1
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_1
|
||||||
=> array(648.00, 792.00), // (9 in. by 11 in.)
|
=> array(648.00, 792.00), // (9 in. by 11 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_2
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_2
|
||||||
=> array(720.00, 792.00), // (10 in. by 11 in.)
|
=> array(720.00, 792.00), // (10 in. by 11 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_3
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_3
|
||||||
=> array(1080.00, 792.00), // (15 in. by 11 in.)
|
=> array(1080.00, 792.00), // (15 in. by 11 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_INVITE_ENVELOPE
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_INVITE_ENVELOPE
|
||||||
=> array(623.62, 623.62), // (220 mm by 220 mm)
|
=> array(623.62, 623.62), // (220 mm by 220 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER
|
||||||
=> array(667.80, 864.00), // (9.275 in. by 12 in.)
|
=> array(667.80, 864.00), // (9.275 in. by 12 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER
|
||||||
=> array(667.80, 1080.00), // (9.275 in. by 15 in.)
|
=> array(667.80, 1080.00), // (9.275 in. by 15 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER
|
||||||
=> array(841.68, 1296.00), // (11.69 in. by 18 in.)
|
=> array(841.68, 1296.00), // (11.69 in. by 18 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_EXTRA_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4_EXTRA_PAPER
|
||||||
=> array(668.98, 912.76), // (236 mm by 322 mm)
|
=> array(668.98, 912.76), // (236 mm by 322 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER
|
||||||
=> array(595.80, 792.00), // (8.275 in. by 11 in.)
|
=> array(595.80, 792.00), // (8.275 in. by 11 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER
|
||||||
=> 'A4', // (210 mm by 297 mm)
|
=> 'A4', // (210 mm by 297 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER
|
||||||
=> array(667.80, 864.00), // (9.275 in. by 12 in.)
|
=> array(667.80, 864.00), // (9.275 in. by 12 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER
|
||||||
=> array(643.46, 1009.13), // (227 mm by 356 mm)
|
=> array(643.46, 1009.13), // (227 mm by 356 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER
|
||||||
=> array(864.57, 1380.47), // (305 mm by 487 mm)
|
=> array(864.57, 1380.47), // (305 mm by 487 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_PLUS_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER_PLUS_PAPER
|
||||||
=> array(612.00, 913.68), // (8.5 in. by 12.69 in.)
|
=> array(612.00, 913.68), // (8.5 in. by 12.69 in.)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_PLUS_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4_PLUS_PAPER
|
||||||
=> array(595.28, 935.43), // (210 mm by 330 mm)
|
=> array(595.28, 935.43), // (210 mm by 330 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER
|
||||||
=> 'A5', // (148 mm by 210 mm)
|
=> 'A5', // (148 mm by 210 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER
|
||||||
=> array(515.91, 728.50), // (182 mm by 257 mm)
|
=> array(515.91, 728.50), // (182 mm by 257 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_EXTRA_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A3_EXTRA_PAPER
|
||||||
=> array(912.76, 1261.42), // (322 mm by 445 mm)
|
=> array(912.76, 1261.42), // (322 mm by 445 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5_EXTRA_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A5_EXTRA_PAPER
|
||||||
=> array(493.23, 666.14), // (174 mm by 235 mm)
|
=> array(493.23, 666.14), // (174 mm by 235 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER
|
||||||
=> array(569.76, 782.36), // (201 mm by 276 mm)
|
=> array(569.76, 782.36), // (201 mm by 276 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A2_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A2_PAPER
|
||||||
=> 'A2', // (420 mm by 594 mm)
|
=> 'A2', // (420 mm by 594 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER
|
||||||
=> 'A3', // (297 mm by 420 mm)
|
=> 'A3', // (297 mm by 420 mm)
|
||||||
PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER
|
\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER
|
||||||
=> array(912.76, 1261.42) // (322 mm by 445 mm)
|
=> array(912.76, 1261.42) // (322 mm by 445 mm)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ abstract class Core extends \PHPExcel\Writer\HTML
|
||||||
* @param string $pValue Paper size
|
* @param string $pValue Paper size
|
||||||
* @return PHPExcel_Writer_PDF
|
* @return PHPExcel_Writer_PDF
|
||||||
*/
|
*/
|
||||||
public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER)
|
public function setPaperSize($pValue = \PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER)
|
||||||
{
|
{
|
||||||
$this->paperSize = $pValue;
|
$this->paperSize = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -280,7 +280,7 @@ abstract class Core extends \PHPExcel\Writer\HTML
|
||||||
* @param string $pValue Page orientation
|
* @param string $pValue Page orientation
|
||||||
* @return PHPExcel_Writer_PDF
|
* @return PHPExcel_Writer_PDF
|
||||||
*/
|
*/
|
||||||
public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT)
|
public function setOrientation($pValue = \PHPExcel\Worksheet\PageSetup::ORIENTATION_DEFAULT)
|
||||||
{
|
{
|
||||||
$this->orientation = $pValue;
|
$this->orientation = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -300,7 +300,7 @@ abstract class Core extends \PHPExcel\Writer\HTML
|
||||||
* Set temporary storage directory
|
* Set temporary storage directory
|
||||||
*
|
*
|
||||||
* @param string $pValue Temporary storage directory
|
* @param string $pValue Temporary storage directory
|
||||||
* @throws PHPExcel_Writer_Exception when directory does not exist
|
* @throws \PHPExcel\Writer\Exception when directory does not exist
|
||||||
* @return PHPExcel_Writer_PDF
|
* @return PHPExcel_Writer_PDF
|
||||||
*/
|
*/
|
||||||
public function setTempDir($pValue = '')
|
public function setTempDir($pValue = '')
|
||||||
|
@ -308,7 +308,7 @@ abstract class Core extends \PHPExcel\Writer\HTML
|
||||||
if (is_dir($pValue)) {
|
if (is_dir($pValue)) {
|
||||||
$this->tempDir = $pValue;
|
$this->tempDir = $pValue;
|
||||||
} else {
|
} else {
|
||||||
throw new PHPExcel_Writer_Exception("Directory does not exist: $pValue");
|
throw new \PHPExcel\Writer\Exception("Directory does not exist: $pValue");
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -317,7 +317,7 @@ abstract class Core extends \PHPExcel\Writer\HTML
|
||||||
* Save Spreadsheet to PDF file, pre-save
|
* Save Spreadsheet to PDF file, pre-save
|
||||||
*
|
*
|
||||||
* @param string $pFilename Name of the file to save as
|
* @param string $pFilename Name of the file to save as
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
protected function prepareForSave($pFilename = null)
|
protected function prepareForSave($pFilename = null)
|
||||||
{
|
{
|
||||||
|
@ -330,7 +330,7 @@ abstract class Core extends \PHPExcel\Writer\HTML
|
||||||
// Open file
|
// Open file
|
||||||
$fileHandle = fopen($pFilename, 'w');
|
$fileHandle = fopen($pFilename, 'w');
|
||||||
if ($fileHandle === false) {
|
if ($fileHandle === false) {
|
||||||
throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing.");
|
throw new \PHPExcel\Writer\Exception("Could not open file $pFilename for writing.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set PDF
|
// Set PDF
|
||||||
|
@ -345,7 +345,7 @@ abstract class Core extends \PHPExcel\Writer\HTML
|
||||||
* Save PHPExcel to PDF file, post-save
|
* Save PHPExcel to PDF file, post-save
|
||||||
*
|
*
|
||||||
* @param resource $fileHandle
|
* @param resource $fileHandle
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
protected function restoreStateAfterSave($fileHandle)
|
protected function restoreStateAfterSave($fileHandle)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,12 +63,12 @@ class DomPDF extends Core implements \PHPExcel\Writer\IWriter
|
||||||
// Check for paper size and page orientation
|
// Check for paper size and page orientation
|
||||||
if (is_null($this->getSheetIndex())) {
|
if (is_null($this->getSheetIndex())) {
|
||||||
$orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
$orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
||||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
== \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||||
$printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
$printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
||||||
$printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
|
$printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
|
||||||
} else {
|
} else {
|
||||||
$orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
$orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
||||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
== \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||||
$printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
$printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
||||||
$printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
$printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
||||||
}
|
}
|
||||||
|
@ -77,8 +77,8 @@ class DomPDF extends Core implements \PHPExcel\Writer\IWriter
|
||||||
|
|
||||||
// Override Page Orientation
|
// Override Page Orientation
|
||||||
if (!is_null($this->getOrientation())) {
|
if (!is_null($this->getOrientation())) {
|
||||||
$orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT)
|
$orientation = ($this->getOrientation() == \PHPExcel\Worksheet\PageSetup::ORIENTATION_DEFAULT)
|
||||||
? PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT
|
? \PHPExcel\Worksheet\PageSetup::ORIENTATION_PORTRAIT
|
||||||
: $this->getOrientation();
|
: $this->getOrientation();
|
||||||
}
|
}
|
||||||
// Override Paper Size
|
// Override Paper Size
|
||||||
|
|
|
@ -51,7 +51,7 @@ class mPDF extends Core implements \PHPExcel\Writer\IWriter
|
||||||
* Save Spreadsheet to file
|
* Save Spreadsheet to file
|
||||||
*
|
*
|
||||||
* @param string $pFilename Name of the file to save as
|
* @param string $pFilename Name of the file to save as
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename = null)
|
||||||
{
|
{
|
||||||
|
@ -63,12 +63,12 @@ class mPDF extends Core implements \PHPExcel\Writer\IWriter
|
||||||
// Check for paper size and page orientation
|
// Check for paper size and page orientation
|
||||||
if (is_null($this->getSheetIndex())) {
|
if (is_null($this->getSheetIndex())) {
|
||||||
$orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
$orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
||||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
== \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||||
$printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
$printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
||||||
$printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
|
$printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
|
||||||
} else {
|
} else {
|
||||||
$orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
$orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
||||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
== \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||||
$printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
$printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
||||||
$printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
$printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,8 @@ class mPDF extends Core implements \PHPExcel\Writer\IWriter
|
||||||
|
|
||||||
// Override Page Orientation
|
// Override Page Orientation
|
||||||
if (!is_null($this->getOrientation())) {
|
if (!is_null($this->getOrientation())) {
|
||||||
$orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT)
|
$orientation = ($this->getOrientation() == \PHPExcel\Worksheet\PageSetup::ORIENTATION_DEFAULT)
|
||||||
? PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT
|
? \PHPExcel\Worksheet\PageSetup::ORIENTATION_PORTRAIT
|
||||||
: $this->getOrientation();
|
: $this->getOrientation();
|
||||||
}
|
}
|
||||||
$orientation = strtoupper($orientation);
|
$orientation = strtoupper($orientation);
|
||||||
|
|
|
@ -52,7 +52,7 @@ class tcPDF extends Core implements \PHPExcel\Writer\IWriter
|
||||||
* Save Spreadsheet to file
|
* Save Spreadsheet to file
|
||||||
*
|
*
|
||||||
* @param string $pFilename Name of the file to save as
|
* @param string $pFilename Name of the file to save as
|
||||||
* @throws PHPExcel_Writer_Exception
|
* @throws \PHPExcel\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename = null)
|
||||||
{
|
{
|
||||||
|
@ -64,19 +64,19 @@ class tcPDF extends Core implements \PHPExcel\Writer\IWriter
|
||||||
// Check for paper size and page orientation
|
// Check for paper size and page orientation
|
||||||
if (is_null($this->getSheetIndex())) {
|
if (is_null($this->getSheetIndex())) {
|
||||||
$orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
$orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
||||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
== \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||||
$printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
$printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
||||||
$printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
|
$printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
|
||||||
} else {
|
} else {
|
||||||
$orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
$orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
||||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
== \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||||
$printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
$printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
||||||
$printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
$printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Override Page Orientation
|
// Override Page Orientation
|
||||||
if (!is_null($this->getOrientation())) {
|
if (!is_null($this->getOrientation())) {
|
||||||
$orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE)
|
$orientation = ($this->getOrientation() == \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE)
|
||||||
? 'L'
|
? 'L'
|
||||||
: 'P';
|
: 'P';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue