Another block of work on namespacing

This commit is contained in:
MarkBaker 2015-05-30 14:06:37 +01:00
parent 54d2f72a0a
commit ee04f30d67
44 changed files with 426 additions and 371 deletions

View File

@ -32,8 +32,8 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
/** /**
* Bind value to a cell * Bind value to a cell
* *
* @param PHPExcel_Cell $cell Cell to bind value to * @param \PHPExcel\Cell $cell Cell to bind value to
* @param mixed $value Value to bind in cell * @param mixed $value Value to bind in cell
* @return boolean * @return boolean
*/ */
public function bindValue(\PHPExcel\Cell $cell, $value = null) public function bindValue(\PHPExcel\Cell $cell, $value = null)
@ -47,7 +47,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
$dataType = parent::dataTypeForValue($value); $dataType = parent::dataTypeForValue($value);
// Style logic - strings // Style logic - strings
if ($dataType === DataType::TYPE_STRING && !$value instanceof PHPExcel_RichText) { if ($dataType === DataType::TYPE_STRING && !$value instanceof \PHPExcel\RichText) {
// Test for booleans using locale-setting // Test for booleans using locale-setting
if ($value == \PHPExcel\Calculation::getTRUE()) { if ($value == \PHPExcel\Calculation::getTRUE()) {
$cell->setValueExplicit(true, DataType::TYPE_BOOL); $cell->setValueExplicit(true, DataType::TYPE_BOOL);
@ -149,7 +149,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
} }
// Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10' // Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10'
if (($d = PHPExcel_Shared_Date::stringToExcel($value)) !== false) { if (($d = \PHPExcel\Shared\Date::stringToExcel($value)) !== false) {
// Convert value to number // Convert value to number
$cell->setValueExplicit($d, DataType::TYPE_NUMERIC); $cell->setValueExplicit($d, DataType::TYPE_NUMERIC);
// Determine style. Either there is a time part or not. Look for ':' // Determine style. Either there is a time part or not. Look for ':'
@ -165,7 +165,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
// Check for newline character "\n" // Check for newline character "\n"
if (strpos($value, "\n") !== false) { if (strpos($value, "\n") !== false) {
$value = PHPExcel_Shared_String::SanitizeUTF8($value); $value = \PHPExcel\Shared\String::SanitizeUTF8($value);
$cell->setValueExplicit($value, DataType::TYPE_STRING); $cell->setValueExplicit($value, DataType::TYPE_STRING);
// Set style // Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate()) $cell->getWorksheet()->getStyle($cell->getCoordinate())

View File

@ -67,7 +67,7 @@ class DataType
/** /**
* DataType for value * DataType for value
* *
* @deprecated Replaced by PHPExcel_Cell_IValueBinder infrastructure, will be removed in version 1.8.0 * @deprecated Replaced by \PHPExcel\Cell\IValueBinder infrastructure, will be removed in version 1.8.0
* @param mixed $pValue * @param mixed $pValue
* @return string * @return string
*/ */

View File

@ -146,7 +146,7 @@ class DataValidation
private $prompt = ''; private $prompt = '';
/** /**
* Create a new PHPExcel_Cell_DataValidation * Create a new DataValidation
*/ */
public function __construct() public function __construct()
{ {
@ -166,7 +166,7 @@ class DataValidation
* Set Formula 1 * Set Formula 1
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setFormula1($value = '') public function setFormula1($value = '')
{ {
@ -188,7 +188,7 @@ class DataValidation
* Set Formula 2 * Set Formula 2
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setFormula2($value = '') public function setFormula2($value = '')
{ {
@ -210,9 +210,9 @@ class DataValidation
* Set Type * Set Type
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setType($value = PHPExcel_Cell_DataValidation::TYPE_NONE) public function setType($value = self::TYPE_NONE)
{ {
$this->type = $value; $this->type = $value;
return $this; return $this;
@ -232,9 +232,9 @@ class DataValidation
* Set Error style * Set Error style
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setErrorStyle($value = PHPExcel_Cell_DataValidation::STYLE_STOP) public function setErrorStyle($value = self::STYLE_STOP)
{ {
$this->errorStyle = $value; $this->errorStyle = $value;
return $this; return $this;
@ -254,7 +254,7 @@ class DataValidation
* Set Operator * Set Operator
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setOperator($value = '') public function setOperator($value = '')
{ {
@ -276,7 +276,7 @@ class DataValidation
* Set Allow Blank * Set Allow Blank
* *
* @param boolean $value * @param boolean $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setAllowBlank($value = false) public function setAllowBlank($value = false)
{ {
@ -298,7 +298,7 @@ class DataValidation
* Set Show DropDown * Set Show DropDown
* *
* @param boolean $value * @param boolean $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setShowDropDown($value = false) public function setShowDropDown($value = false)
{ {
@ -320,7 +320,7 @@ class DataValidation
* Set Show InputMessage * Set Show InputMessage
* *
* @param boolean $value * @param boolean $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setShowInputMessage($value = false) public function setShowInputMessage($value = false)
{ {
@ -342,7 +342,7 @@ class DataValidation
* Set Show ErrorMessage * Set Show ErrorMessage
* *
* @param boolean $value * @param boolean $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setShowErrorMessage($value = false) public function setShowErrorMessage($value = false)
{ {
@ -364,7 +364,7 @@ class DataValidation
* Set Error title * Set Error title
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setErrorTitle($value = '') public function setErrorTitle($value = '')
{ {
@ -386,7 +386,7 @@ class DataValidation
* Set Error * Set Error
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setError($value = '') public function setError($value = '')
{ {
@ -408,7 +408,7 @@ class DataValidation
* Set Prompt title * Set Prompt title
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setPromptTitle($value = '') public function setPromptTitle($value = '')
{ {
@ -430,7 +430,7 @@ class DataValidation
* Set Prompt * Set Prompt
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_DataValidation * @return DataValidation
*/ */
public function setPrompt($value = '') public function setPrompt($value = '')
{ {
@ -448,8 +448,8 @@ class DataValidation
return md5( return md5(
$this->formula1 . $this->formula1 .
$this->formula2 . $this->formula2 .
$this->type = PHPExcel_Cell_DataValidation::TYPE_NONE . $this->type = self::TYPE_NONE .
$this->errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP . $this->errorStyle = self::STYLE_STOP .
$this->operator . $this->operator .
($this->allowBlank ? 't' : 'f') . ($this->allowBlank ? 't' : 'f') .
($this->showDropDown ? 't' : 'f') . ($this->showDropDown ? 't' : 'f') .

View File

@ -44,7 +44,7 @@ class Hyperlink
private $tooltip; private $tooltip;
/** /**
* Create a new PHPExcel_Cell_Hyperlink * Create a new Hyperlink
* *
* @param string $pUrl Url to link the cell to * @param string $pUrl Url to link the cell to
* @param string $pTooltip Tooltip to display on the hyperlink * @param string $pTooltip Tooltip to display on the hyperlink
@ -70,7 +70,7 @@ class Hyperlink
* Set URL * Set URL
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_Hyperlink * @return Hyperlink
*/ */
public function setUrl($value = '') public function setUrl($value = '')
{ {
@ -92,7 +92,7 @@ class Hyperlink
* Set tooltip * Set tooltip
* *
* @param string $value * @param string $value
* @return PHPExcel_Cell_Hyperlink * @return Hyperlink
*/ */
public function setTooltip($value = '') public function setTooltip($value = '')
{ {

View File

@ -32,7 +32,7 @@ interface IValueBinder
/** /**
* Bind value to a cell * Bind value to a cell
* *
* @param PHPExcel_Cell $cell Cell to bind value to * @param \PHPExcel\Cell $cell Cell to bind value to
* @param mixed $value Value to bind in cell * @param mixed $value Value to bind in cell
* @return boolean * @return boolean
*/ */

View File

@ -359,7 +359,7 @@ class Axis extends Properties
* *
* @param int $shadow_presets * @param int $shadow_presets
* *
* @return PHPExcel_Chart_Axis * @return Axis
*/ */
private function setShadowPresetsProperties($shadow_presets) private function setShadowPresetsProperties($shadow_presets)
{ {
@ -375,7 +375,7 @@ class Axis extends Properties
* @param array $properties_map * @param array $properties_map
* @param * $reference * @param * $reference
* *
* @return PHPExcel_Chart_Axis * @return Axis
*/ */
private function setShadowProperiesMapValues(array $properties_map, &$reference = null) private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
{ {
@ -407,7 +407,7 @@ class Axis extends Properties
* @param int $alpha * @param int $alpha
* @param string $type * @param string $type
* *
* @return PHPExcel_Chart_Axis * @return Axis
*/ */
private function setShadowColor($color, $alpha, $type) private function setShadowColor($color, $alpha, $type)
{ {
@ -421,7 +421,7 @@ class Axis extends Properties
* *
* @param float $blur * @param float $blur
* *
* @return PHPExcel_Chart_Axis * @return Axis
*/ */
private function setShadowBlur($blur) private function setShadowBlur($blur)
{ {
@ -437,7 +437,7 @@ class Axis extends Properties
* *
* @param int $angle * @param int $angle
* *
* @return PHPExcel_Chart_Axis * @return Axis
*/ */
private function setShadowAngle($angle) private function setShadowAngle($angle)
{ {
@ -453,7 +453,7 @@ class Axis extends Properties
* *
* @param float $distance * @param float $distance
* *
* @return PHPExcel_Chart_Axis * @return Axis
*/ */
private function setShadowDistance($distance) private function setShadowDistance($distance)
{ {
@ -512,7 +512,7 @@ class Axis extends Properties
* *
* @param float $size * @param float $size
* *
* @return PHPExcel_Chart_Axis * @return Axis
*/ */
private function setGlowSize($size) private function setGlowSize($size)
{ {
@ -530,7 +530,7 @@ class Axis extends Properties
* @param int $alpha * @param int $alpha
* @param string $type * @param string $type
* *
* @return PHPExcel_Chart_Axis * @return Axis
*/ */
private function setGlowColor($color, $alpha, $type) private function setGlowColor($color, $alpha, $type)
{ {

View File

@ -102,14 +102,14 @@ class DataSeries
/** /**
* Plot Label * Plot Label
* *
* @var array of PHPExcel_Chart_DataSeriesValues * @var array of DataSeriesValues
*/ */
private $plotLabel = array(); private $plotLabel = array();
/** /**
* Plot Category * Plot Category
* *
* @var array of PHPExcel_Chart_DataSeriesValues * @var array of DataSeriesValues
*/ */
private $plotCategory = array(); private $plotCategory = array();
@ -123,12 +123,12 @@ class DataSeries
/** /**
* Plot Values * Plot Values
* *
* @var array of PHPExcel_Chart_DataSeriesValues * @var array of DataSeriesValues
*/ */
private $plotValues = array(); private $plotValues = array();
/** /**
* Create a new PHPExcel_Chart_DataSeries * Create a new DataSeries
*/ */
public function __construct($plotType = null, $plotGrouping = null, $plotOrder = array(), $plotLabel = array(), $plotCategory = array(), $plotValues = array(), $plotDirection = null, $smoothLine = null, $plotStyle = null) public function __construct($plotType = null, $plotGrouping = null, $plotOrder = array(), $plotLabel = array(), $plotCategory = array(), $plotValues = array(), $plotDirection = null, $smoothLine = null, $plotStyle = null)
{ {
@ -138,12 +138,12 @@ class DataSeries
$keys = array_keys($plotValues); $keys = array_keys($plotValues);
$this->plotValues = $plotValues; $this->plotValues = $plotValues;
if ((count($plotLabel) == 0) || (is_null($plotLabel[$keys[0]]))) { if ((count($plotLabel) == 0) || (is_null($plotLabel[$keys[0]]))) {
$plotLabel[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); $plotLabel[$keys[0]] = new DataSeriesValues();
} }
$this->plotLabel = $plotLabel; $this->plotLabel = $plotLabel;
if ((count($plotCategory) == 0) || (is_null($plotCategory[$keys[0]]))) { if ((count($plotCategory) == 0) || (is_null($plotCategory[$keys[0]]))) {
$plotCategory[$keys[0]] = new PHPExcel_Chart_DataSeriesValues(); $plotCategory[$keys[0]] = new DataSeriesValues();
} }
$this->plotCategory = $plotCategory; $this->plotCategory = $plotCategory;
$this->smoothLine = $smoothLine; $this->smoothLine = $smoothLine;
@ -169,7 +169,7 @@ class DataSeries
* Set Plot Type * Set Plot Type
* *
* @param string $plotType * @param string $plotType
* @return PHPExcel_Chart_DataSeries * @return DataSeries
*/ */
public function setPlotType($plotType = '') public function setPlotType($plotType = '')
{ {
@ -191,7 +191,7 @@ class DataSeries
* Set Plot Grouping Type * Set Plot Grouping Type
* *
* @param string $groupingType * @param string $groupingType
* @return PHPExcel_Chart_DataSeries * @return DataSeries
*/ */
public function setPlotGrouping($groupingType = null) public function setPlotGrouping($groupingType = null)
{ {
@ -213,7 +213,7 @@ class DataSeries
* Set Plot Direction * Set Plot Direction
* *
* @param string $plotDirection * @param string $plotDirection
* @return PHPExcel_Chart_DataSeries * @return DataSeries
*/ */
public function setPlotDirection($plotDirection = null) public function setPlotDirection($plotDirection = null)
{ {
@ -234,7 +234,7 @@ class DataSeries
/** /**
* Get Plot Labels * Get Plot Labels
* *
* @return array of PHPExcel_Chart_DataSeriesValues * @return array of DataSeriesValues
*/ */
public function getPlotLabels() public function getPlotLabels()
{ {
@ -244,7 +244,7 @@ class DataSeries
/** /**
* Get Plot Label by Index * Get Plot Label by Index
* *
* @return PHPExcel_Chart_DataSeriesValues * @return DataSeriesValues
*/ */
public function getPlotLabelByIndex($index) public function getPlotLabelByIndex($index)
{ {
@ -260,7 +260,7 @@ class DataSeries
/** /**
* Get Plot Categories * Get Plot Categories
* *
* @return array of PHPExcel_Chart_DataSeriesValues * @return array of DataSeriesValues
*/ */
public function getPlotCategories() public function getPlotCategories()
{ {
@ -270,7 +270,7 @@ class DataSeries
/** /**
* Get Plot Category by Index * Get Plot Category by Index
* *
* @return PHPExcel_Chart_DataSeriesValues * @return DataSeriesValues
*/ */
public function getPlotCategoryByIndex($index) public function getPlotCategoryByIndex($index)
{ {
@ -297,7 +297,7 @@ class DataSeries
* Set Plot Style * Set Plot Style
* *
* @param string $plotStyle * @param string $plotStyle
* @return PHPExcel_Chart_DataSeries * @return DataSeries
*/ */
public function setPlotStyle($plotStyle = null) public function setPlotStyle($plotStyle = null)
{ {
@ -308,7 +308,7 @@ class DataSeries
/** /**
* Get Plot Values * Get Plot Values
* *
* @return array of PHPExcel_Chart_DataSeriesValues * @return array of DataSeriesValues
*/ */
public function getPlotValues() public function getPlotValues()
{ {
@ -318,7 +318,7 @@ class DataSeries
/** /**
* Get Plot Values by Index * Get Plot Values by Index
* *
* @return PHPExcel_Chart_DataSeriesValues * @return DataSeriesValues
*/ */
public function getPlotValuesByIndex($index) public function getPlotValuesByIndex($index)
{ {
@ -355,7 +355,7 @@ class DataSeries
* Set Smooth Line * Set Smooth Line
* *
* @param boolean $smoothLine * @param boolean $smoothLine
* @return PHPExcel_Chart_DataSeries * @return DataSeries
*/ */
public function setSmoothLine($smoothLine = true) public function setSmoothLine($smoothLine = true)
{ {
@ -363,7 +363,7 @@ class DataSeries
return $this; return $this;
} }
public function refresh(PHPExcel_Worksheet $worksheet) public function refresh(\PHPExcel\Worksheet $worksheet)
{ {
foreach ($this->plotValues as $plotValues) { foreach ($this->plotValues as $plotValues) {
if ($plotValues !== null) { if ($plotValues !== null) {

View File

@ -81,7 +81,7 @@ class DataSeriesValues
private $dataValues = array(); private $dataValues = array();
/** /**
* Create a new PHPExcel_Chart_DataSeriesValues object * Create a new DataSeriesValues object
*/ */
public function __construct($dataType = self::DATASERIES_TYPE_NUMBER, $dataSource = null, $formatCode = null, $pointCount = 0, $dataValues = array(), $marker = null) public function __construct($dataType = self::DATASERIES_TYPE_NUMBER, $dataSource = null, $formatCode = null, $pointCount = 0, $dataValues = array(), $marker = null)
{ {
@ -108,16 +108,17 @@ class DataSeriesValues
* *
* @param string $dataType Datatype of this data series * @param string $dataType Datatype of this data series
* Typical values are: * Typical values are:
* PHPExcel_Chart_DataSeriesValues::DATASERIES_TYPE_STRING * \PHPExcel\Chart\DataSeriesValues::DATASERIES_TYPE_STRING
* Normally used for axis point values * Normally used for axis point values
* PHPExcel_Chart_DataSeriesValues::DATASERIES_TYPE_NUMBER * \PHPExcel\Chart\DataSeriesValues::DATASERIES_TYPE_NUMBER
* Normally used for chart data values * Normally used for chart data values
* @return PHPExcel_Chart_DataSeriesValues * @return DataSeriesValues
* @throws Exception
*/ */
public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER) public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER)
{ {
if (!in_array($dataType, self::$dataTypeValues)) { if (!in_array($dataType, self::$dataTypeValues)) {
throw new PHPExcel_Chart_Exception('Invalid datatype for chart data series values'); throw new Exception('Invalid datatype for chart data series values');
} }
$this->dataType = $dataType; $this->dataType = $dataType;
@ -138,7 +139,7 @@ class DataSeriesValues
* Set Series Data Source (formula) * Set Series Data Source (formula)
* *
* @param string $dataSource * @param string $dataSource
* @return PHPExcel_Chart_DataSeriesValues * @return DataSeriesValues
*/ */
public function setDataSource($dataSource = null, $refreshDataValues = true) public function setDataSource($dataSource = null, $refreshDataValues = true)
{ {
@ -165,7 +166,7 @@ class DataSeriesValues
* Set Point Marker * Set Point Marker
* *
* @param string $marker * @param string $marker
* @return PHPExcel_Chart_DataSeriesValues * @return DataSeriesValues
*/ */
public function setPointMarker($marker = null) public function setPointMarker($marker = null)
{ {
@ -188,7 +189,7 @@ class DataSeriesValues
* Set Series Format Code * Set Series Format Code
* *
* @param string $formatCode * @param string $formatCode
* @return PHPExcel_Chart_DataSeriesValues * @return DataSeriesValues
*/ */
public function setFormatCode($formatCode = null) public function setFormatCode($formatCode = null)
{ {
@ -267,11 +268,11 @@ class DataSeriesValues
* @param boolean $refreshDataSource * @param boolean $refreshDataSource
* TRUE - refresh the value of dataSource based on the values of $dataValues * TRUE - refresh the value of dataSource based on the values of $dataValues
* FALSE - don't change the value of dataSource * FALSE - don't change the value of dataSource
* @return PHPExcel_Chart_DataSeriesValues * @return DataSeriesValues
*/ */
public function setDataValues($dataValues = array(), $refreshDataSource = true) public function setDataValues($dataValues = array(), $refreshDataSource = true)
{ {
$this->dataValues = PHPExcel_Calculation_Functions::flattenArray($dataValues); $this->dataValues = \PHPExcel\Calculation\Functions::flattenArray($dataValues);
$this->pointCount = count($dataValues); $this->pointCount = count($dataValues);
if ($refreshDataSource) { if ($refreshDataSource) {
@ -286,11 +287,11 @@ class DataSeriesValues
return $var !== null; return $var !== null;
} }
public function refresh(PHPExcel_Worksheet $worksheet, $flatten = true) public function refresh(\PHPExcel\Worksheet $worksheet, $flatten = true)
{ {
if ($this->dataSource !== null) { if ($this->dataSource !== null) {
$calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent()); $calcEngine = \PHPExcel\Calculation::getInstance($worksheet->getParent());
$newDataValues = PHPExcel_Calculation::unwrapResult( $newDataValues = \PHPExcel\Calculation::unwrapResult(
$calcEngine->_calculateFormulaValue( $calcEngine->_calculateFormulaValue(
'='.$this->dataSource, '='.$this->dataSource,
null, null,
@ -298,7 +299,7 @@ class DataSeriesValues
) )
); );
if ($flatten) { if ($flatten) {
$this->dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues); $this->dataValues = \PHPExcel\Calculation\Functions::flattenArray($newDataValues);
foreach ($this->dataValues as &$dataValue) { foreach ($this->dataValues as &$dataValue) {
if ((!empty($dataValue)) && ($dataValue[0] == '#')) { if ((!empty($dataValue)) && ($dataValue[0] == '#')) {
$dataValue = 0.0; $dataValue = 0.0;
@ -311,9 +312,9 @@ class DataSeriesValues
list(, $cellRange) = $cellRange; list(, $cellRange) = $cellRange;
} }
$dimensions = PHPExcel_Cell::rangeDimension(str_replace('$', '', $cellRange)); $dimensions = \PHPExcel\Cell::rangeDimension(str_replace('$', '', $cellRange));
if (($dimensions[0] == 1) || ($dimensions[1] == 1)) { if (($dimensions[0] == 1) || ($dimensions[1] == 1)) {
$this->dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues); $this->dataValues = \PHPExcel\Calculation\Functions::flattenArray($newDataValues);
} else { } else {
$newArray = array_values(array_shift($newDataValues)); $newArray = array_values(array_shift($newDataValues));
foreach ($newArray as $i => $newDataSet) { foreach ($newArray as $i => $newDataSet) {

View File

@ -96,7 +96,7 @@ class GridLines extends Properties
/** /**
* Change Object State to True * Change Object State to True
* *
* @return PHPExcel_Chart_GridLines * @return GridLines
*/ */
private function activateObject() private function activateObject()
@ -243,7 +243,7 @@ class GridLines extends Properties
* *
* @param float $size * @param float $size
* *
* @return PHPExcel_Chart_GridLines * @return GridLines
*/ */
private function setGlowSize($size) private function setGlowSize($size)
@ -260,7 +260,7 @@ class GridLines extends Properties
* @param int $alpha * @param int $alpha
* @param string $type * @param string $type
* *
* @return PHPExcel_Chart_GridLines * @return GridLines
*/ */
private function setGlowColor($color, $alpha, $type) private function setGlowColor($color, $alpha, $type)
@ -324,7 +324,7 @@ class GridLines extends Properties
* *
* @param int $shadow_presets * @param int $shadow_presets
* *
* @return PHPExcel_Chart_GridLines * @return GridLines
*/ */
private function setShadowPresetsProperties($shadow_presets) private function setShadowPresetsProperties($shadow_presets)
@ -341,7 +341,7 @@ class GridLines extends Properties
* @param array $properties_map * @param array $properties_map
* @param * $reference * @param * $reference
* *
* @return PHPExcel_Chart_GridLines * @return GridLines
*/ */
private function setShadowProperiesMapValues(array $properties_map, &$reference = null) private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
@ -373,7 +373,7 @@ class GridLines extends Properties
* @param string $color * @param string $color
* @param int $alpha * @param int $alpha
* @param string $type * @param string $type
* @return PHPExcel_Chart_GridLines * @return GridLines
*/ */
private function setShadowColor($color, $alpha, $type) private function setShadowColor($color, $alpha, $type)
{ {
@ -395,7 +395,7 @@ class GridLines extends Properties
* *
* @param float $blur * @param float $blur
* *
* @return PHPExcel_Chart_GridLines * @return GridLines
*/ */
private function setShadowBlur($blur) private function setShadowBlur($blur)
{ {
@ -410,7 +410,7 @@ class GridLines extends Properties
* Set Shadow Angle * Set Shadow Angle
* *
* @param int $angle * @param int $angle
* @return PHPExcel_Chart_GridLines * @return GridLines
*/ */
private function setShadowAngle($angle) private function setShadowAngle($angle)
@ -426,7 +426,7 @@ class GridLines extends Properties
* Set Shadow Distance * Set Shadow Distance
* *
* @param float $distance * @param float $distance
* @return PHPExcel_Chart_GridLines * @return GridLines
*/ */
private function setShadowDistance($distance) private function setShadowDistance($distance)
{ {

View File

@ -135,7 +135,7 @@ class Layout
/** /**
* Create a new PHPExcel_Chart_Layout * Create a new Layout
*/ */
public function __construct($layout = array()) public function __construct($layout = array())
{ {
@ -176,7 +176,7 @@ class Layout
* Set Layout Target * Set Layout Target
* *
* @param Layout Target $value * @param Layout Target $value
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setLayoutTarget($value) public function setLayoutTarget($value)
{ {
@ -198,7 +198,7 @@ class Layout
* Set X-Mode * Set X-Mode
* *
* @param X-Mode $value * @param X-Mode $value
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setXMode($value) public function setXMode($value)
{ {
@ -220,7 +220,7 @@ class Layout
* Set Y-Mode * Set Y-Mode
* *
* @param Y-Mode $value * @param Y-Mode $value
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setYMode($value) public function setYMode($value)
{ {
@ -242,7 +242,7 @@ class Layout
* Set X-Position * Set X-Position
* *
* @param X-Position $value * @param X-Position $value
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setXPosition($value) public function setXPosition($value)
{ {
@ -264,7 +264,7 @@ class Layout
* Set Y-Position * Set Y-Position
* *
* @param Y-Position $value * @param Y-Position $value
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setYPosition($value) public function setYPosition($value)
{ {
@ -286,7 +286,7 @@ class Layout
* Set Width * Set Width
* *
* @param Width $value * @param Width $value
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setWidth($value) public function setWidth($value)
{ {
@ -308,7 +308,7 @@ class Layout
* Set Height * Set Height
* *
* @param Height $value * @param Height $value
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setHeight($value) public function setHeight($value)
{ {
@ -332,7 +332,7 @@ class Layout
* Specifies that legend keys should be shown in data labels. * Specifies that legend keys should be shown in data labels.
* *
* @param boolean $value Show legend key * @param boolean $value Show legend key
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setShowLegendKey($value) public function setShowLegendKey($value)
{ {
@ -355,7 +355,7 @@ class Layout
* Specifies that the value should be shown in data labels. * Specifies that the value should be shown in data labels.
* *
* @param boolean $value Show val * @param boolean $value Show val
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setShowVal($value) public function setShowVal($value)
{ {
@ -378,7 +378,7 @@ class Layout
* Specifies that the category name should be shown in data labels. * Specifies that the category name should be shown in data labels.
* *
* @param boolean $value Show cat name * @param boolean $value Show cat name
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setShowCatName($value) public function setShowCatName($value)
{ {
@ -401,7 +401,7 @@ class Layout
* Specifies that the series name should be shown in data labels. * Specifies that the series name should be shown in data labels.
* *
* @param boolean $value Show series name * @param boolean $value Show series name
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setShowSerName($value) public function setShowSerName($value)
{ {
@ -424,7 +424,7 @@ class Layout
* Specifies that the percentage should be shown in data labels. * Specifies that the percentage should be shown in data labels.
* *
* @param boolean $value Show percentage * @param boolean $value Show percentage
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setShowPercent($value) public function setShowPercent($value)
{ {
@ -447,7 +447,7 @@ class Layout
* Specifies that the bubble size should be shown in data labels. * Specifies that the bubble size should be shown in data labels.
* *
* @param boolean $value Show bubble size * @param boolean $value Show bubble size
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setShowBubbleSize($value) public function setShowBubbleSize($value)
{ {
@ -470,7 +470,7 @@ class Layout
* Specifies that leader lines should be shown in data labels. * Specifies that leader lines should be shown in data labels.
* *
* @param boolean $value Show leader lines * @param boolean $value Show leader lines
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function setShowLeaderLines($value) public function setShowLeaderLines($value)
{ {

View File

@ -69,15 +69,15 @@ class Legend
/** /**
* Legend Layout * Legend Layout
* *
* @var PHPExcel_Chart_Layout * @var Layout
*/ */
private $layout = null; private $layout = null;
/** /**
* Create a new PHPExcel_Chart_Legend * Create a new Legend
*/ */
public function __construct($position = self::POSITION_RIGHT, PHPExcel_Chart_Layout $layout = null, $overlay = false) public function __construct($position = self::POSITION_RIGHT, Layout $layout = null, $overlay = false)
{ {
$this->setPosition($position); $this->setPosition($position);
$this->layout = $layout; $this->layout = $layout;
@ -163,7 +163,7 @@ class Legend
/** /**
* Get Layout * Get Layout
* *
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function getLayout() public function getLayout()
{ {

View File

@ -32,19 +32,19 @@ class PlotArea
/** /**
* PlotArea Layout * PlotArea Layout
* *
* @var PHPExcel_Chart_Layout * @var Layout
*/ */
private $layout = null; private $layout = null;
/** /**
* Plot Series * Plot Series
* *
* @var array of PHPExcel_Chart_DataSeries * @var array of DataSeries
*/ */
private $plotSeries = array(); private $plotSeries = array();
/** /**
* Create a new PHPExcel_Chart_PlotArea * Create a new PlotArea
*/ */
public function __construct(Layout $layout = null, $plotSeries = array()) public function __construct(Layout $layout = null, $plotSeries = array())
{ {
@ -55,7 +55,7 @@ class PlotArea
/** /**
* Get Layout * Get Layout
* *
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function getLayout() public function getLayout()
{ {
@ -65,7 +65,7 @@ class PlotArea
/** /**
* Get Number of Plot Groups * Get Number of Plot Groups
* *
* @return array of PHPExcel_Chart_DataSeries * @return array of DataSeries
*/ */
public function getPlotGroupCount() public function getPlotGroupCount()
{ {
@ -89,7 +89,7 @@ class PlotArea
/** /**
* Get Plot Series * Get Plot Series
* *
* @return array of PHPExcel_Chart_DataSeries * @return array of DataSeries
*/ */
public function getPlotGroup() public function getPlotGroup()
{ {
@ -99,7 +99,7 @@ class PlotArea
/** /**
* Get Plot Series by Index * Get Plot Series by Index
* *
* @return PHPExcel_Chart_DataSeries * @return DataSeries
*/ */
public function getPlotGroupByIndex($index) public function getPlotGroupByIndex($index)
{ {
@ -109,8 +109,8 @@ class PlotArea
/** /**
* Set Plot Series * Set Plot Series
* *
* @param [PHPExcel_Chart_DataSeries] * @param DataSeries[]
* @return PHPExcel_Chart_PlotArea * @return PlotArea
*/ */
public function setPlotSeries($plotSeries = array()) public function setPlotSeries($plotSeries = array())
{ {
@ -119,7 +119,7 @@ class PlotArea
return $this; return $this;
} }
public function refresh(PHPExcel_Worksheet $worksheet) public function refresh(\PHPExcel\Worksheet $worksheet)
{ {
foreach ($this->plotSeries as $plotSeries) { foreach ($this->plotSeries as $plotSeries) {
$plotSeries->refresh($worksheet); $plotSeries->refresh($worksheet);

View File

@ -2,7 +2,7 @@
namespace PHPExcel\Chart\Renderer; namespace PHPExcel\Chart\Renderer;
require_once(PHPExcel_Settings::getChartRendererPath().'/jpgraph.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'/jpgraph.php');
/** /**
* PHPExcel_Chart_Renderer_jpgraph * PHPExcel_Chart_Renderer_jpgraph
@ -113,7 +113,7 @@ class jpgraph
} else { } else {
// Format labels according to any formatting code // Format labels according to any formatting code
if (!is_null($datasetLabelFormatCode)) { if (!is_null($datasetLabelFormatCode)) {
$datasetLabels[$i] = PHPExcel_Style_NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode); $datasetLabels[$i] = \PHPExcel\Style\NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode);
} }
} }
++$testCurrentIndex; ++$testCurrentIndex;
@ -565,7 +565,7 @@ class jpgraph
private function renderAreaChart($groupCount, $dimensions = '2d') private function renderAreaChart($groupCount, $dimensions = '2d')
{ {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea(); $this->renderCartesianPlotArea();
@ -577,7 +577,7 @@ class jpgraph
private function renderLineChart($groupCount, $dimensions = '2d') private function renderLineChart($groupCount, $dimensions = '2d')
{ {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea(); $this->renderCartesianPlotArea();
@ -589,7 +589,7 @@ class jpgraph
private function renderBarChart($groupCount, $dimensions = '2d') private function renderBarChart($groupCount, $dimensions = '2d')
{ {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_bar.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php');
$this->renderCartesianPlotArea(); $this->renderCartesianPlotArea();
@ -601,9 +601,9 @@ class jpgraph
private function renderScatterChart($groupCount) private function renderScatterChart($groupCount)
{ {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_regstat.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_regstat.php');
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea('linlin'); $this->renderCartesianPlotArea('linlin');
@ -615,7 +615,7 @@ class jpgraph
private function renderBubbleChart($groupCount) private function renderBubbleChart($groupCount)
{ {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
$this->renderCartesianPlotArea('linlin'); $this->renderCartesianPlotArea('linlin');
@ -627,9 +627,9 @@ class jpgraph
private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false) private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false)
{ {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_pie.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_pie.php');
if ($dimensions == '3d') { if ($dimensions == '3d') {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_pie3d.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_pie3d.php');
} }
$this->renderPiePlotArea($doughnut); $this->renderPiePlotArea($doughnut);
@ -704,7 +704,7 @@ class jpgraph
private function renderRadarChart($groupCount) private function renderRadarChart($groupCount)
{ {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_radar.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_radar.php');
$this->renderRadarPlotArea(); $this->renderRadarPlotArea();
@ -716,7 +716,7 @@ class jpgraph
private function renderStockChart($groupCount) private function renderStockChart($groupCount)
{ {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_stock.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_stock.php');
$this->renderCartesianPlotArea('intint'); $this->renderCartesianPlotArea('intint');
@ -728,7 +728,7 @@ class jpgraph
private function renderContourChart($groupCount, $dimensions) private function renderContourChart($groupCount, $dimensions)
{ {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_contour.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_contour.php');
$this->renderCartesianPlotArea('intint'); $this->renderCartesianPlotArea('intint');
@ -740,11 +740,11 @@ class jpgraph
private function renderCombinationChart($groupCount, $dimensions, $outputDestination) private function renderCombinationChart($groupCount, $dimensions, $outputDestination)
{ {
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_bar.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php');
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_regstat.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_regstat.php');
require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php'); require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea(); $this->renderCartesianPlotArea();
@ -875,11 +875,11 @@ class jpgraph
/** /**
* Create a new PHPExcel_Chart_Renderer_jpgraph * Create a new jpgraph
*/ */
public function __construct(PHPExcel_Chart $chart) public function __construct(\PHPExcel\Chart $chart)
{ {
$this->graph = null; $this->graph = null;
$this->chart = $chart; $this->chart = $chart;
} }
} }

View File

@ -40,12 +40,12 @@ class Title
/** /**
* Title Layout * Title Layout
* *
* @var PHPExcel_Chart_Layout * @var Layout
*/ */
private $layout = null; private $layout = null;
/** /**
* Create a new PHPExcel_Chart_Title * Create a new Title
*/ */
public function __construct($caption = null, Layout $layout = null) public function __construct($caption = null, Layout $layout = null)
{ {
@ -67,7 +67,7 @@ class Title
* Set caption * Set caption
* *
* @param string $caption * @param string $caption
* @return PHPExcel_Chart_Title * @return Title
*/ */
public function setCaption($caption = null) public function setCaption($caption = null)
{ {
@ -79,7 +79,7 @@ class Title
/** /**
* Get Layout * Get Layout
* *
* @return PHPExcel_Chart_Layout * @return Layout
*/ */
public function getLayout() public function getLayout()
{ {

View File

@ -147,7 +147,7 @@ class Properties
* Set Creator * Set Creator
* *
* @param string $pValue * @param string $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setCreator($pValue = '') public function setCreator($pValue = '')
{ {
@ -169,7 +169,7 @@ class Properties
* Set Last Modified By * Set Last Modified By
* *
* @param string $pValue * @param string $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setLastModifiedBy($pValue = '') public function setLastModifiedBy($pValue = '')
{ {
@ -191,7 +191,7 @@ class Properties
* Set Created * Set Created
* *
* @param datetime $pValue * @param datetime $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setCreated($pValue = null) public function setCreated($pValue = null)
{ {
@ -223,7 +223,7 @@ class Properties
* Set Modified * Set Modified
* *
* @param datetime $pValue * @param datetime $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setModified($pValue = null) public function setModified($pValue = null)
{ {
@ -255,7 +255,7 @@ class Properties
* Set Title * Set Title
* *
* @param string $pValue * @param string $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setTitle($pValue = '') public function setTitle($pValue = '')
{ {
@ -277,7 +277,7 @@ class Properties
* Set Description * Set Description
* *
* @param string $pValue * @param string $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setDescription($pValue = '') public function setDescription($pValue = '')
{ {
@ -299,7 +299,7 @@ class Properties
* Set Subject * Set Subject
* *
* @param string $pValue * @param string $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setSubject($pValue = '') public function setSubject($pValue = '')
{ {
@ -321,7 +321,7 @@ class Properties
* Set Keywords * Set Keywords
* *
* @param string $pValue * @param string $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setKeywords($pValue = '') public function setKeywords($pValue = '')
{ {
@ -343,7 +343,7 @@ class Properties
* Set Category * Set Category
* *
* @param string $pValue * @param string $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setCategory($pValue = '') public function setCategory($pValue = '')
{ {
@ -365,7 +365,7 @@ class Properties
* Set Company * Set Company
* *
* @param string $pValue * @param string $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setCompany($pValue = '') public function setCompany($pValue = '')
{ {
@ -387,7 +387,7 @@ class Properties
* Set Manager * Set Manager
* *
* @param string $pValue * @param string $pValue
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setManager($pValue = '') public function setManager($pValue = '')
{ {
@ -455,7 +455,7 @@ class Properties
* 's' : String * 's' : String
* 'd' : Date/Time * 'd' : Date/Time
* 'b' : Boolean * 'b' : Boolean
* @return PHPExcel_DocumentProperties * @return Properties
*/ */
public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null) public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null)
{ {

View File

@ -97,7 +97,7 @@ class Security
* Set LockRevision * Set LockRevision
* *
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_DocumentSecurity * @return Security
*/ */
public function setLockRevision($pValue = false) public function setLockRevision($pValue = false)
{ {
@ -119,7 +119,7 @@ class Security
* Set LockStructure * Set LockStructure
* *
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_DocumentSecurity * @return Security
*/ */
public function setLockStructure($pValue = false) public function setLockStructure($pValue = false)
{ {
@ -141,7 +141,7 @@ class Security
* Set LockWindows * Set LockWindows
* *
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_DocumentSecurity * @return Security
*/ */
public function setLockWindows($pValue = false) public function setLockWindows($pValue = false)
{ {
@ -164,12 +164,12 @@ class Security
* *
* @param string $pValue * @param string $pValue
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
* @return PHPExcel_DocumentSecurity * @return Security
*/ */
public function setRevisionsPassword($pValue = '', $pAlreadyHashed = false) public function setRevisionsPassword($pValue = '', $pAlreadyHashed = false)
{ {
if (!$pAlreadyHashed) { if (!$pAlreadyHashed) {
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); $pValue = \PHPExcel\Shared\PasswordHasher::hashPassword($pValue);
} }
$this->revisionsPassword = $pValue; $this->revisionsPassword = $pValue;
return $this; return $this;
@ -190,12 +190,12 @@ class Security
* *
* @param string $pValue * @param string $pValue
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
* @return PHPExcel_DocumentSecurity * @return Security
*/ */
public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false) public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false)
{ {
if (!$pAlreadyHashed) { if (!$pAlreadyHashed) {
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); $pValue = \PHPExcel\Shared\PasswordHasher::hashPassword($pValue);
} }
$this->workbookPassword = $pValue; $this->workbookPassword = $pValue;
return $this; return $this;

View File

@ -2,6 +2,31 @@
namespace PHPExcel\Helper; namespace PHPExcel\Helper;
/**
* PHPExcel_Helper_HTML
*
* Copyright (c) 2006 - 2015 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class HTML class HTML
{ {
protected static $colourMap = [ protected static $colourMap = [
@ -598,7 +623,7 @@ class HTML
// Discard excess white space // Discard excess white space
$dom->preserveWhiteSpace = false; $dom->preserveWhiteSpace = false;
$this->richTextObject = new PHPExcel_RichText(); $this->richTextObject = new \PHPExcel\RichText();
$this->parseElements($dom); $this->parseElements($dom);
return $this->richTextObject; return $this->richTextObject;
} }
@ -618,7 +643,7 @@ class HTML
$richtextRun->getFont()->setSize($this->size); $richtextRun->getFont()->setSize($this->size);
} }
if ($this->color) { if ($this->color) {
$richtextRun->getFont()->setColor(new PHPExcel_Style_Color('ff' . $this->color)); $richtextRun->getFont()->setColor(new \PHPExcel\Style\Color('ff' . $this->color));
} }
if ($this->bold) { if ($this->bold) {
$richtextRun->getFont()->setBold(true); $richtextRun->getFont()->setBold(true);
@ -627,7 +652,7 @@ class HTML
$richtextRun->getFont()->setItalic(true); $richtextRun->getFont()->setItalic(true);
} }
if ($this->underline) { if ($this->underline) {
$richtextRun->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); $richtextRun->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE);
} }
if ($this->superscript) { if ($this->superscript) {
$richtextRun->getFont()->setSuperScript(true); $richtextRun->getFont()->setSuperScript(true);

View File

@ -38,14 +38,14 @@ interface ITextElement
* Set text * Set text
* *
* @param $pText string Text * @param $pText string Text
* @return PHPExcel_RichText_ITextElement * @return ITextElement
*/ */
public function setText($pText = ''); public function setText($pText = '');
/** /**
* Get font * Get font
* *
* @return PHPExcel_Style_Font * @return \PHPExcel\Style\Font
*/ */
public function getFont(); public function getFont();

View File

@ -30,12 +30,12 @@ class Run extends TextElement implements ITextElement
/** /**
* Font * Font
* *
* @var PHPExcel_Style_Font * @var \PHPExcel\Style\Font
*/ */
private $font; private $font;
/** /**
* Create a new PHPExcel_RichText_Run instance * Create a new Run instance
* *
* @param string $pText Text * @param string $pText Text
*/ */
@ -43,13 +43,13 @@ class Run extends TextElement implements ITextElement
{ {
// Initialise variables // Initialise variables
$this->setText($pText); $this->setText($pText);
$this->font = new PHPExcel_Style_Font(); $this->font = new \PHPExcel\Style\Font();
} }
/** /**
* Get font * Get font
* *
* @return PHPExcel_Style_Font * @return \PHPExcel\Style\Font
*/ */
public function getFont() public function getFont()
{ {
@ -59,11 +59,11 @@ class Run extends TextElement implements ITextElement
/** /**
* Set font * Set font
* *
* @param PHPExcel_Style_Font $pFont Font * @param \PHPExcel\Style\Font $pFont Font
* @throws PHPExcel_Exception * @throws \PHPExcel\Exception
* @return PHPExcel_RichText_ITextElement * @return ITextElement
*/ */
public function setFont(PHPExcel_Style_Font $pFont = null) public function setFont(\PHPExcel\Style\Font $pFont = null)
{ {
$this->font = $pFont; $this->font = $pFont;
return $this; return $this;

View File

@ -35,7 +35,7 @@ class TextElement implements ITextElement
private $text; private $text;
/** /**
* Create a new PHPExcel_RichText_TextElement instance * Create a new TextElement instance
* *
* @param string $pText Text * @param string $pText Text
*/ */
@ -58,8 +58,8 @@ class TextElement implements ITextElement
/** /**
* Set text * Set text
* *
* @param $pText string Text * @param $pText string Text
* @return PHPExcel_RichText_ITextElement * @return ITextElement
*/ */
public function setText($pText = '') public function setText($pText = '')
{ {
@ -70,7 +70,7 @@ class TextElement implements ITextElement
/** /**
* Get font * Get font
* *
* @return PHPExcel_Style_Font * @return \PHPExcel\Style\Font
*/ */
public function getFont() public function getFont()
{ {

View File

@ -35,7 +35,7 @@ class CodePage
* *
* @param integer $codePage Microsoft Code Page Indentifier * @param integer $codePage Microsoft Code Page Indentifier
* @return string Code Page Name * @return string Code Page Name
* @throws PHPExcel_Exception * @throws \PHPExcel\Exception
*/ */
public static function NumberToName($codePage = 1252) public static function NumberToName($codePage = 1252)
{ {
@ -45,7 +45,7 @@ class CodePage
case 437: case 437:
return 'CP437'; // OEM US return 'CP437'; // OEM US
case 720: case 720:
throw new PHPExcel_Exception('Code page 720 not supported.'); // OEM Arabic throw new \PHPExcel\Exception('Code page 720 not supported.'); // OEM Arabic
case 737: case 737:
return 'CP737'; // OEM Greek return 'CP737'; // OEM Greek
case 775: case 775:
@ -135,12 +135,12 @@ class CodePage
case 32768: case 32768:
return 'MAC'; // Apple Roman return 'MAC'; // Apple Roman
case 32769: case 32769:
throw new PHPExcel_Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3) throw new \PHPExcel\Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3)
case 65000: case 65000:
return 'UTF-7'; // Unicode (UTF-7) return 'UTF-7'; // Unicode (UTF-7)
case 65001: case 65001:
return 'UTF-8'; // Unicode (UTF-8) return 'UTF-8'; // Unicode (UTF-8)
} }
throw new PHPExcel_Exception('Unknown codepage: ' . $codePage); throw new \PHPExcel\Exception('Unknown codepage: ' . $codePage);
} }
} }

View File

@ -141,7 +141,7 @@ class Date
} }
$timezoneAdjustment = ($adjustToTimezone) ? $timezoneAdjustment = ($adjustToTimezone) ?
PHPExcel_Shared_TimeZone::getTimezoneAdjustment($timezone, $returnValue) : TimeZone::getTimezoneAdjustment($timezone, $returnValue) :
0; 0;
return $returnValue + $timezoneAdjustment; return $returnValue + $timezoneAdjustment;
@ -246,8 +246,8 @@ class Date
/** /**
* Is a given cell a date/time? * Is a given cell a date/time?
* *
* @param PHPExcel_Cell $pCell * @param \PHPExcel\Cell $pCell
* @return boolean * @return boolean
*/ */
public static function isDateTime(\PHPExcel\Cell $pCell) public static function isDateTime(\PHPExcel\Cell $pCell)
{ {
@ -262,8 +262,8 @@ class Date
/** /**
* Is a given number format a date/time? * Is a given number format a date/time?
* *
* @param PHPExcel_Style_NumberFormat $pFormat * @param \PHPExcel\Style\NumberFormat $pFormat
* @return boolean * @return boolean
*/ */
public static function isDateTimeFormat(\PHPExcel\Style\NumberFormat $pFormat) public static function isDateTimeFormat(\PHPExcel\Style\NumberFormat $pFormat)
{ {
@ -281,7 +281,7 @@ class Date
*/ */
public static function isDateTimeFormatCode($pFormatCode = '') public static function isDateTimeFormatCode($pFormatCode = '')
{ {
if (strtolower($pFormatCode) === strtolower(PHPExcel_Style_NumberFormat::FORMAT_GENERAL)) { if (strtolower($pFormatCode) === strtolower(\PHPExcel\Style\NumberFormat::FORMAT_GENERAL)) {
// "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check) // "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check)
return false; return false;
} }
@ -293,28 +293,28 @@ class Date
// Switch on formatcode // Switch on formatcode
switch ($pFormatCode) { switch ($pFormatCode) {
// Explicitly defined date formats // Explicitly defined date formats
case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD2: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DDMMYYYY:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMYSLASH: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMYSLASH:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMYMINUS: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMYMINUS:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMMINUS: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMMINUS:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_MYMINUS: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_MYMINUS:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_DATETIME: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DATETIME:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME1: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME1:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME2: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME2:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME3: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME3:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME5: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME5:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME6: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME6:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME7: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME7:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME8: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME8:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDDSLASH: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX14: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX14:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX16: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX16:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX17: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX17:
case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX22: case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX22:
return true; return true;
} }

View File

@ -27,7 +27,7 @@ namespace PHPExcel\Shared;
* @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_Shared_Drawing class Drawing
{ {
/** /**
* Convert pixels to EMU * Convert pixels to EMU
@ -60,23 +60,23 @@ class PHPExcel_Shared_Drawing
* By inspection of a real Excel file using Calibri 11, one finds 1000px ~ 142.85546875 * By inspection of a real Excel file using Calibri 11, one finds 1000px ~ 142.85546875
* This gives a conversion factor of 7. Also, we assume that pixels and font size are proportional. * This gives a conversion factor of 7. Also, we assume that pixels and font size are proportional.
* *
* @param int $pValue Value in pixels * @param int $pValue Value in pixels
* @param PHPExcel_Style_Font $pDefaultFont Default font of the workbook * @param \PHPExcel\Style\Font $pDefaultFont Default font of the workbook
* @return int Value in cell dimension * @return int Value in cell dimension
*/ */
public static function pixelsToCellDimension($pValue = 0, PHPExcel_Style_Font $pDefaultFont) public static function pixelsToCellDimension($pValue = 0, \PHPExcel\Style\Font $pDefaultFont)
{ {
// Font name and size // Font name and size
$name = $pDefaultFont->getName(); $name = $pDefaultFont->getName();
$size = $pDefaultFont->getSize(); $size = $pDefaultFont->getSize();
if (isset(PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size])) { if (isset(\PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size])) {
// Exact width can be determined // Exact width can be determined
$colWidth = $pValue * PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['width'] / PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['px']; $colWidth = $pValue * \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['width'] / \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['px'];
} else { } else {
// We don't have data for this particular font and size, use approximation by // We don't have data for this particular font and size, use approximation by
// extrapolating from Calibri 11 // extrapolating from Calibri 11
$colWidth = $pValue * 11 * PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['width'] / PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['px'] / $size; $colWidth = $pValue * 11 * \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / $size;
} }
return $colWidth; return $colWidth;
@ -85,23 +85,23 @@ class PHPExcel_Shared_Drawing
/** /**
* Convert column width from (intrinsic) Excel units to pixels * Convert column width from (intrinsic) Excel units to pixels
* *
* @param float $pValue Value in cell dimension * @param float $pValue Value in cell dimension
* @param PHPExcel_Style_Font $pDefaultFont Default font of the workbook * @param \PHPExcel\Style\Font $pDefaultFont Default font of the workbook
* @return int Value in pixels * @return int Value in pixels
*/ */
public static function cellDimensionToPixels($pValue = 0, PHPExcel_Style_Font $pDefaultFont) public static function cellDimensionToPixels($pValue = 0, \PHPExcel\Style\Font $pDefaultFont)
{ {
// Font name and size // Font name and size
$name = $pDefaultFont->getName(); $name = $pDefaultFont->getName();
$size = $pDefaultFont->getSize(); $size = $pDefaultFont->getSize();
if (isset(PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size])) { if (isset(\PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size])) {
// Exact width can be determined // Exact width can be determined
$colWidth = $pValue * PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['px'] / PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['width']; $colWidth = $pValue * \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['px'] / \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['width'];
} else { } else {
// We don't have data for this particular font and size, use approximation by // We don't have data for this particular font and size, use approximation by
// extrapolating from Calibri 11 // extrapolating from Calibri 11
$colWidth = $pValue * $size * PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['px'] / PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['width'] / 11; $colWidth = $pValue * $size * \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / 11;
} }
// Round pixels to closest integer // Round pixels to closest integer

View File

@ -32,21 +32,21 @@ class Escher
/** /**
* Drawing Group Container * Drawing Group Container
* *
* @var PHPExcel_Shared_Escher_DggContainer * @var Escher\DggContainer
*/ */
private $dggContainer; private $dggContainer;
/** /**
* Drawing Container * Drawing Container
* *
* @var PHPExcel_Shared_Escher_DgContainer * @var Escher\DgContainer
*/ */
private $dgContainer; private $dgContainer;
/** /**
* Get Drawing Group Container * Get Drawing Group Container
* *
* @return PHPExcel_Shared_Escher_DgContainer * @return Escher\DgContainer
*/ */
public function getDggContainer() public function getDggContainer()
{ {
@ -56,7 +56,7 @@ class Escher
/** /**
* Set Drawing Group Container * Set Drawing Group Container
* *
* @param PHPExcel_Shared_Escher_DggContainer $dggContainer * @param Escher\DggContainer $dggContainer
*/ */
public function setDggContainer($dggContainer) public function setDggContainer($dggContainer)
{ {
@ -66,7 +66,7 @@ class Escher
/** /**
* Get Drawing Container * Get Drawing Container
* *
* @return PHPExcel_Shared_Escher_DgContainer * @return Escher\DgContainer
*/ */
public function getDgContainer() public function getDgContainer()
{ {
@ -76,7 +76,7 @@ class Escher
/** /**
* Set Drawing Container * Set Drawing Container
* *
* @param PHPExcel_Shared_Escher_DgContainer $dgContainer * @param Escher\DgContainer $dgContainer
*/ */
public function setDgContainer($dgContainer) public function setDgContainer($dgContainer)
{ {

View File

@ -1,5 +1,7 @@
<?php <?php
namespace \PHPExcel\Shared\Escher;
/** /**
* PHPExcel_Shared_Escher_DgContainer * PHPExcel_Shared_Escher_DgContainer
* *
@ -25,7 +27,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_Shared_Escher_DgContainer class DgContainer
{ {
/** /**
* Drawing index, 1-based. * Drawing index, 1-based.

View File

@ -1,5 +1,7 @@
<?php <?php
namespace class PHPExcel\Shared\Escher\DgContainer;
/** /**
* PHPExcel_Shared_Escher_DgContainer_SpgrContainer * PHPExcel_Shared_Escher_DgContainer_SpgrContainer
* *
@ -25,12 +27,12 @@
* @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_Shared_Escher_DgContainer_SpgrContainer class SpgrContainer
{ {
/** /**
* Parent Shape Group Container * Parent Shape Group Container
* *
* @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer * @var \PHPExcel\Shared\Escher\DgContainer\SpgrContainer
*/ */
private $parent; private $parent;
@ -44,7 +46,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
/** /**
* Set parent Shape Group Container * Set parent Shape Group Container
* *
* @param PHPExcel_Shared_Escher_DgContainer_SpgrContainer $parent * @param \PHPExcel\Shared\Escher\DgContainer\SpgrContainer $parent
*/ */
public function setParent($parent) public function setParent($parent)
{ {
@ -54,7 +56,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
/** /**
* Get the parent Shape Group Container if any * Get the parent Shape Group Container if any
* *
* @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer|null * @return \PHPExcel\Shared\Escher\DgContainer\SpgrContainer|null
*/ */
public function getParent() public function getParent()
{ {
@ -83,14 +85,14 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
/** /**
* Recursively get all spContainers within this spgrContainer * Recursively get all spContainers within this spgrContainer
* *
* @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer[] * @return SpgrContainer\SpContainer[]
*/ */
public function getAllSpContainers() public function getAllSpContainers()
{ {
$allSpContainers = array(); $allSpContainers = array();
foreach ($this->children as $child) { foreach ($this->children as $child) {
if ($child instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) { if ($child instanceof SpgrContainer) {
$allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers()); $allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers());
} else { } else {
$allSpContainers[] = $child; $allSpContainers[] = $child;

View File

@ -1,5 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\Escher\DgContainer\SpgrContainer;
/** /**
* PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer * PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
* *
@ -25,12 +27,12 @@
* @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_Shared_Escher_DgContainer_SpgrContainer_SpContainer class SpContainer
{ {
/** /**
* Parent Shape Group Container * Parent Shape Group Container
* *
* @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer * @var \PHPExcel\Shared\Escher\DgContainer\SpgrContainer
*/ */
private $parent; private $parent;
@ -114,7 +116,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
/** /**
* Set parent Shape Group Container * Set parent Shape Group Container
* *
* @param PHPExcel_Shared_Escher_DgContainer_SpgrContainer $parent * @param \PHPExcel\Shared\Escher\DgContainer\SpgrContainer $parent
*/ */
public function setParent($parent) public function setParent($parent)
{ {
@ -124,7 +126,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
/** /**
* Get the parent Shape Group Container * Get the parent Shape Group Container
* *
* @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer * @return \PHPExcel\Shared\Escher\DgContainer\SpgrContainer
*/ */
public function getParent() public function getParent()
{ {
@ -378,7 +380,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
$nestingLevel = 0; $nestingLevel = 0;
$parent = $this->getParent(); $parent = $this->getParent();
while ($parent instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) { while ($parent instanceof \PHPExcel\Shared\Escher\DgContainer\SpgrContainer) {
++$nestingLevel; ++$nestingLevel;
$parent = $parent->getParent(); $parent = $parent->getParent();
} }

View File

@ -1,5 +1,7 @@
<?php <?php
namespace \PHPExcel\Shared\Escher;
/** /**
* PHPExcel_Shared_Escher_DggContainer * PHPExcel_Shared_Escher_DggContainer
* *
@ -25,7 +27,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_Shared_Escher_DggContainer class DggContainer
{ {
/** /**
* Maximum shape index of all shapes in all drawings increased by one * Maximum shape index of all shapes in all drawings increased by one
@ -51,7 +53,7 @@ class PHPExcel_Shared_Escher_DggContainer
/** /**
* BLIP Store Container * BLIP Store Container
* *
* @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer * @var DggContainer\BstoreContainer
*/ */
private $bstoreContainer; private $bstoreContainer;
@ -132,7 +134,7 @@ class PHPExcel_Shared_Escher_DggContainer
/** /**
* Get BLIP Store Container * Get BLIP Store Container
* *
* @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer * @return DggContainer\BstoreContainer
*/ */
public function getBstoreContainer() public function getBstoreContainer()
{ {
@ -142,7 +144,7 @@ class PHPExcel_Shared_Escher_DggContainer
/** /**
* Set BLIP Store Container * Set BLIP Store Container
* *
* @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer $bstoreContainer * @param DggContainer\BstoreContainer $bstoreContainer
*/ */
public function setBstoreContainer($bstoreContainer) public function setBstoreContainer($bstoreContainer)
{ {

View File

@ -1,5 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\Escher\DggContainer;
/** /**
* PHPExcel_Shared_Escher_DggContainer_BstoreContainer * PHPExcel_Shared_Escher_DggContainer_BstoreContainer
* *
@ -25,7 +27,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_Shared_Escher_DggContainer_BstoreContainer class BstoreContainer
{ {
/** /**
* BLIP Store Entries. Each of them holds one BLIP (Big Large Image or Picture) * BLIP Store Entries. Each of them holds one BLIP (Big Large Image or Picture)
@ -37,7 +39,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer
/** /**
* Add a BLIP Store Entry * Add a BLIP Store Entry
* *
* @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $BSE * @param BstoreContainer\BSE $BSE
*/ */
public function addBSE($BSE) public function addBSE($BSE)
{ {
@ -48,7 +50,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer
/** /**
* Get the collection of BLIP Store Entries * Get the collection of BLIP Store Entries
* *
* @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE[] * @return BstoreContainer\BSE[]
*/ */
public function getBSECollection() public function getBSECollection()
{ {

View File

@ -1,5 +1,7 @@
<?php <?php
namespace \PHPExcel\Shared\Escher\DggContainer\BstoreContainer;
/** /**
* PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE * PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
* *
@ -25,7 +27,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_Shared_Escher_DggContainer_BstoreContainer_BSE class BSE
{ {
const BLIPTYPE_ERROR = 0x00; const BLIPTYPE_ERROR = 0x00;
const BLIPTYPE_UNKNOWN = 0x01; const BLIPTYPE_UNKNOWN = 0x01;
@ -41,14 +43,14 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
/** /**
* The parent BLIP Store Entry Container * The parent BLIP Store Entry Container
* *
* @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer * @var \PHPExcel\Shared\Escher\DggContainer\BstoreContainer
*/ */
private $parent; private $parent;
/** /**
* The BLIP (Big Large Image or Picture) * The BLIP (Big Large Image or Picture)
* *
* @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip * @var BSE\Blip
*/ */
private $blip; private $blip;
@ -62,7 +64,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
/** /**
* Set parent BLIP Store Entry Container * Set parent BLIP Store Entry Container
* *
* @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer $parent * @param \PHPExcel\Shared\Escher\DggContainer\BstoreContainer $parent
*/ */
public function setParent($parent) public function setParent($parent)
{ {
@ -72,7 +74,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
/** /**
* Get the BLIP * Get the BLIP
* *
* @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip * @return BSE\Blip
*/ */
public function getBlip() public function getBlip()
{ {
@ -82,7 +84,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
/** /**
* Set the BLIP * Set the BLIP
* *
* @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip $blip * @param BSE\Blip $blip
*/ */
public function setBlip($blip) public function setBlip($blip)
{ {

View File

@ -1,5 +1,7 @@
<?php <?php
namespace \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE;
/** /**
* PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip * PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
* *
@ -25,12 +27,12 @@
* @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_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip class Blip
{ {
/** /**
* The parent BSE * The parent BSE
* *
* @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE * @var \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE
*/ */
private $parent; private $parent;
@ -64,7 +66,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
/** /**
* Set parent BSE * Set parent BSE
* *
* @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $parent * @param \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE $parent
*/ */
public function setParent($parent) public function setParent($parent)
{ {
@ -74,7 +76,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
/** /**
* Get parent BSE * Get parent BSE
* *
* @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $parent * @return \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE $parent
*/ */
public function getParent() public function getParent()
{ {

View File

@ -34,7 +34,7 @@ class Excel5
* x is the width in intrinsic Excel units (measuring width in number of normal characters) * x is the width in intrinsic Excel units (measuring width in number of normal characters)
* This holds for Arial 10 * This holds for Arial 10
* *
* @param PHPExcel_Worksheet $sheet The sheet * @param \PHPExcel\Worksheet $sheet The sheet
* @param string $col The column * @param string $col The column
* @return integer The width in pixels * @return integer The width in pixels
*/ */
@ -50,15 +50,15 @@ class Excel5
// then we have column dimension with explicit width // then we have column dimension with explicit width
$columnDimension = $columnDimensions[$col]; $columnDimension = $columnDimensions[$col];
$width = $columnDimension->getWidth(); $width = $columnDimension->getWidth();
$pixelWidth = PHPExcel_Shared_Drawing::cellDimensionToPixels($width, $font); $pixelWidth = \PHPExcel\Shared\Drawing::cellDimensionToPixels($width, $font);
} elseif ($sheet->getDefaultColumnDimension()->getWidth() != -1) { } elseif ($sheet->getDefaultColumnDimension()->getWidth() != -1) {
// then we have default column dimension with explicit width // then we have default column dimension with explicit width
$defaultColumnDimension = $sheet->getDefaultColumnDimension(); $defaultColumnDimension = $sheet->getDefaultColumnDimension();
$width = $defaultColumnDimension->getWidth(); $width = $defaultColumnDimension->getWidth();
$pixelWidth = PHPExcel_Shared_Drawing::cellDimensionToPixels($width, $font); $pixelWidth = \PHPExcel\Shared\Drawing::cellDimensionToPixels($width, $font);
} else { } else {
// we don't even have any default column dimension. Width depends on default font // we don't even have any default column dimension. Width depends on default font
$pixelWidth = PHPExcel_Shared_Font::getDefaultColumnWidthByFont($font, true); $pixelWidth = \PHPExcel\Shared\Font::getDefaultColumnWidthByFont($font, true);
} }
// now find the effective column width in pixels // now find the effective column width in pixels
@ -76,7 +76,7 @@ class Excel5
* the relationship is: y = 4/3x. If the height hasn't been set by the user we * the relationship is: y = 4/3x. If the height hasn't been set by the user we
* use the default value. If the row is hidden we use a value of zero. * use the default value. If the row is hidden we use a value of zero.
* *
* @param PHPExcel_Worksheet $sheet The sheet * @param \PHPExcel\Worksheet $sheet The sheet
* @param integer $row The row index (1-based) * @param integer $row The row index (1-based)
* @return integer The width in pixels * @return integer The width in pixels
*/ */
@ -97,11 +97,11 @@ class Excel5
// then we have a default row dimension with explicit height // then we have a default row dimension with explicit height
$defaultRowDimension = $sheet->getDefaultRowDimension(); $defaultRowDimension = $sheet->getDefaultRowDimension();
$rowHeight = $defaultRowDimension->getRowHeight(); $rowHeight = $defaultRowDimension->getRowHeight();
$pixelRowHeight = PHPExcel_Shared_Drawing::pointsToPixels($rowHeight); $pixelRowHeight = \PHPExcel\Shared\Drawing::pointsToPixels($rowHeight);
} else { } else {
// we don't even have any default row dimension. Height depends on default font // we don't even have any default row dimension. Height depends on default font
$pointRowHeight = PHPExcel_Shared_Font::getDefaultRowHeightByFont($font); $pointRowHeight = \PHPExcel\Shared\Font::getDefaultRowHeightByFont($font);
$pixelRowHeight = PHPExcel_Shared_Font::fontSizeToPixels($pointRowHeight); $pixelRowHeight = \PHPExcel\Shared\Font::fontSizeToPixels($pointRowHeight);
} }
// now find the effective row height in pixels // now find the effective row height in pixels
@ -118,22 +118,22 @@ class Excel5
* Get the horizontal distance in pixels between two anchors * Get the horizontal distance in pixels between two anchors
* The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets * The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets
* *
* @param PHPExcel_Worksheet $sheet * @param \PHPExcel\Worksheet $sheet
* @param string $startColumn * @param string $startColumn
* @param integer $startOffsetX Offset within start cell measured in 1/1024 of the cell width * @param integer $startOffsetX Offset within start cell measured in 1/1024 of the cell width
* @param string $endColumn * @param string $endColumn
* @param integer $endOffsetX Offset within end cell measured in 1/1024 of the cell width * @param integer $endOffsetX Offset within end cell measured in 1/1024 of the cell width
* @return integer Horizontal measured in pixels * @return integer Horizontal measured in pixels
*/ */
public static function getDistanceX(PHPExcel_Worksheet $sheet, $startColumn = 'A', $startOffsetX = 0, $endColumn = 'A', $endOffsetX = 0) public static function getDistanceX(\PHPExcel\Worksheet $sheet, $startColumn = 'A', $startOffsetX = 0, $endColumn = 'A', $endOffsetX = 0)
{ {
$distanceX = 0; $distanceX = 0;
// add the widths of the spanning columns // add the widths of the spanning columns
$startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1; // 1-based $startColumnIndex = \PHPExcel\Cell::columnIndexFromString($startColumn) - 1; // 1-based
$endColumnIndex = PHPExcel_Cell::columnIndexFromString($endColumn) - 1; // 1-based $endColumnIndex = \PHPExcel\Cell::columnIndexFromString($endColumn) - 1; // 1-based
for ($i = $startColumnIndex; $i <= $endColumnIndex; ++$i) { for ($i = $startColumnIndex; $i <= $endColumnIndex; ++$i) {
$distanceX += self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($i)); $distanceX += self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($i));
} }
// correct for offsetX in startcell // correct for offsetX in startcell
@ -149,14 +149,14 @@ class Excel5
* Get the vertical distance in pixels between two anchors * Get the vertical distance in pixels between two anchors
* The distanceY is found as sum of all the spanning rows minus two offsets * The distanceY is found as sum of all the spanning rows minus two offsets
* *
* @param PHPExcel_Worksheet $sheet * @param \PHPExcel\Worksheet $sheet
* @param integer $startRow (1-based) * @param integer $startRow (1-based)
* @param integer $startOffsetY Offset within start cell measured in 1/256 of the cell height * @param integer $startOffsetY Offset within start cell measured in 1/256 of the cell height
* @param integer $endRow (1-based) * @param integer $endRow (1-based)
* @param integer $endOffsetY Offset within end cell measured in 1/256 of the cell height * @param integer $endOffsetY Offset within end cell measured in 1/256 of the cell height
* @return integer Vertical distance measured in pixels * @return integer Vertical distance measured in pixels
*/ */
public static function getDistanceY(PHPExcel_Worksheet $sheet, $startRow = 1, $startOffsetY = 0, $endRow = 1, $endOffsetY = 0) public static function getDistanceY(\PHPExcel\Worksheet $sheet, $startRow = 1, $startOffsetY = 0, $endRow = 1, $endOffsetY = 0)
{ {
$distanceY = 0; $distanceY = 0;
@ -218,7 +218,7 @@ class Excel5
* W is the width of the cell * W is the width of the cell
* H is the height of the cell * H is the height of the cell
* *
* @param PHPExcel_Worksheet $sheet * @param \PHPExcel\Worksheet $sheet
* @param string $coordinates E.g. 'A1' * @param string $coordinates E.g. 'A1'
* @param integer $offsetX Horizontal offset in pixels * @param integer $offsetX Horizontal offset in pixels
* @param integer $offsetY Vertical offset in pixels * @param integer $offsetY Vertical offset in pixels
@ -228,8 +228,8 @@ class Excel5
*/ */
public static function oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height) public static function oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height)
{ {
list($column, $row) = PHPExcel_Cell::coordinateFromString($coordinates); list($column, $row) = \PHPExcel\Cell::coordinateFromString($coordinates);
$col_start = PHPExcel_Cell::columnIndexFromString($column) - 1; $col_start = \PHPExcel\Cell::columnIndexFromString($column) - 1;
$row_start = $row - 1; $row_start = $row - 1;
$x1 = $offsetX; $x1 = $offsetX;
@ -240,7 +240,7 @@ class Excel5
$row_end = $row_start; // Row containing bottom right corner of object $row_end = $row_start; // Row containing bottom right corner of object
// Zero the specified offset if greater than the cell dimensions // Zero the specified offset if greater than the cell dimensions
if ($x1 >= self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_start))) { if ($x1 >= self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start))) {
$x1 = 0; $x1 = 0;
} }
if ($y1 >= self::sizeRow($sheet, $row_start + 1)) { if ($y1 >= self::sizeRow($sheet, $row_start + 1)) {
@ -251,8 +251,8 @@ class Excel5
$height = $height + $y1 -1; $height = $height + $y1 -1;
// Subtract the underlying cell widths to find the end cell of the image // Subtract the underlying cell widths to find the end cell of the image
while ($width >= self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end))) { while ($width >= self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end))) {
$width -= self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end)); $width -= self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end));
++$col_end; ++$col_end;
} }
@ -264,10 +264,10 @@ class Excel5
// Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell // Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell
// with zero height or width. // with zero height or width.
if (self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_start)) == 0) { if (self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) == 0) {
return; return;
} }
if (self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end)) == 0) { if (self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) == 0) {
return; return;
} }
if (self::sizeRow($sheet, $row_start + 1) == 0) { if (self::sizeRow($sheet, $row_start + 1) == 0) {
@ -278,13 +278,13 @@ class Excel5
} }
// Convert the pixel values to the percentage value expected by Excel // Convert the pixel values to the percentage value expected by Excel
$x1 = $x1 / self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_start)) * 1024; $x1 = $x1 / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) * 1024;
$y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256; $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256;
$x2 = ($width + 1) / self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object $x2 = ($width + 1) / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object
$y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object
$startCoordinates = PHPExcel_Cell::stringFromColumnIndex($col_start) . ($row_start + 1); $startCoordinates = \PHPExcel\Cell::stringFromColumnIndex($col_start) . ($row_start + 1);
$endCoordinates = PHPExcel_Cell::stringFromColumnIndex($col_end) . ($row_end + 1); $endCoordinates = \PHPExcel\Cell::stringFromColumnIndex($col_end) . ($row_end + 1);
$twoAnchor = array( $twoAnchor = array(
'startCoordinates' => $startCoordinates, 'startCoordinates' => $startCoordinates,

View File

@ -237,16 +237,16 @@ class Font
/** /**
* Calculate an (approximate) OpenXML column width, based on font size and text contained * Calculate an (approximate) OpenXML column width, based on font size and text contained
* *
* @param PHPExcel_Style_Font $font Font object * @param \PHPExcel\Style\Font $font Font object
* @param PHPExcel_RichText|string $cellText Text to calculate width * @param \PHPExcel\RichText|string $cellText Text to calculate width
* @param integer $rotation Rotation angle * @param integer $rotation Rotation angle
* @param PHPExcel_Style_Font|NULL $defaultFont Font object * @param \PHPExcel\Style\Font|NULL $defaultFont Font object
* @return integer Column width * @return integer Column width
*/ */
public static function calculateColumnWidth(PHPExcel_Style_Font $font, $cellText = '', $rotation = 0, PHPExcel_Style_Font $defaultFont = null) public static function calculateColumnWidth(\PHPExcel\Style\Font $font, $cellText = '', $rotation = 0, \PHPExcel\Style\Font $defaultFont = null)
{ {
// If it is rich text, use plain text // If it is rich text, use plain text
if ($cellText instanceof PHPExcel_RichText) { if ($cellText instanceof \PHPExcel\RichText) {
$cellText = $cellText->getPlainText(); $cellText = $cellText->getPlainText();
} }
@ -268,7 +268,7 @@ class Font
// Width of text in pixels excl. padding // Width of text in pixels excl. padding
// and addition because Excel adds some padding, just use approx width of 'n' glyph // and addition because Excel adds some padding, just use approx width of 'n' glyph
$columnWidth = self::getTextWidthPixelsExact($cellText, $font, $rotation) + $columnWidthAdjust; $columnWidth = self::getTextWidthPixelsExact($cellText, $font, $rotation) + $columnWidthAdjust;
} catch (PHPExcel_Exception $e) { } catch (\PHPExcel\Exception $e) {
$approximate = true; $approximate = true;
} }
} }
@ -281,7 +281,7 @@ class Font
} }
// Convert from pixel width to column width // Convert from pixel width to column width
$columnWidth = PHPExcel_Shared_Drawing::pixelsToCellDimension($columnWidth, $defaultFont); $columnWidth = Drawing::pixelsToCellDimension($columnWidth, $defaultFont);
// Return // Return
return round($columnWidth, 6); return round($columnWidth, 6);
@ -291,15 +291,15 @@ class Font
* Get GD text width in pixels for a string of text in a certain font at a certain rotation angle * Get GD text width in pixels for a string of text in a certain font at a certain rotation angle
* *
* @param string $text * @param string $text
* @param PHPExcel_Style_Font * @param \PHPExcel\Style\Font
* @param int $rotation * @param int $rotation
* @return int * @return int
* @throws PHPExcel_Exception * @throws \PHPExcel\Exception
*/ */
public static function getTextWidthPixelsExact($text, PHPExcel_Style_Font $font, $rotation = 0) public static function getTextWidthPixelsExact($text, \PHPExcel\Style\Font $font, $rotation = 0)
{ {
if (!function_exists('imagettfbbox')) { if (!function_exists('imagettfbbox')) {
throw new PHPExcel_Exception('GD library needs to be enabled'); throw new \PHPExcel\Exception('GD library needs to be enabled');
} }
// font size should really be supplied in pixels in GD2, // font size should really be supplied in pixels in GD2,
@ -327,11 +327,11 @@ class Font
* Get approximate width in pixels for a string of text in a certain font at a certain rotation angle * Get approximate width in pixels for a string of text in a certain font at a certain rotation angle
* *
* @param string $columnText * @param string $columnText
* @param PHPExcel_Style_Font $font * @param \PHPExcel\Style\Font $font
* @param int $rotation * @param int $rotation
* @return int Text width in pixels (no padding added) * @return int Text width in pixels (no padding added)
*/ */
public static function getTextWidthPixelsApprox($columnText, PHPExcel_Style_Font $font = null, $rotation = 0) public static function getTextWidthPixelsApprox($columnText, \PHPExcel\Style\Font $font = null, $rotation = 0)
{ {
$fontName = $font->getName(); $fontName = $font->getName();
$fontSize = $font->getSize(); $fontSize = $font->getSize();
@ -340,27 +340,27 @@ class Font
switch ($fontName) { switch ($fontName) {
case 'Calibri': case 'Calibri':
// value 8.26 was found via interpolation by inspecting real Excel files with Calibri 11 font. // value 8.26 was found via interpolation by inspecting real Excel files with Calibri 11 font.
$columnWidth = (int) (8.26 * PHPExcel_Shared_String::CountCharacters($columnText)); $columnWidth = (int) (8.26 * String::CountCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size $columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size
break; break;
case 'Arial': case 'Arial':
// value 7 was found via interpolation by inspecting real Excel files with Arial 10 font. // value 7 was found via interpolation by inspecting real Excel files with Arial 10 font.
// $columnWidth = (int) (7 * PHPExcel_Shared_String::CountCharacters($columnText)); // $columnWidth = (int) (7 * String::CountCharacters($columnText));
// value 8 was set because of experience in different exports at Arial 10 font. // value 8 was set because of experience in different exports at Arial 10 font.
$columnWidth = (int) (8 * PHPExcel_Shared_String::CountCharacters($columnText)); $columnWidth = (int) (8 * String::CountCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size $columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size
break; break;
case 'Verdana': case 'Verdana':
// value 8 was found via interpolation by inspecting real Excel files with Verdana 10 font. // value 8 was found via interpolation by inspecting real Excel files with Verdana 10 font.
$columnWidth = (int) (8 * PHPExcel_Shared_String::CountCharacters($columnText)); $columnWidth = (int) (8 * String::CountCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size $columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size
break; break;
default: default:
// just assume Calibri // just assume Calibri
$columnWidth = (int) (8.26 * PHPExcel_Shared_String::CountCharacters($columnText)); $columnWidth = (int) (8.26 * String::CountCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size $columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size
break; break;
} }
@ -417,18 +417,18 @@ class Font
/** /**
* Returns the font path given the font * Returns the font path given the font
* *
* @param PHPExcel_Style_Font * @param \PHPExcel\Style\Font
* @return string Path to TrueType font file * @return string Path to TrueType font file
*/ */
public static function getTrueTypeFontFileFromFont($font) public static function getTrueTypeFontFileFromFont($font)
{ {
if (!file_exists(self::$trueTypeFontPath) || !is_dir(self::$trueTypeFontPath)) { if (!file_exists(self::$trueTypeFontPath) || !is_dir(self::$trueTypeFontPath)) {
throw new PHPExcel_Exception('Valid directory to TrueType Font files not specified'); throw new \PHPExcel\Exception('Valid directory to TrueType Font files not specified');
} }
$name = $font->getName(); $name = $font->getName();
$bold = $font->getBold(); $bold = $font->getBold();
$italic = $font->getItalic(); $italic = $font->getItalic();
// Check if we can map font to true type font file // Check if we can map font to true type font file
switch ($name) { switch ($name) {
@ -512,7 +512,7 @@ class Font
); );
break; break;
default: default:
throw new PHPExcel_Exception('Unknown font name "'. $name .'". Cannot map to TrueType font file'); throw new \PHPExcel\Exception('Unknown font name "'. $name .'". Cannot map to TrueType font file');
break; break;
} }
@ -520,7 +520,7 @@ class Font
// Check if file actually exists // Check if file actually exists
if (!file_exists($fontFile)) { if (!file_exists($fontFile)) {
throw new PHPExcel_Exception('TrueType Font file not found'); throw new \PHPExcel\Exception('TrueType Font file not found');
} }
return $fontFile; return $fontFile;
@ -553,11 +553,11 @@ class Font
* Get the effective column width for columns without a column dimension or column with width -1 * Get the effective column width for columns without a column dimension or column with width -1
* For example, for Calibri 11 this is 9.140625 (64 px) * For example, for Calibri 11 this is 9.140625 (64 px)
* *
* @param PHPExcel_Style_Font $font The workbooks default font * @param \PHPExcel\Style\Font $font The workbooks default font
* @param boolean $pPixels true = return column width in pixels, false = return in OOXML units * @param boolean $pPixels true = return column width in pixels, false = return in OOXML units
* @return mixed Column width * @return mixed Column width
*/ */
public static function getDefaultColumnWidthByFont(PHPExcel_Style_Font $font, $pPixels = false) public static function getDefaultColumnWidthByFont(\PHPExcel\Style\Font $font, $pPixels = false)
{ {
if (isset(self::$defaultColumnWidths[$font->getName()][$font->getSize()])) { if (isset(self::$defaultColumnWidths[$font->getName()][$font->getSize()])) {
// Exact width can be determined // Exact width can be determined
@ -586,10 +586,10 @@ class Font
* Get the effective row height for rows without a row dimension or rows with height -1 * Get the effective row height for rows without a row dimension or rows with height -1
* For example, for Calibri 11 this is 15 points * For example, for Calibri 11 this is 15 points
* *
* @param PHPExcel_Style_Font $font The workbooks default font * @param \PHPExcel\Style\Font $font The workbooks default font
* @return float Row height in points * @return float Row height in points
*/ */
public static function getDefaultRowHeightByFont(PHPExcel_Style_Font $font) public static function getDefaultRowHeightByFont(\PHPExcel\Style\Font $font)
{ {
switch ($font->getName()) { switch ($font->getName()) {
case 'Arial': case 'Arial':

View File

@ -95,23 +95,24 @@ class OLE
* @acces public * @acces public
* @param string $file * @param string $file
* @return mixed true on success, PEAR_Error on failure * @return mixed true on success, PEAR_Error on failure
* @throws \PHPExcel\Reader\Exception
*/ */
public function read($file) public function read($file)
{ {
$fh = fopen($file, "r"); $fh = fopen($file, "r");
if (!$fh) { if (!$fh) {
throw new PHPExcel_Reader_Exception("Can't open file $file"); throw new \PHPExcel\Reader\Exception("Can't open file $file");
} }
$this->_file_handle = $fh; $this->_file_handle = $fh;
$signature = fread($fh, 8); $signature = fread($fh, 8);
if ("\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" != $signature) { if ("\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" != $signature) {
throw new PHPExcel_Reader_Exception("File doesn't seem to be an OLE container."); throw new \PHPExcel\Reader\Exception("File doesn't seem to be an OLE container.");
} }
fseek($fh, 28); fseek($fh, 28);
if (fread($fh, 2) != "\xFE\xFF") { if (fread($fh, 2) != "\xFE\xFF") {
// This shouldn't be a problem in practice // This shouldn't be a problem in practice
throw new PHPExcel_Reader_Exception("Only Little-Endian encoding is supported."); throw new \PHPExcel\Reader\Exception("Only Little-Endian encoding is supported.");
} }
// Size of blocks and short blocks in bytes // Size of blocks and short blocks in bytes
$this->bigBlockSize = pow(2, self::_readInt2($fh)); $this->bigBlockSize = pow(2, self::_readInt2($fh));
@ -193,7 +194,7 @@ class OLE
/** /**
* Returns a stream for use with fread() etc. External callers should * Returns a stream for use with fread() etc. External callers should
* use PHPExcel_Shared_OLE_PPS_File::getStream(). * use \PHPExcel\Shared\OLE\PPS\File::getStream().
* @param int|PPS block id or PPS * @param int|PPS block id or PPS
* @return resource read-only stream * @return resource read-only stream
*/ */
@ -201,7 +202,7 @@ class OLE
{ {
static $isRegistered = false; static $isRegistered = false;
if (!$isRegistered) { if (!$isRegistered) {
stream_wrapper_register('ole-chainedblockstream', 'PHPExcel_Shared_OLE_ChainedBlockStream'); stream_wrapper_register('ole-chainedblockstream', '\\PHPExcel\\Shared\\OLE\\ChainedBlockStream');
$isRegistered = true; $isRegistered = true;
} }
@ -212,7 +213,7 @@ class OLE
$instanceId = end(array_keys($GLOBALS['_OLE_INSTANCES'])); $instanceId = end(array_keys($GLOBALS['_OLE_INSTANCES']));
$path = 'ole-chainedblockstream://oleInstanceId=' . $instanceId; $path = 'ole-chainedblockstream://oleInstanceId=' . $instanceId;
if ($blockIdOrPps instanceof PHPExcel_Shared_OLE_PPS) { if ($blockIdOrPps instanceof OLE\PPS) {
$path .= '&blockId=' . $blockIdOrPps->_StartBlock; $path .= '&blockId=' . $blockIdOrPps->_StartBlock;
$path .= '&size=' . $blockIdOrPps->Size; $path .= '&size=' . $blockIdOrPps->Size;
} else { } else {
@ -278,14 +279,14 @@ class OLE
$type = self::_readInt1($fh); $type = self::_readInt1($fh);
switch ($type) { switch ($type) {
case self::OLE_PPS_TYPE_ROOT: case self::OLE_PPS_TYPE_ROOT:
$pps = new PHPExcel_Shared_OLE_PPS_Root(null, null, array()); $pps = new OLE\PPS_Root(null, null, array());
$this->root = $pps; $this->root = $pps;
break; break;
case self::OLE_PPS_TYPE_DIR: case self::OLE_PPS_TYPE_DIR:
$pps = new PHPExcel_Shared_OLE_PPS(null, null, null, null, null, null, null, null, null, array()); $pps = new OLE\PPS(null, null, null, null, null, null, null, null, null, array());
break; break;
case self::OLE_PPS_TYPE_FILE: case self::OLE_PPS_TYPE_FILE:
$pps = new PHPExcel_Shared_OLE_PPS_File($name); $pps = new OLE\PPS\File($name);
break; break;
default: default:
continue; continue;

View File

@ -1,5 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\OLE;
/** /**
* PHPExcel_Shared_OLE_ChainedBlockStream * PHPExcel_Shared_OLE_ChainedBlockStream
* *
@ -25,7 +27,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_Shared_OLE_ChainedBlockStream class ChainedBlockStream
{ {
/** /**
* The OLE container of the file that is being read. * The OLE container of the file that is being read.

View File

@ -1,4 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\OLE;
/* vim: set expandtab tabstop=4 shiftwidth=4: */ /* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+ // +----------------------------------------------------------------------+
// | PHP Version 4 | // | PHP Version 4 |
@ -27,7 +30,7 @@
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Shared_OLE * @package PHPExcel_Shared_OLE
*/ */
class PHPExcel_Shared_OLE_PPS class PPS
{ {
/** /**
* The PPS index * The PPS index
@ -182,8 +185,8 @@ class PHPExcel_Shared_OLE_PPS
. "\xc0\x00\x00\x00" // 92 . "\xc0\x00\x00\x00" // 92
. "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root
. "\x00\x00\x00\x00" // 100 . "\x00\x00\x00\x00" // 100
. PHPExcel_Shared_OLE::LocalDate2OLE($this->Time1st) // 108 . \PHPExcel\Shared\OLE::LocalDate2OLE($this->Time1st) // 108
. PHPExcel_Shared_OLE::LocalDate2OLE($this->Time2nd) // 116 . \PHPExcel\Shared\OLE::LocalDate2OLE($this->Time2nd) // 116
. pack("V", isset($this->_StartBlock)? . pack("V", isset($this->_StartBlock)?
$this->_StartBlock:0) // 120 $this->_StartBlock:0) // 120
. pack("V", $this->Size) // 124 . pack("V", $this->Size) // 124

View File

@ -1,4 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\OLE\PPS;
/* vim: set expandtab tabstop=4 shiftwidth=4: */ /* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+ // +----------------------------------------------------------------------+
// | PHP Version 4 | // | PHP Version 4 |
@ -27,7 +30,7 @@
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Shared_OLE * @package PHPExcel_Shared_OLE
*/ */
class PHPExcel_Shared_OLE_PPS_File extends PHPExcel_Shared_OLE_PPS class File extends \PHPExcel\Shared\OLE\PPS
{ {
/** /**
* The constructor * The constructor
@ -38,7 +41,7 @@ class PHPExcel_Shared_OLE_PPS_File extends PHPExcel_Shared_OLE_PPS
*/ */
public function __construct($name) public function __construct($name)
{ {
parent::__construct(null, $name, PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', array()); parent::__construct(null, $name, \PHPExcel\Shared\OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', array());
} }
/** /**

View File

@ -1,4 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\OLE\PPS;
/* vim: set expandtab tabstop=4 shiftwidth=4: */ /* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+ // +----------------------------------------------------------------------+
// | PHP Version 4 | // | PHP Version 4 |
@ -27,7 +30,7 @@
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Shared_OLE * @package PHPExcel_Shared_OLE
*/ */
class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS class Root extends \PHPExcel\Shared\OLE\PPS
{ {
/** /**
@ -42,9 +45,9 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
*/ */
public function __construct($time_1st, $time_2nd, $raChild) public function __construct($time_1st, $time_2nd, $raChild)
{ {
$this->_tempDir = PHPExcel_Shared_File::sys_get_temp_dir(); $this->_tempDir = \PHPExcel\Shared\File::sys_get_temp_dir();
parent::__construct(null, PHPExcel_Shared_OLE::Asc2Ucs('Root Entry'), PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); parent::__construct(null, \PHPExcel\Shared\OLE::Asc2Ucs('Root Entry'), \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild);
} }
/** /**
@ -57,6 +60,7 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
* @param string|resource $filename The name of the file or stream where to save the OLE container. * @param string|resource $filename The name of the file or stream where to save the OLE container.
* @access public * @access public
* @return mixed true on success * @return mixed true on success
* @throws \PHPExcel\Writer\Exception
*/ */
public function save($filename) public function save($filename)
{ {
@ -74,22 +78,22 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
$this->_FILEH_ = $filename; $this->_FILEH_ = $filename;
} elseif ($filename == '-' || $filename == '') { } elseif ($filename == '-' || $filename == '') {
if ($this->tempDirectory === null) { if ($this->tempDirectory === null) {
$this->tempDirectory = PHPExcel_Shared_File::sys_get_temp_dir(); $this->tempDirectory = \PHPExcel\Shared\File::sys_get_temp_dir();
} }
$this->_tmp_filename = tempnam($this->tempDirectory, "OLE_PPS_Root"); $this->_tmp_filename = tempnam($this->tempDirectory, "OLE_PPS_Root");
$this->_FILEH_ = fopen($this->_tmp_filename, "w+b"); $this->_FILEH_ = fopen($this->_tmp_filename, "w+b");
if ($this->_FILEH_ == false) { if ($this->_FILEH_ == false) {
throw new PHPExcel_Writer_Exception("Can't create temporary file."); throw new \PHPExcel\Writer\Exception("Can't create temporary file.");
} }
} else { } else {
$this->_FILEH_ = fopen($filename, "wb"); $this->_FILEH_ = fopen($filename, "wb");
} }
if ($this->_FILEH_ == false) { if ($this->_FILEH_ == false) {
throw new PHPExcel_Writer_Exception("Can't open $filename. It may be in use or protected."); throw new \PHPExcel\Writer\Exception("Can't open $filename. It may be in use or protected.");
} }
// Make an array of PPS's (for Save) // Make an array of PPS's (for Save)
$aList = array(); $aList = array();
PHPExcel_Shared_OLE_PPS::_savePpsSetPnt($aList, array($this)); \PHPExcel\Shared\OLE\PPS::_savePpsSetPnt($aList, array($this));
// calculate values for header // calculate values for header
list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo); list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo);
// Save Header // Save Header
@ -127,9 +131,9 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
$iSBcnt = 0; $iSBcnt = 0;
$iCount = count($raList); $iCount = count($raList);
for ($i = 0; $i < $iCount; ++$i) { for ($i = 0; $i < $iCount; ++$i) {
if ($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE) { if ($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_FILE) {
$raList[$i]->Size = $raList[$i]->_DataLen(); $raList[$i]->Size = $raList[$i]->_DataLen();
if ($raList[$i]->Size < PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) { if ($raList[$i]->Size < \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) {
$iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
+ (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
} else { } else {
@ -139,12 +143,12 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
} }
} }
$iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE; $iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE;
$iSlCnt = floor($this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE); $iSlCnt = floor($this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE);
$iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0); $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0);
$iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) + $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) +
(( $iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0)); (( $iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0));
$iCnt = count($raList); $iCnt = count($raList);
$iBdCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_PPS_SIZE; $iBdCnt = $this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_PPS_SIZE;
$iPPScnt = (floor($iCnt/$iBdCnt) + (($iCnt % $iBdCnt)? 1: 0)); $iPPScnt = (floor($iCnt/$iBdCnt) + (($iCnt % $iBdCnt)? 1: 0));
return array($iSBDcnt, $iBBcnt, $iPPScnt); return array($iSBDcnt, $iBBcnt, $iPPScnt);
@ -177,8 +181,8 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
$FILE = $this->_FILEH_; $FILE = $this->_FILEH_;
// Calculate Basic Setting // Calculate Basic Setting
$iBlCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; $iBlCnt = $this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE;
$i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE;
$iBdExL = 0; $iBdExL = 0;
$iAll = $iBBcnt + $iPPScnt + $iSBDcnt; $iAll = $iBBcnt + $iPPScnt + $iSBDcnt;
@ -246,7 +250,7 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
} }
/** /**
* Saving big data (PPS's with data bigger than PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) * Saving big data (PPS's with data bigger than \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL)
* *
* @access public * @access public
* @param integer $iStBlk * @param integer $iStBlk
@ -259,9 +263,9 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
// cycle through PPS's // cycle through PPS's
$iCount = count($raList); $iCount = count($raList);
for ($i = 0; $i < $iCount; ++$i) { for ($i = 0; $i < $iCount; ++$i) {
if ($raList[$i]->Type != PHPExcel_Shared_OLE::OLE_PPS_TYPE_DIR) { if ($raList[$i]->Type != \PHPExcel\Shared\OLE::OLE_PPS_TYPE_DIR) {
$raList[$i]->Size = $raList[$i]->_DataLen(); $raList[$i]->Size = $raList[$i]->_DataLen();
if (($raList[$i]->Size >= PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) { if (($raList[$i]->Size >= \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) {
// Write Data // Write Data
//if (isset($raList[$i]->_PPS_FILE)) { //if (isset($raList[$i]->_PPS_FILE)) {
// $iLen = 0; // $iLen = 0;
@ -294,7 +298,7 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
} }
/** /**
* get small data (PPS's with data smaller than PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) * get small data (PPS's with data smaller than \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL)
* *
* @access public * @access public
* @param array &$raList Reference to array of PPS's * @param array &$raList Reference to array of PPS's
@ -308,11 +312,11 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
$iCount = count($raList); $iCount = count($raList);
for ($i = 0; $i < $iCount; ++$i) { for ($i = 0; $i < $iCount; ++$i) {
// Make SBD, small data string // Make SBD, small data string
if ($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE) { if ($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_FILE) {
if ($raList[$i]->Size <= 0) { if ($raList[$i]->Size <= 0) {
continue; continue;
} }
if ($raList[$i]->Size < PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) { if ($raList[$i]->Size < \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) {
$iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
+ (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
// Add to SBD // Add to SBD
@ -340,7 +344,7 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
} }
} }
} }
$iSbCnt = floor($this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE); $iSbCnt = floor($this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE);
if ($iSmBlk % $iSbCnt) { if ($iSmBlk % $iSbCnt) {
$iB = $iSbCnt - ($iSmBlk % $iSbCnt); $iB = $iSbCnt - ($iSmBlk % $iSbCnt);
for ($i = 0; $i < $iB; ++$i) { for ($i = 0; $i < $iB; ++$i) {
@ -365,9 +369,9 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
} }
// Adjust for Block // Adjust for Block
$iCnt = count($raList); $iCnt = count($raList);
$iBCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_PPS_SIZE; $iBCnt = $this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_PPS_SIZE;
if ($iCnt % $iBCnt) { if ($iCnt % $iBCnt) {
fwrite($this->_FILEH_, str_repeat("\x00", ($iBCnt - ($iCnt % $iBCnt)) * PHPExcel_Shared_OLE::OLE_PPS_SIZE)); fwrite($this->_FILEH_, str_repeat("\x00", ($iBCnt - ($iCnt % $iBCnt)) * \PHPExcel\Shared\OLE::OLE_PPS_SIZE));
} }
} }
@ -383,8 +387,8 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
{ {
$FILE = $this->_FILEH_; $FILE = $this->_FILEH_;
// Calculate Basic Setting // Calculate Basic Setting
$iBbCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; $iBbCnt = $this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE;
$i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE;
$iBdExL = 0; $iBdExL = 0;
$iAll = $iBsize + $iPpsCnt + $iSbdSize; $iAll = $iBsize + $iPpsCnt + $iSbdSize;

View File

@ -75,13 +75,13 @@ class OLERead
* Read the file * Read the file
* *
* @param $sFileName string Filename * @param $sFileName string Filename
* @throws PHPExcel_Reader_Exception * @throws \PHPExcel\Reader\Exception
*/ */
public function read($sFileName) public function read($sFileName)
{ {
// Check if file exists and is readable // Check if file exists and is readable
if (!is_readable($sFileName)) { if (!is_readable($sFileName)) {
throw new PHPExcel_Reader_Exception("Could not open " . $sFileName . " for reading! File does not exist, or it is not readable."); throw new \PHPExcel\Reader\Exception("Could not open " . $sFileName . " for reading! File does not exist, or it is not readable.");
} }
// Get the file identifier // Get the file identifier
@ -90,7 +90,7 @@ class OLERead
// Check OLE identifier // Check OLE identifier
if ($this->data != self::IDENTIFIER_OLE) { if ($this->data != self::IDENTIFIER_OLE) {
throw new PHPExcel_Reader_Exception('The filename ' . $sFileName . ' is not recognised as an OLE file'); throw new \PHPExcel\Reader\Exception('The filename ' . $sFileName . ' is not recognised as an OLE file');
} }
// Get the file data // Get the file data

View File

@ -681,7 +681,7 @@ class String
if (preg_match('/^'.self::STRING_REGEXP_FRACTION.'$/i', $operand, $match)) { if (preg_match('/^'.self::STRING_REGEXP_FRACTION.'$/i', $operand, $match)) {
$sign = ($match[1] == '-') ? '-' : '+'; $sign = ($match[1] == '-') ? '-' : '+';
$fractionFormula = '='.$sign.$match[2].$sign.$match[3]; $fractionFormula = '='.$sign.$match[2].$sign.$match[3];
$operand = PHPExcel_Calculation::getInstance()->_calculateFormulaValue($fractionFormula); $operand = \PHPExcel\Calculation::getInstance()->_calculateFormulaValue($fractionFormula);
return true; return true;
} }
return false; return false;
@ -709,8 +709,8 @@ class String
} }
/** /**
* Set the decimal separator. Only used by PHPExcel_Style_NumberFormat::toFormattedString() * Set the decimal separator. Only used by \PHPExcel\Style\NumberFormat::toFormattedString()
* to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF * to format output by \PHPExcel\Writer\HTML and \PHPExcel\Writer\PDF
* *
* @param string $pValue Character for decimal separator * @param string $pValue Character for decimal separator
*/ */
@ -741,8 +741,8 @@ class String
} }
/** /**
* Set the thousands separator. Only used by PHPExcel_Style_NumberFormat::toFormattedString() * Set the thousands separator. Only used by \PHPExcel\Style\NumberFormat::toFormattedString()
* to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF * to format output by \PHPExcel\Writer\HTML and \PHPExcel\Writer\PDF
* *
* @param string $pValue Character for thousands separator * @param string $pValue Character for thousands separator
*/ */
@ -773,8 +773,8 @@ class String
} }
/** /**
* Set the currency code. Only used by PHPExcel_Style_NumberFormat::toFormattedString() * Set the currency code. Only used by \PHPExcel\Style\NumberFormat::toFormattedString()
* to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF * to format output by \PHPExcel\Writer\HTML and \PHPExcel\Writer\PDF
* *
* @param string $pValue Character for currency code * @param string $pValue Character for currency code
*/ */

View File

@ -106,16 +106,16 @@ class TimeZone
* Return the Timezone offset used for date/time conversions to/from UST * Return the Timezone offset used for date/time conversions to/from UST
* This requires both the timezone and the calculated date/time to allow for local DST * This requires both the timezone and the calculated date/time to allow for local DST
* *
* @param string $timezone The timezone for finding the adjustment to UST * @param string $timezone The timezone for finding the adjustment to UST
* @param integer $timestamp PHP date/time value * @param integer $timestamp PHP date/time value
* @return integer Number of seconds for timezone adjustment * @return integer Number of seconds for timezone adjustment
* @throws PHPExcel_Exception * @throws \PHPExcel\Exception
*/ */
public static function getTimeZoneAdjustment($timezone, $timestamp) public static function getTimeZoneAdjustment($timezone, $timestamp)
{ {
if ($timezone !== null) { if ($timezone !== null) {
if (!self::_validateTimezone($timezone)) { if (!self::_validateTimezone($timezone)) {
throw new PHPExcel_Exception("Invalid timezone " . $timezone); throw new \PHPExcel\Exception("Invalid timezone " . $timezone);
} }
} else { } else {
$timezone = self::$timezone; $timezone = self::$timezone;
@ -125,7 +125,7 @@ class TimeZone
return 0; return 0;
} }
$objTimezone = new DateTimeZone($timezone); $objTimezone = new \DateTimeZone($timezone);
if (version_compare(PHP_VERSION, '5.3.0') >= 0) { if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
$transitions = $objTimezone->getTransitions($timestamp, $timestamp); $transitions = $objTimezone->getTransitions($timestamp, $timestamp);
} else { } else {

View File

@ -49,7 +49,7 @@ class XMLWriter extends \XMLWriter
private $tempFileName = ''; private $tempFileName = '';
/** /**
* Create a new PHPExcel_Shared_XMLWriter instance * Create a new XMLWriter instance
* *
* @param int $pTemporaryStorage Temporary storage location * @param int $pTemporaryStorage Temporary storage location
* @param string $pTemporaryStorageFolder Temporary storage folder * @param string $pTemporaryStorageFolder Temporary storage folder
@ -62,7 +62,7 @@ class XMLWriter extends \XMLWriter
} else { } else {
// Create temporary filename // Create temporary filename
if ($pTemporaryStorageFolder === null) { if ($pTemporaryStorageFolder === null) {
$pTemporaryStorageFolder = PHPExcel_Shared_File::sys_get_temp_dir(); $pTemporaryStorageFolder = File::sys_get_temp_dir();
} }
$this->tempFileName = @tempnam($pTemporaryStorageFolder, 'xml'); $this->tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Shared; namespace PHPExcel\Shared;
if (!defined('PCLZIP_TEMPORARY_DIR')) { if (!defined('PCLZIP_TEMPORARY_DIR')) {
define('PCLZIP_TEMPORARY_DIR', PHPExcel_Shared_File::sys_get_temp_dir() . DIRECTORY_SEPARATOR); define('PCLZIP_TEMPORARY_DIR', File::sys_get_temp_dir() . DIRECTORY_SEPARATOR);
} }
require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PCLZip/pclzip.lib.php'; require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PCLZip/pclzip.lib.php';
@ -63,7 +63,7 @@ class ZipArchive
*/ */
public function open($fileName) public function open($fileName)
{ {
$this->tempDir = PHPExcel_Shared_File::sys_get_temp_dir(); $this->tempDir = File::sys_get_temp_dir();
$this->zip = new PclZip($fileName); $this->zip = new PclZip($fileName);
return true; return true;
@ -84,6 +84,7 @@ class ZipArchive
* *
* @param string $localname Directory/Name of the file to add to the zip archive * @param string $localname Directory/Name of the file to add to the zip archive
* @param string $contents String of data to add to the zip archive * @param string $contents String of data to add to the zip archive
* @throws \PHPExcel\Writer\Exception
*/ */
public function addFromString($localname, $contents) public function addFromString($localname, $contents)
{ {
@ -95,7 +96,7 @@ class ZipArchive
$res = $this->zip->add($this->tempDir.'/'.$filenameParts["basename"], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]); $res = $this->zip->add($this->tempDir.'/'.$filenameParts["basename"], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]);
if ($res == 0) { if ($res == 0) {
throw new PHPExcel_Writer_Exception("Error zipping files : " . $this->zip->errorInfo(true)); throw new \PHPExcel\Writer\Exception("Error zipping files : " . $this->zip->errorInfo(true));
} }
unlink($this->tempDir.'/'.$filenameParts["basename"]); unlink($this->tempDir.'/'.$filenameParts["basename"]);

View File

@ -73,13 +73,14 @@ class ZipStreamWrapper
* @param string $mode only "r" is supported * @param string $mode only "r" is supported
* @param int $options mask of STREAM_REPORT_ERRORS and STREAM_USE_PATH * @param int $options mask of STREAM_REPORT_ERRORS and STREAM_USE_PATH
* @param string &$openedPath absolute path of the opened stream (out parameter) * @param string &$openedPath absolute path of the opened stream (out parameter)
* @return bool true on success * @return bool true on success
* @throws \PHPExcel\Reader\Exception
*/ */
public function stream_open($path, $mode, $options, &$opened_path) public function stream_open($path, $mode, $options, &$opened_path)
{ {
// Check for mode // Check for mode
if ($mode{0} != 'r') { if ($mode{0} != 'r') {
throw new PHPExcel_Reader_Exception('Mode ' . $mode . ' is not supported. Only read mode is supported.'); throw new \PHPExcel\Reader\Exception('Mode ' . $mode . ' is not supported. Only read mode is supported.');
} }
$pos = strrpos($path, '#'); $pos = strrpos($path, '#');