mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-25 14:56:04 +03:00
Yet more of the psr-2 work
This commit is contained in:
parent
4c8dd00dff
commit
61e81377cb
File diff suppressed because it is too large
Load Diff
@ -41,7 +41,7 @@ class PHPExcel_Chart_Legend
|
||||
const POSITION_TOP = 't';
|
||||
const POSITION_TOPRIGHT = 'tr';
|
||||
|
||||
private static $_positionXLref = array(
|
||||
private static $positionXLref = array(
|
||||
self::xlLegendPositionBottom => self::POSITION_BOTTOM,
|
||||
self::xlLegendPositionCorner => self::POSITION_TOPRIGHT,
|
||||
self::xlLegendPositionCustom => '??',
|
||||
@ -99,7 +99,7 @@ class PHPExcel_Chart_Legend
|
||||
*/
|
||||
public function setPosition($position = self::POSITION_RIGHT)
|
||||
{
|
||||
if (!in_array($position, self::$_positionXLref)) {
|
||||
if (!in_array($position, self::$positionXLref)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ class PHPExcel_Chart_Legend
|
||||
*/
|
||||
public function getPositionXL()
|
||||
{
|
||||
return array_search($this->position, self::$_positionXLref);
|
||||
return array_search($this->position, self::$positionXLref);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -124,11 +124,11 @@ class PHPExcel_Chart_Legend
|
||||
*/
|
||||
public function setPositionXL($positionXL = self::xlLegendPositionRight)
|
||||
{
|
||||
if (!array_key_exists($positionXL, self::$_positionXLref)) {
|
||||
if (!array_key_exists($positionXL, self::$positionXLref)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->position = self::$_positionXLref[$positionXL];
|
||||
$this->position = self::$positionXLref[$positionXL];
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -535,7 +535,7 @@ class PHPExcel_DocumentProperties
|
||||
return strtotime($propertyValue);
|
||||
break;
|
||||
case 'bool': // Boolean
|
||||
return ($propertyValue == 'true') ? True : False;
|
||||
return ($propertyValue == 'true') ? true : false;
|
||||
break;
|
||||
case 'cy': // Currency
|
||||
case 'error': // Error Status Code
|
||||
@ -556,7 +556,8 @@ class PHPExcel_DocumentProperties
|
||||
return $propertyValue;
|
||||
}
|
||||
|
||||
public static function convertPropertyType($propertyType) {
|
||||
public static function convertPropertyType($propertyType)
|
||||
{
|
||||
switch ($propertyType) {
|
||||
case 'i1': // 1-Byte Signed Integer
|
||||
case 'i2': // 2-Byte Signed Integer
|
||||
@ -607,5 +608,4 @@ class PHPExcel_DocumentProperties
|
||||
}
|
||||
return self::PROPERTY_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -32,35 +32,35 @@ class PHPExcel_DocumentSecurity
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_lockRevision;
|
||||
private $lockRevision;
|
||||
|
||||
/**
|
||||
* LockStructure
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_lockStructure;
|
||||
private $lockStructure;
|
||||
|
||||
/**
|
||||
* LockWindows
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_lockWindows;
|
||||
private $lockWindows;
|
||||
|
||||
/**
|
||||
* RevisionsPassword
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_revisionsPassword;
|
||||
private $revisionsPassword;
|
||||
|
||||
/**
|
||||
* WorkbookPassword
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_workbookPassword;
|
||||
private $workbookPassword;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_DocumentSecurity
|
||||
@ -68,11 +68,11 @@ class PHPExcel_DocumentSecurity
|
||||
public function __construct()
|
||||
{
|
||||
// Initialise values
|
||||
$this->_lockRevision = false;
|
||||
$this->_lockStructure = false;
|
||||
$this->_lockWindows = false;
|
||||
$this->_revisionsPassword = '';
|
||||
$this->_workbookPassword = '';
|
||||
$this->lockRevision = false;
|
||||
$this->lockStructure = false;
|
||||
$this->lockWindows = false;
|
||||
$this->revisionsPassword = '';
|
||||
$this->workbookPassword = '';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,9 +82,9 @@ class PHPExcel_DocumentSecurity
|
||||
*/
|
||||
public function isSecurityEnabled()
|
||||
{
|
||||
return $this->_lockRevision ||
|
||||
$this->_lockStructure ||
|
||||
$this->_lockWindows;
|
||||
return $this->lockRevision ||
|
||||
$this->lockStructure ||
|
||||
$this->lockWindows;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,7 +94,7 @@ class PHPExcel_DocumentSecurity
|
||||
*/
|
||||
public function getLockRevision()
|
||||
{
|
||||
return $this->_lockRevision;
|
||||
return $this->lockRevision;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -105,7 +105,7 @@ class PHPExcel_DocumentSecurity
|
||||
*/
|
||||
public function setLockRevision($pValue = false)
|
||||
{
|
||||
$this->_lockRevision = $pValue;
|
||||
$this->lockRevision = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ class PHPExcel_DocumentSecurity
|
||||
*/
|
||||
public function getLockStructure()
|
||||
{
|
||||
return $this->_lockStructure;
|
||||
return $this->lockStructure;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -127,7 +127,7 @@ class PHPExcel_DocumentSecurity
|
||||
*/
|
||||
public function setLockStructure($pValue = false)
|
||||
{
|
||||
$this->_lockStructure = $pValue;
|
||||
$this->lockStructure = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ class PHPExcel_DocumentSecurity
|
||||
*/
|
||||
public function getLockWindows()
|
||||
{
|
||||
return $this->_lockWindows;
|
||||
return $this->lockWindows;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -149,7 +149,7 @@ class PHPExcel_DocumentSecurity
|
||||
*/
|
||||
public function setLockWindows($pValue = false)
|
||||
{
|
||||
$this->_lockWindows = $pValue;
|
||||
$this->lockWindows = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ class PHPExcel_DocumentSecurity
|
||||
*/
|
||||
public function getRevisionsPassword()
|
||||
{
|
||||
return $this->_revisionsPassword;
|
||||
return $this->revisionsPassword;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -175,7 +175,7 @@ class PHPExcel_DocumentSecurity
|
||||
if (!$pAlreadyHashed) {
|
||||
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
|
||||
}
|
||||
$this->_revisionsPassword = $pValue;
|
||||
$this->revisionsPassword = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ class PHPExcel_DocumentSecurity
|
||||
*/
|
||||
public function getWorkbookPassword()
|
||||
{
|
||||
return $this->_workbookPassword;
|
||||
return $this->workbookPassword;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -201,7 +201,7 @@ class PHPExcel_DocumentSecurity
|
||||
if (!$pAlreadyHashed) {
|
||||
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
|
||||
}
|
||||
$this->_workbookPassword = $pValue;
|
||||
$this->workbookPassword = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ class PHPExcel_HashTable
|
||||
// Check if an array was passed
|
||||
if ($pSource == null) {
|
||||
return;
|
||||
} else if (!is_array($pSource)) {
|
||||
} elseif (!is_array($pSource)) {
|
||||
throw new PHPExcel_Exception('Invalid array parameter passed.');
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
class PHPExcel_Helper_HTML
|
||||
{
|
||||
protected static $colourMap = array(
|
||||
'aliceblue' => 'f0f8ff',
|
||||
'aliceblue' => 'f0f8ff',
|
||||
'antiquewhite' => 'faebd7',
|
||||
'antiquewhite1' => 'ffefdb',
|
||||
'antiquewhite2' => 'eedfcc',
|
||||
@ -573,7 +573,8 @@ class PHPExcel_Helper_HTML
|
||||
|
||||
protected $richTextObject;
|
||||
|
||||
protected function initialise() {
|
||||
protected function initialise()
|
||||
{
|
||||
$this->face = $this->size = $this->color = null;
|
||||
$this->bold = $this->italic = $this->underline = $this->superscript = $this->subscript = $this->strikethrough = false;
|
||||
|
||||
@ -582,7 +583,8 @@ class PHPExcel_Helper_HTML
|
||||
$this->stringData = '';
|
||||
}
|
||||
|
||||
public function toRichTextObject($html) {
|
||||
public function toRichTextObject($html)
|
||||
{
|
||||
$this->initialise();
|
||||
|
||||
// Create a new DOM object
|
||||
@ -594,15 +596,17 @@ class PHPExcel_Helper_HTML
|
||||
// Discard excess white space
|
||||
$dom->preserveWhiteSpace = false;
|
||||
|
||||
$this->richTextObject = new PHPExcel_RichText();;
|
||||
$this->richTextObject = new PHPExcel_RichText();
|
||||
$this->parseElements($dom);
|
||||
return $this->richTextObject;
|
||||
}
|
||||
|
||||
protected function buildTextRun() {
|
||||
protected function buildTextRun()
|
||||
{
|
||||
$text = $this->stringData;
|
||||
if (trim($text) === '')
|
||||
if (trim($text) === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$richtextRun = $this->richTextObject->createTextRun($this->stringData);
|
||||
if ($this->face) {
|
||||
@ -612,7 +616,7 @@ class PHPExcel_Helper_HTML
|
||||
$richtextRun->getFont()->setSize($this->size);
|
||||
}
|
||||
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) {
|
||||
$richtextRun->getFont()->setBold(true);
|
||||
@ -635,7 +639,8 @@ class PHPExcel_Helper_HTML
|
||||
$this->stringData = '';
|
||||
}
|
||||
|
||||
protected function rgbToColour($rgb) {
|
||||
protected function rgbToColour($rgb)
|
||||
{
|
||||
preg_match_all('/\d+/', $rgb, $values);
|
||||
foreach ($values[0] as &$value) {
|
||||
$value = str_pad(dechex($value), 2, '0', STR_PAD_LEFT);
|
||||
@ -643,11 +648,13 @@ class PHPExcel_Helper_HTML
|
||||
return implode($values[0]);
|
||||
}
|
||||
|
||||
protected function colourNameLookup($rgb) {
|
||||
protected function colourNameLookup($rgb)
|
||||
{
|
||||
return self::$colourMap[$rgb];
|
||||
}
|
||||
|
||||
protected function startFontTag($tag) {
|
||||
protected function startFontTag($tag)
|
||||
{
|
||||
foreach ($tag->attributes as $attribute) {
|
||||
$attributeName = strtolower($attribute->name);
|
||||
$attributeValue = $attribute->value;
|
||||
@ -666,69 +673,85 @@ class PHPExcel_Helper_HTML
|
||||
}
|
||||
}
|
||||
|
||||
protected function endFontTag() {
|
||||
protected function endFontTag()
|
||||
{
|
||||
$this->face = $this->size = $this->color = null;
|
||||
}
|
||||
|
||||
protected function startBoldTag() {
|
||||
protected function startBoldTag()
|
||||
{
|
||||
$this->bold = true;
|
||||
}
|
||||
|
||||
protected function endBoldTag() {
|
||||
protected function endBoldTag()
|
||||
{
|
||||
$this->bold = false;
|
||||
}
|
||||
|
||||
protected function startItalicTag() {
|
||||
protected function startItalicTag()
|
||||
{
|
||||
$this->italic = true;
|
||||
}
|
||||
|
||||
protected function endItalicTag() {
|
||||
protected function endItalicTag()
|
||||
{
|
||||
$this->italic = false;
|
||||
}
|
||||
|
||||
protected function startUnderlineTag() {
|
||||
protected function startUnderlineTag()
|
||||
{
|
||||
$this->underline = true;
|
||||
}
|
||||
|
||||
protected function endUnderlineTag() {
|
||||
protected function endUnderlineTag()
|
||||
{
|
||||
$this->underline = false;
|
||||
}
|
||||
|
||||
protected function startSubscriptTag() {
|
||||
protected function startSubscriptTag()
|
||||
{
|
||||
$this->subscript = true;
|
||||
}
|
||||
|
||||
protected function endSubscriptTag() {
|
||||
protected function endSubscriptTag()
|
||||
{
|
||||
$this->subscript = false;
|
||||
}
|
||||
|
||||
protected function startSuperscriptTag() {
|
||||
protected function startSuperscriptTag()
|
||||
{
|
||||
$this->superscript = true;
|
||||
}
|
||||
|
||||
protected function endSuperscriptTag() {
|
||||
protected function endSuperscriptTag()
|
||||
{
|
||||
$this->superscript = false;
|
||||
}
|
||||
|
||||
protected function startStrikethruTag() {
|
||||
protected function startStrikethruTag()
|
||||
{
|
||||
$this->strikethrough = true;
|
||||
}
|
||||
|
||||
protected function endStrikethruTag() {
|
||||
protected function endStrikethruTag()
|
||||
{
|
||||
$this->strikethrough = false;
|
||||
}
|
||||
|
||||
protected function breakTag() {
|
||||
protected function breakTag()
|
||||
{
|
||||
$this->stringData .= PHP_EOL;
|
||||
}
|
||||
|
||||
protected function parseTextNode(DOMText $textNode) {
|
||||
protected function parseTextNode(DOMText $textNode)
|
||||
{
|
||||
$domText = preg_replace('/\s+/u', ' ', ltrim($textNode->nodeValue));
|
||||
$this->stringData .= $domText;
|
||||
$this->buildTextRun();
|
||||
}
|
||||
|
||||
protected function handleCallback($element, $callbackTag, $callbacks) {
|
||||
protected function handleCallback($element, $callbackTag, $callbacks)
|
||||
{
|
||||
if (isset($callbacks[$callbackTag])) {
|
||||
$elementHandler = $callbacks[$callbackTag];
|
||||
if (method_exists($this, $elementHandler)) {
|
||||
@ -737,7 +760,8 @@ class PHPExcel_Helper_HTML
|
||||
}
|
||||
}
|
||||
|
||||
protected function parseElementNode(DOMElement $element) {
|
||||
protected function parseElementNode(DOMElement $element)
|
||||
{
|
||||
$callbackTag = strtolower($element->nodeName);
|
||||
$this->stack[] = $callbackTag;
|
||||
|
||||
@ -750,7 +774,8 @@ class PHPExcel_Helper_HTML
|
||||
$this->handleCallback($element, $callbackTag, $this->endTagCallbacks);
|
||||
}
|
||||
|
||||
protected function parseElements(DOMNode $element) {
|
||||
protected function parseElements(DOMNode $element)
|
||||
{
|
||||
foreach ($element->childNodes as $child) {
|
||||
if ($child instanceof DOMText) {
|
||||
$this->parseTextNode($child);
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Shared_OLE_ChainedBlockStream
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,17 +25,6 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Shared_OLE_ChainedBlockStream
|
||||
*
|
||||
* Stream wrapper for reading data stored in an OLE file. Implements methods
|
||||
* for PHP's stream_wrapper_register(). For creating streams using this
|
||||
* wrapper, use PHPExcel_Shared_OLE_PPS_File::getStream().
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Shared_OLE
|
||||
*/
|
||||
class PHPExcel_Shared_OLE_ChainedBlockStream
|
||||
{
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@
|
||||
* @package PHPExcel_Shared_OLE
|
||||
*/
|
||||
class PHPExcel_Shared_OLE_PPS_File extends PHPExcel_Shared_OLE_PPS
|
||||
{
|
||||
{
|
||||
/**
|
||||
* The constructor
|
||||
*
|
||||
|
@ -28,7 +28,7 @@
|
||||
* @package PHPExcel_Shared_OLE
|
||||
*/
|
||||
class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
|
||||
{
|
||||
{
|
||||
|
||||
/**
|
||||
* Directory for temporary files
|
||||
@ -71,10 +71,14 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
|
||||
public function save($filename)
|
||||
{
|
||||
// Initial Setting for saving
|
||||
$this->_BIG_BLOCK_SIZE = pow(2,
|
||||
((isset($this->_BIG_BLOCK_SIZE))? self::_adjust2($this->_BIG_BLOCK_SIZE) : 9));
|
||||
$this->_SMALL_BLOCK_SIZE= pow(2,
|
||||
((isset($this->_SMALL_BLOCK_SIZE))? self::_adjust2($this->_SMALL_BLOCK_SIZE): 6));
|
||||
$this->_BIG_BLOCK_SIZE = pow(
|
||||
2,
|
||||
(isset($this->_BIG_BLOCK_SIZE))? self::_adjust2($this->_BIG_BLOCK_SIZE) : 9
|
||||
);
|
||||
$this->_SMALL_BLOCK_SIZE= pow(
|
||||
2,
|
||||
(isset($this->_SMALL_BLOCK_SIZE))? self::_adjust2($this->_SMALL_BLOCK_SIZE) : 6
|
||||
);
|
||||
|
||||
if (is_resource($filename)) {
|
||||
$this->_FILEH_ = $filename;
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user