Replace var with public, prefix function definitions with public or protected
This commit is contained in:
parent
22c7e1705f
commit
012389ee13
|
|
@ -57,51 +57,51 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR
|
||||||
* The BIFF/Excel version (5).
|
* The BIFF/Excel version (5).
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_BIFF_version = 0x0500;
|
public $_BIFF_version = 0x0500;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The byte order of this architecture. 0 => little endian, 1 => big endian
|
* The byte order of this architecture. 0 => little endian, 1 => big endian
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_byte_order;
|
public $_byte_order;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The string containing the data of the BIFF stream
|
* The string containing the data of the BIFF stream
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_data;
|
public $_data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The size of the data in bytes. Should be the same as strlen($this->_data)
|
* The size of the data in bytes. Should be the same as strlen($this->_data)
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_datasize;
|
public $_datasize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximun length for a BIFF record. See _addContinue()
|
* The maximun length for a BIFF record. See _addContinue()
|
||||||
* @var integer
|
* @var integer
|
||||||
* @see _addContinue()
|
* @see _addContinue()
|
||||||
*/
|
*/
|
||||||
var $_limit;
|
public $_limit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The temporary dir for storing the OLE file
|
* The temporary dir for storing the OLE file
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_tmp_dir;
|
public $_tmp_dir;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The temporary file for storing the OLE file
|
* The temporary file for storing the OLE file
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_tmp_file;
|
public $_tmp_file;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function Spreadsheet_Excel_Writer_BIFFwriter()
|
public function Spreadsheet_Excel_Writer_BIFFwriter()
|
||||||
{
|
{
|
||||||
$this->_byte_order = '';
|
$this->_byte_order = '';
|
||||||
$this->_data = '';
|
$this->_data = '';
|
||||||
|
|
@ -118,7 +118,7 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _setByteOrder()
|
protected function _setByteOrder()
|
||||||
{
|
{
|
||||||
// Check if "pack" gives the required IEEE 64bit float
|
// Check if "pack" gives the required IEEE 64bit float
|
||||||
$teststr = pack("d", 1.2345);
|
$teststr = pack("d", 1.2345);
|
||||||
|
|
@ -136,12 +136,12 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General storage function
|
* General storage public function
|
||||||
*
|
*
|
||||||
* @param string $data binary data to prepend
|
* @param string $data binary data to prepend
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _prepend($data)
|
protected function _prepend($data)
|
||||||
{
|
{
|
||||||
if (strlen($data) > $this->_limit) {
|
if (strlen($data) > $this->_limit) {
|
||||||
$data = $this->_addContinue($data);
|
$data = $this->_addContinue($data);
|
||||||
|
|
@ -151,12 +151,12 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General storage function
|
* General storage public function
|
||||||
*
|
*
|
||||||
* @param string $data binary data to append
|
* @param string $data binary data to append
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _append($data)
|
protected function _append($data)
|
||||||
{
|
{
|
||||||
if (strlen($data) > $this->_limit) {
|
if (strlen($data) > $this->_limit) {
|
||||||
$data = $this->_addContinue($data);
|
$data = $this->_addContinue($data);
|
||||||
|
|
@ -173,7 +173,7 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR
|
||||||
* 0x0010 Worksheet.
|
* 0x0010 Worksheet.
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeBof($type)
|
protected function _storeBof($type)
|
||||||
{
|
{
|
||||||
$record = 0x0809; // Record identifier
|
$record = 0x0809; // Record identifier
|
||||||
|
|
||||||
|
|
@ -202,7 +202,7 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeEof()
|
protected function _storeEof()
|
||||||
{
|
{
|
||||||
$record = 0x000A; // Record identifier
|
$record = 0x000A; // Record identifier
|
||||||
$length = 0x0000; // Number of bytes to follow
|
$length = 0x0000; // Number of bytes to follow
|
||||||
|
|
@ -215,14 +215,14 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR
|
||||||
* Excel 97 the limit is 8228 bytes. Records that are longer than these limits
|
* Excel 97 the limit is 8228 bytes. Records that are longer than these limits
|
||||||
* must be split up into CONTINUE blocks.
|
* must be split up into CONTINUE blocks.
|
||||||
*
|
*
|
||||||
* This function takes a long BIFF record and inserts CONTINUE records as
|
* This public function takes a long BIFF record and inserts CONTINUE records as
|
||||||
* necessary.
|
* necessary.
|
||||||
*
|
*
|
||||||
* @param string $data The original binary data to be written
|
* @param string $data The original binary data to be written
|
||||||
* @return string A very convenient string of continue blocks
|
* @return string A very convenient string of continue blocks
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _addContinue($data)
|
protected function _addContinue($data)
|
||||||
{
|
{
|
||||||
$limit = $this->_limit;
|
$limit = $this->_limit;
|
||||||
$record = 0x003C; // Record identifier
|
$record = 0x003C; // Record identifier
|
||||||
|
|
@ -255,7 +255,7 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR
|
||||||
* @param string $dir The dir to be used as temp dir
|
* @param string $dir The dir to be used as temp dir
|
||||||
* @return true if given dir is valid, false otherwise
|
* @return true if given dir is valid, false otherwise
|
||||||
*/
|
*/
|
||||||
function setTempDir($dir)
|
public function setTempDir($dir)
|
||||||
{
|
{
|
||||||
if (is_dir($dir)) {
|
if (is_dir($dir)) {
|
||||||
$this->_tmp_dir = $dir;
|
$this->_tmp_dir = $dir;
|
||||||
|
|
|
||||||
|
|
@ -48,199 +48,199 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* The index given by the workbook when creating a new format.
|
* The index given by the workbook when creating a new format.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_xf_index;
|
public $_xf_index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Index to the FONT record.
|
* Index to the FONT record.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $font_index;
|
public $font_index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The font name (ASCII).
|
* The font name (ASCII).
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_font_name;
|
public $_font_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Height of font (1/20 of a point)
|
* Height of font (1/20 of a point)
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_size;
|
public $_size;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bold style
|
* Bold style
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_bold;
|
public $_bold;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bit specifiying if the font is italic.
|
* Bit specifiying if the font is italic.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_italic;
|
public $_italic;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Index to the cell's color
|
* Index to the cell's color
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_color;
|
public $_color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The text underline property
|
* The text underline property
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_underline;
|
public $_underline;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bit specifiying if the font has strikeout.
|
* Bit specifiying if the font has strikeout.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_font_strikeout;
|
public $_font_strikeout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bit specifiying if the font has outline.
|
* Bit specifiying if the font has outline.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_font_outline;
|
public $_font_outline;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bit specifiying if the font has shadow.
|
* Bit specifiying if the font has shadow.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_font_shadow;
|
public $_font_shadow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2 bytes specifiying the script type for the font.
|
* 2 bytes specifiying the script type for the font.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_font_script;
|
public $_font_script;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Byte specifiying the font family.
|
* Byte specifiying the font family.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_font_family;
|
public $_font_family;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Byte specifiying the font charset.
|
* Byte specifiying the font charset.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_font_charset;
|
public $_font_charset;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An index (2 bytes) to a FORMAT record (number format).
|
* An index (2 bytes) to a FORMAT record (number format).
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_num_format;
|
public $_num_format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bit specifying if formulas are hidden.
|
* Bit specifying if formulas are hidden.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_hidden;
|
public $_hidden;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bit specifying if the cell is locked.
|
* Bit specifying if the cell is locked.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_locked;
|
public $_locked;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The three bits specifying the text horizontal alignment.
|
* The three bits specifying the text horizontal alignment.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_text_h_align;
|
public $_text_h_align;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bit specifying if the text is wrapped at the right border.
|
* Bit specifying if the text is wrapped at the right border.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_text_wrap;
|
public $_text_wrap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The three bits specifying the text vertical alignment.
|
* The three bits specifying the text vertical alignment.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_text_v_align;
|
public $_text_v_align;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1 bit, apparently not used.
|
* 1 bit, apparently not used.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_text_justlast;
|
public $_text_justlast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The two bits specifying the text rotation.
|
* The two bits specifying the text rotation.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_rotation;
|
public $_rotation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The cell's foreground color.
|
* The cell's foreground color.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_fg_color;
|
public $_fg_color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The cell's background color.
|
* The cell's background color.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_bg_color;
|
public $_bg_color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The cell's background fill pattern.
|
* The cell's background fill pattern.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_pattern;
|
public $_pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Style of the bottom border of the cell
|
* Style of the bottom border of the cell
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_bottom;
|
public $_bottom;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Color of the bottom border of the cell.
|
* Color of the bottom border of the cell.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_bottom_color;
|
public $_bottom_color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Style of the top border of the cell
|
* Style of the top border of the cell
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_top;
|
public $_top;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Color of the top border of the cell.
|
* Color of the top border of the cell.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_top_color;
|
public $_top_color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Style of the left border of the cell
|
* Style of the left border of the cell
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_left;
|
public $_left;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Color of the left border of the cell.
|
* Color of the left border of the cell.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_left_color;
|
public $_left_color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Style of the right border of the cell
|
* Style of the right border of the cell
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_right;
|
public $_right;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Color of the right border of the cell.
|
* Color of the right border of the cell.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_right_color;
|
public $_right_color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|
@ -249,7 +249,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @param integer $index the XF index for the format.
|
* @param integer $index the XF index for the format.
|
||||||
* @param array $properties array with properties to be set on initialization.
|
* @param array $properties array with properties to be set on initialization.
|
||||||
*/
|
*/
|
||||||
function Spreadsheet_Excel_Writer_Format($BIFF_version, $index = 0, $properties = array())
|
public function Spreadsheet_Excel_Writer_Format($BIFF_version, $index = 0, $properties = array())
|
||||||
{
|
{
|
||||||
$this->_xf_index = $index;
|
$this->_xf_index = $index;
|
||||||
$this->_BIFF_version = $BIFF_version;
|
$this->_BIFF_version = $BIFF_version;
|
||||||
|
|
@ -312,7 +312,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @param string $style The type of the XF record ('style' or 'cell').
|
* @param string $style The type of the XF record ('style' or 'cell').
|
||||||
* @return string The XF record
|
* @return string The XF record
|
||||||
*/
|
*/
|
||||||
function getXf($style)
|
public function getXf($style)
|
||||||
{
|
{
|
||||||
// Set the type of the XF record and some of the attributes.
|
// Set the type of the XF record and some of the attributes.
|
||||||
if ($style == 'style') {
|
if ($style == 'style') {
|
||||||
|
|
@ -444,7 +444,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @return string The FONT record
|
* @return string The FONT record
|
||||||
*/
|
*/
|
||||||
function getFont()
|
public function getFont()
|
||||||
{
|
{
|
||||||
$dyHeight = $this->_size * 20; // Height of font (1/20 of a point)
|
$dyHeight = $this->_size * 20; // Height of font (1/20 of a point)
|
||||||
$icv = $this->_color; // Index to color palette
|
$icv = $this->_color; // Index to color palette
|
||||||
|
|
@ -500,7 +500,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @return string A key for this font
|
* @return string A key for this font
|
||||||
*/
|
*/
|
||||||
function getFontKey()
|
public function getFontKey()
|
||||||
{
|
{
|
||||||
$key = "$this->_font_name$this->_size";
|
$key = "$this->_font_name$this->_size";
|
||||||
$key .= "$this->_font_script$this->_underline";
|
$key .= "$this->_font_script$this->_underline";
|
||||||
|
|
@ -516,7 +516,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @return integer The index for the XF record
|
* @return integer The index for the XF record
|
||||||
*/
|
*/
|
||||||
function getXfIndex()
|
public function getXfIndex()
|
||||||
{
|
{
|
||||||
return($this->_xf_index);
|
return($this->_xf_index);
|
||||||
}
|
}
|
||||||
|
|
@ -530,7 +530,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @param string $name_color name of the color (i.e.: 'blue', 'red', etc..). Optional.
|
* @param string $name_color name of the color (i.e.: 'blue', 'red', etc..). Optional.
|
||||||
* @return integer The color index
|
* @return integer The color index
|
||||||
*/
|
*/
|
||||||
function _getColor($name_color = '')
|
protected function _getColor($name_color = '')
|
||||||
{
|
{
|
||||||
$colors = array(
|
$colors = array(
|
||||||
'aqua' => 0x07,
|
'aqua' => 0x07,
|
||||||
|
|
@ -583,7 +583,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $location alignment for the cell ('left', 'right', etc...).
|
* @param string $location alignment for the cell ('left', 'right', etc...).
|
||||||
*/
|
*/
|
||||||
function setAlign($location)
|
public function setAlign($location)
|
||||||
{
|
{
|
||||||
if (preg_match("/\d/",$location)) {
|
if (preg_match("/\d/",$location)) {
|
||||||
return; // Ignore numbers
|
return; // Ignore numbers
|
||||||
|
|
@ -641,14 +641,14 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $location alignment for the cell ('left', 'right', etc...).
|
* @param string $location alignment for the cell ('left', 'right', etc...).
|
||||||
*/
|
*/
|
||||||
function setHAlign($location)
|
public function setHAlign($location)
|
||||||
{
|
{
|
||||||
if (preg_match("/\d/",$location)) {
|
if (preg_match("/\d/",$location)) {
|
||||||
return; // Ignore numbers
|
return; // Ignore numbers
|
||||||
}
|
}
|
||||||
|
|
||||||
$location = strtolower($location);
|
$location = strtolower($location);
|
||||||
|
|
||||||
if ($location == 'left') {
|
if ($location == 'left') {
|
||||||
$this->_text_h_align = 1;
|
$this->_text_h_align = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -681,14 +681,14 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $location alignment for the cell ('top', 'vleft', 'vright', etc...).
|
* @param string $location alignment for the cell ('top', 'vleft', 'vright', etc...).
|
||||||
*/
|
*/
|
||||||
function setVAlign($location)
|
public function setVAlign($location)
|
||||||
{
|
{
|
||||||
if (preg_match("/\d/",$location)) {
|
if (preg_match("/\d/",$location)) {
|
||||||
return; // Ignore numbers
|
return; // Ignore numbers
|
||||||
}
|
}
|
||||||
|
|
||||||
$location = strtolower($location);
|
$location = strtolower($location);
|
||||||
|
|
||||||
if ($location == 'top') {
|
if ($location == 'top') {
|
||||||
$this->_text_v_align = 0;
|
$this->_text_v_align = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -714,7 +714,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setMerge()
|
public function setMerge()
|
||||||
{
|
{
|
||||||
$this->setAlign('merge');
|
$this->setAlign('merge');
|
||||||
}
|
}
|
||||||
|
|
@ -729,7 +729,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
1 maps to 700 (bold text). Valid range is: 100-1000.
|
1 maps to 700 (bold text). Valid range is: 100-1000.
|
||||||
It's Optional, default is 1 (bold).
|
It's Optional, default is 1 (bold).
|
||||||
*/
|
*/
|
||||||
function setBold($weight = 1)
|
public function setBold($weight = 1)
|
||||||
{
|
{
|
||||||
if ($weight == 1) {
|
if ($weight == 1) {
|
||||||
$weight = 0x2BC; // Bold text
|
$weight = 0x2BC; // Bold text
|
||||||
|
|
@ -757,7 +757,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $style style of the cell border. 1 => thin, 2 => thick.
|
* @param integer $style style of the cell border. 1 => thin, 2 => thick.
|
||||||
*/
|
*/
|
||||||
function setBottom($style)
|
public function setBottom($style)
|
||||||
{
|
{
|
||||||
$this->_bottom = $style;
|
$this->_bottom = $style;
|
||||||
}
|
}
|
||||||
|
|
@ -768,7 +768,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $style style of the cell top border. 1 => thin, 2 => thick.
|
* @param integer $style style of the cell top border. 1 => thin, 2 => thick.
|
||||||
*/
|
*/
|
||||||
function setTop($style)
|
public function setTop($style)
|
||||||
{
|
{
|
||||||
$this->_top = $style;
|
$this->_top = $style;
|
||||||
}
|
}
|
||||||
|
|
@ -779,7 +779,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $style style of the cell left border. 1 => thin, 2 => thick.
|
* @param integer $style style of the cell left border. 1 => thin, 2 => thick.
|
||||||
*/
|
*/
|
||||||
function setLeft($style)
|
public function setLeft($style)
|
||||||
{
|
{
|
||||||
$this->_left = $style;
|
$this->_left = $style;
|
||||||
}
|
}
|
||||||
|
|
@ -790,7 +790,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $style style of the cell right border. 1 => thin, 2 => thick.
|
* @param integer $style style of the cell right border. 1 => thin, 2 => thick.
|
||||||
*/
|
*/
|
||||||
function setRight($style)
|
public function setRight($style)
|
||||||
{
|
{
|
||||||
$this->_right = $style;
|
$this->_right = $style;
|
||||||
}
|
}
|
||||||
|
|
@ -802,7 +802,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $style style to apply for all cell borders. 1 => thin, 2 => thick.
|
* @param integer $style style to apply for all cell borders. 1 => thin, 2 => thick.
|
||||||
*/
|
*/
|
||||||
function setBorder($style)
|
public function setBorder($style)
|
||||||
{
|
{
|
||||||
$this->setBottom($style);
|
$this->setBottom($style);
|
||||||
$this->setTop($style);
|
$this->setTop($style);
|
||||||
|
|
@ -822,7 +822,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @param mixed $color The color we are setting. Either a string (like 'blue'),
|
* @param mixed $color The color we are setting. Either a string (like 'blue'),
|
||||||
* or an integer (range is [8...63]).
|
* or an integer (range is [8...63]).
|
||||||
*/
|
*/
|
||||||
function setBorderColor($color)
|
public function setBorderColor($color)
|
||||||
{
|
{
|
||||||
$this->setBottomColor($color);
|
$this->setBottomColor($color);
|
||||||
$this->setTopColor($color);
|
$this->setTopColor($color);
|
||||||
|
|
@ -836,7 +836,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
||||||
*/
|
*/
|
||||||
function setBottomColor($color)
|
public function setBottomColor($color)
|
||||||
{
|
{
|
||||||
$value = $this->_getColor($color);
|
$value = $this->_getColor($color);
|
||||||
$this->_bottom_color = $value;
|
$this->_bottom_color = $value;
|
||||||
|
|
@ -848,7 +848,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
||||||
*/
|
*/
|
||||||
function setTopColor($color)
|
public function setTopColor($color)
|
||||||
{
|
{
|
||||||
$value = $this->_getColor($color);
|
$value = $this->_getColor($color);
|
||||||
$this->_top_color = $value;
|
$this->_top_color = $value;
|
||||||
|
|
@ -860,7 +860,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
||||||
*/
|
*/
|
||||||
function setLeftColor($color)
|
public function setLeftColor($color)
|
||||||
{
|
{
|
||||||
$value = $this->_getColor($color);
|
$value = $this->_getColor($color);
|
||||||
$this->_left_color = $value;
|
$this->_left_color = $value;
|
||||||
|
|
@ -872,7 +872,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
||||||
*/
|
*/
|
||||||
function setRightColor($color)
|
public function setRightColor($color)
|
||||||
{
|
{
|
||||||
$value = $this->_getColor($color);
|
$value = $this->_getColor($color);
|
||||||
$this->_right_color = $value;
|
$this->_right_color = $value;
|
||||||
|
|
@ -885,7 +885,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
||||||
*/
|
*/
|
||||||
function setFgColor($color)
|
public function setFgColor($color)
|
||||||
{
|
{
|
||||||
$value = $this->_getColor($color);
|
$value = $this->_getColor($color);
|
||||||
$this->_fg_color = $value;
|
$this->_fg_color = $value;
|
||||||
|
|
@ -900,7 +900,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
||||||
*/
|
*/
|
||||||
function setBgColor($color)
|
public function setBgColor($color)
|
||||||
{
|
{
|
||||||
$value = $this->_getColor($color);
|
$value = $this->_getColor($color);
|
||||||
$this->_bg_color = $value;
|
$this->_bg_color = $value;
|
||||||
|
|
@ -915,7 +915,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]).
|
||||||
*/
|
*/
|
||||||
function setColor($color)
|
public function setColor($color)
|
||||||
{
|
{
|
||||||
$value = $this->_getColor($color);
|
$value = $this->_getColor($color);
|
||||||
$this->_color = $value;
|
$this->_color = $value;
|
||||||
|
|
@ -928,7 +928,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @param integer $arg Optional. Defaults to 1. Meaningful values are: 0-18,
|
* @param integer $arg Optional. Defaults to 1. Meaningful values are: 0-18,
|
||||||
* 0 meaning no background.
|
* 0 meaning no background.
|
||||||
*/
|
*/
|
||||||
function setPattern($arg = 1)
|
public function setPattern($arg = 1)
|
||||||
{
|
{
|
||||||
$this->_pattern = $arg;
|
$this->_pattern = $arg;
|
||||||
}
|
}
|
||||||
|
|
@ -940,7 +940,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @param integer $underline The value for underline. Possible values are:
|
* @param integer $underline The value for underline. Possible values are:
|
||||||
* 1 => underline, 2 => double underline.
|
* 1 => underline, 2 => double underline.
|
||||||
*/
|
*/
|
||||||
function setUnderline($underline)
|
public function setUnderline($underline)
|
||||||
{
|
{
|
||||||
$this->_underline = $underline;
|
$this->_underline = $underline;
|
||||||
}
|
}
|
||||||
|
|
@ -950,7 +950,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setItalic()
|
public function setItalic()
|
||||||
{
|
{
|
||||||
$this->_italic = 1;
|
$this->_italic = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -961,7 +961,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $size The font size (in pixels I think).
|
* @param integer $size The font size (in pixels I think).
|
||||||
*/
|
*/
|
||||||
function setSize($size)
|
public function setSize($size)
|
||||||
{
|
{
|
||||||
$this->_size = $size;
|
$this->_size = $size;
|
||||||
}
|
}
|
||||||
|
|
@ -971,7 +971,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setTextWrap()
|
public function setTextWrap()
|
||||||
{
|
{
|
||||||
$this->_text_wrap = 1;
|
$this->_text_wrap = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -983,7 +983,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @param integer $angle The rotation angle for the text (clockwise). Possible
|
* @param integer $angle The rotation angle for the text (clockwise). Possible
|
||||||
values are: 0, 90, 270 and -1 for stacking top-to-bottom.
|
values are: 0, 90, 270 and -1 for stacking top-to-bottom.
|
||||||
*/
|
*/
|
||||||
function setTextRotation($angle)
|
public function setTextRotation($angle)
|
||||||
{
|
{
|
||||||
switch ($angle)
|
switch ($angle)
|
||||||
{
|
{
|
||||||
|
|
@ -1027,7 +1027,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $num_format The numeric format.
|
* @param integer $num_format The numeric format.
|
||||||
*/
|
*/
|
||||||
function setNumFormat($num_format)
|
public function setNumFormat($num_format)
|
||||||
{
|
{
|
||||||
$this->_num_format = $num_format;
|
$this->_num_format = $num_format;
|
||||||
}
|
}
|
||||||
|
|
@ -1037,7 +1037,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setStrikeOut()
|
public function setStrikeOut()
|
||||||
{
|
{
|
||||||
$this->_font_strikeout = 1;
|
$this->_font_strikeout = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -1047,7 +1047,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setOutLine()
|
public function setOutLine()
|
||||||
{
|
{
|
||||||
$this->_font_outline = 1;
|
$this->_font_outline = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -1057,7 +1057,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setShadow()
|
public function setShadow()
|
||||||
{
|
{
|
||||||
$this->_font_shadow = 1;
|
$this->_font_shadow = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -1069,7 +1069,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @param integer $script The value for script type. Possible values are:
|
* @param integer $script The value for script type. Possible values are:
|
||||||
* 1 => superscript, 2 => subscript.
|
* 1 => superscript, 2 => subscript.
|
||||||
*/
|
*/
|
||||||
function setScript($script)
|
public function setScript($script)
|
||||||
{
|
{
|
||||||
$this->_font_script = $script;
|
$this->_font_script = $script;
|
||||||
}
|
}
|
||||||
|
|
@ -1079,7 +1079,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setLocked()
|
public function setLocked()
|
||||||
{
|
{
|
||||||
$this->_locked = 1;
|
$this->_locked = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -1089,7 +1089,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setUnLocked()
|
public function setUnLocked()
|
||||||
{
|
{
|
||||||
$this->_locked = 0;
|
$this->_locked = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1101,7 +1101,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
|
||||||
* @param string $fontfamily The font family name. Possible values are:
|
* @param string $fontfamily The font family name. Possible values are:
|
||||||
* 'Times New Roman', 'Arial', 'Courier'.
|
* 'Times New Roman', 'Arial', 'Courier'.
|
||||||
*/
|
*/
|
||||||
function setFontFamily($font_family)
|
public function setFontFamily($font_family)
|
||||||
{
|
{
|
||||||
$this->_font_name = $font_family;
|
$this->_font_name = $font_family;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -113,55 +113,55 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* The index of the character we are currently looking at
|
* The index of the character we are currently looking at
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_current_char;
|
public $_current_char;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The token we are working on.
|
* The token we are working on.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_current_token;
|
public $_current_token;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The formula to parse
|
* The formula to parse
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_formula;
|
public $_formula;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The character ahead of the current char
|
* The character ahead of the current char
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_lookahead;
|
public $_lookahead;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parse tree to be generated
|
* The parse tree to be generated
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_parse_tree;
|
public $_parse_tree;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The byte order. 1 => big endian, 0 => little endian.
|
* The byte order. 1 => big endian, 0 => little endian.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_byte_order;
|
public $_byte_order;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of external sheets
|
* Array of external sheets
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $_ext_sheets;
|
public $_ext_sheets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of sheet references in the form of REF structures
|
* Array of sheet references in the form of REF structures
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $_references;
|
public $_references;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The BIFF version for the workbook
|
* The BIFF version for the workbook
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_BIFF_version;
|
public $_BIFF_version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class constructor
|
* The class constructor
|
||||||
|
|
@ -169,7 +169,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param integer $byte_order The byte order (Little endian or Big endian) of the architecture
|
* @param integer $byte_order The byte order (Little endian or Big endian) of the architecture
|
||||||
(optional). 1 => big endian, 0 (default) little endian.
|
(optional). 1 => big endian, 0 (default) little endian.
|
||||||
*/
|
*/
|
||||||
function Spreadsheet_Excel_Writer_Parser($byte_order, $biff_version)
|
public function Spreadsheet_Excel_Writer_Parser($byte_order, $biff_version)
|
||||||
{
|
{
|
||||||
$this->_current_char = 0;
|
$this->_current_char = 0;
|
||||||
$this->_BIFF_version = $biff_version;
|
$this->_BIFF_version = $biff_version;
|
||||||
|
|
@ -177,18 +177,18 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
$this->_formula = ''; // The formula to parse.
|
$this->_formula = ''; // The formula to parse.
|
||||||
$this->_lookahead = ''; // The character ahead of the current char.
|
$this->_lookahead = ''; // The character ahead of the current char.
|
||||||
$this->_parse_tree = ''; // The parse tree to be generated.
|
$this->_parse_tree = ''; // The parse tree to be generated.
|
||||||
$this->_initializeHashes(); // Initialize the hashes: ptg's and function's ptg's
|
$this->_initializeHashes(); // Initialize the hashes: ptg's and public function's ptg's
|
||||||
$this->_byte_order = $byte_order; // Little Endian or Big Endian
|
$this->_byte_order = $byte_order; // Little Endian or Big Endian
|
||||||
$this->_ext_sheets = array();
|
$this->_ext_sheets = array();
|
||||||
$this->_references = array();
|
$this->_references = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the ptg and function hashes.
|
* Initialize the ptg and public function hashes.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _initializeHashes()
|
protected function _initializeHashes()
|
||||||
{
|
{
|
||||||
// The Excel ptg indices
|
// The Excel ptg indices
|
||||||
$this->ptg = array(
|
$this->ptg = array(
|
||||||
|
|
@ -292,18 +292,18 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
// Thanks to Michael Meeks and Gnumeric for the initial arg values.
|
// Thanks to Michael Meeks and Gnumeric for the initial arg values.
|
||||||
//
|
//
|
||||||
// The following hash was generated by "function_locale.pl" in the distro.
|
// The following hash was generated by "function_locale.pl" in the distro.
|
||||||
// Refer to function_locale.pl for non-English function names.
|
// Refer to function_locale.pl for non-English public function names.
|
||||||
//
|
//
|
||||||
// The array elements are as follow:
|
// The array elements are as follow:
|
||||||
// ptg: The Excel function ptg code.
|
// ptg: The Excel public function ptg code.
|
||||||
// args: The number of arguments that the function takes:
|
// args: The number of arguments that the public function takes:
|
||||||
// >=0 is a fixed number of arguments.
|
// >=0 is a fixed number of arguments.
|
||||||
// -1 is a variable number of arguments.
|
// -1 is a variable number of arguments.
|
||||||
// class: The reference, value or array class of the function args.
|
// class: The reference, value or array class of the public function args.
|
||||||
// vol: The function is volatile.
|
// vol: The public function is volatile.
|
||||||
//
|
//
|
||||||
$this->_functions = array(
|
$this->_functions = array(
|
||||||
// function ptg args class vol
|
// public function ptg args class vol
|
||||||
'COUNT' => array( 0, -1, 0, 0 ),
|
'COUNT' => array( 0, -1, 0, 0 ),
|
||||||
'IF' => array( 1, -1, 1, 0 ),
|
'IF' => array( 1, -1, 1, 0 ),
|
||||||
'ISNA' => array( 2, 1, 1, 0 ),
|
'ISNA' => array( 2, 1, 1, 0 ),
|
||||||
|
|
@ -540,7 +540,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @return mixed the converted token on success. PEAR_Error if the token
|
* @return mixed the converted token on success. PEAR_Error if the token
|
||||||
* is not recognized
|
* is not recognized
|
||||||
*/
|
*/
|
||||||
function _convert($token)
|
protected function _convert($token)
|
||||||
{
|
{
|
||||||
if (preg_match("/^\"[^\"]{0,255}\"$/", $token)) {
|
if (preg_match("/^\"[^\"]{0,255}\"$/", $token)) {
|
||||||
return $this->_convertString($token);
|
return $this->_convertString($token);
|
||||||
|
|
@ -600,7 +600,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @access private
|
* @access private
|
||||||
* @param mixed $num an integer or double for conversion to its ptg value
|
* @param mixed $num an integer or double for conversion to its ptg value
|
||||||
*/
|
*/
|
||||||
function _convertNumber($num)
|
protected function _convertNumber($num)
|
||||||
{
|
{
|
||||||
// Integer in the range 0..2**16-1
|
// Integer in the range 0..2**16-1
|
||||||
if ((preg_match("/^\d+$/", $num)) and ($num <= 65535)) {
|
if ((preg_match("/^\d+$/", $num)) and ($num <= 65535)) {
|
||||||
|
|
@ -621,7 +621,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @return mixed the converted token on success. PEAR_Error if the string
|
* @return mixed the converted token on success. PEAR_Error if the string
|
||||||
* is longer than 255 characters.
|
* is longer than 255 characters.
|
||||||
*/
|
*/
|
||||||
function _convertString($string)
|
protected function _convertString($string)
|
||||||
{
|
{
|
||||||
// chop away beggining and ending quotes
|
// chop away beggining and ending quotes
|
||||||
$string = substr($string, 1, strlen($string) - 2);
|
$string = substr($string, 1, strlen($string) - 2);
|
||||||
|
|
@ -638,15 +638,15 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a function to a ptgFunc or ptgFuncVarV depending on the number of
|
* Convert a public function to a ptgFunc or ptgFuncVarV depending on the number of
|
||||||
* args that it takes.
|
* args that it takes.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @param string $token The name of the function for convertion to ptg value.
|
* @param string $token The name of the public function for convertion to ptg value.
|
||||||
* @param integer $num_args The number of arguments the function receives.
|
* @param integer $num_args The number of arguments the public function receives.
|
||||||
* @return string The packed ptg for the function
|
* @return string The packed ptg for the public function
|
||||||
*/
|
*/
|
||||||
function _convertFunction($token, $num_args)
|
protected function _convertFunction($token, $num_args)
|
||||||
{
|
{
|
||||||
$args = $this->_functions[$token][1];
|
$args = $this->_functions[$token][1];
|
||||||
$volatile = $this->_functions[$token][3];
|
$volatile = $this->_functions[$token][3];
|
||||||
|
|
@ -667,7 +667,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @access private
|
* @access private
|
||||||
* @param string $range An Excel range in the A1:A2 or A1..A2 format.
|
* @param string $range An Excel range in the A1:A2 or A1..A2 format.
|
||||||
*/
|
*/
|
||||||
function _convertRange2d($range, $class=0)
|
protected function _convertRange2d($range, $class=0)
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO: possible class value 0,1,2 check Formula.pm
|
// TODO: possible class value 0,1,2 check Formula.pm
|
||||||
|
|
@ -716,7 +716,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param string $token An Excel range in the Sheet1!A1:A2 format.
|
* @param string $token An Excel range in the Sheet1!A1:A2 format.
|
||||||
* @return mixed The packed ptgArea3d token on success, PEAR_Error on failure.
|
* @return mixed The packed ptgArea3d token on success, PEAR_Error on failure.
|
||||||
*/
|
*/
|
||||||
function _convertRange3d($token)
|
protected function _convertRange3d($token)
|
||||||
{
|
{
|
||||||
$class = 2; // as far as I know, this is magick.
|
$class = 2; // as far as I know, this is magick.
|
||||||
|
|
||||||
|
|
@ -780,7 +780,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param string $cell An Excel cell reference
|
* @param string $cell An Excel cell reference
|
||||||
* @return string The cell in packed() format with the corresponding ptg
|
* @return string The cell in packed() format with the corresponding ptg
|
||||||
*/
|
*/
|
||||||
function _convertRef2d($cell)
|
protected function _convertRef2d($cell)
|
||||||
{
|
{
|
||||||
$class = 2; // as far as I know, this is magick.
|
$class = 2; // as far as I know, this is magick.
|
||||||
|
|
||||||
|
|
@ -813,7 +813,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param string $cell An Excel cell reference
|
* @param string $cell An Excel cell reference
|
||||||
* @return mixed The packed ptgRef3d token on success, PEAR_Error on failure.
|
* @return mixed The packed ptgRef3d token on success, PEAR_Error on failure.
|
||||||
*/
|
*/
|
||||||
function _convertRef3d($cell)
|
protected function _convertRef3d($cell)
|
||||||
{
|
{
|
||||||
$class = 2; // as far as I know, this is magick.
|
$class = 2; // as far as I know, this is magick.
|
||||||
|
|
||||||
|
|
@ -858,7 +858,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param string $ext_ref The name of the external reference
|
* @param string $ext_ref The name of the external reference
|
||||||
* @return string The reference index in packed() format
|
* @return string The reference index in packed() format
|
||||||
*/
|
*/
|
||||||
function _packExtRef($ext_ref)
|
protected function _packExtRef($ext_ref)
|
||||||
{
|
{
|
||||||
$ext_ref = preg_replace("/^'/", '', $ext_ref); // Remove leading ' if any.
|
$ext_ref = preg_replace("/^'/", '', $ext_ref); // Remove leading ' if any.
|
||||||
$ext_ref = preg_replace("/'$/", '', $ext_ref); // Remove trailing ' if any.
|
$ext_ref = preg_replace("/'$/", '', $ext_ref); // Remove trailing ' if any.
|
||||||
|
|
@ -904,7 +904,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @return mixed The reference index in packed() format on success,
|
* @return mixed The reference index in packed() format on success,
|
||||||
* PEAR_Error on failure
|
* PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function _getRefIndex($ext_ref)
|
protected function _getRefIndex($ext_ref)
|
||||||
{
|
{
|
||||||
$ext_ref = preg_replace("/^'/", '', $ext_ref); // Remove leading ' if any.
|
$ext_ref = preg_replace("/^'/", '', $ext_ref); // Remove leading ' if any.
|
||||||
$ext_ref = preg_replace("/'$/", '', $ext_ref); // Remove trailing ' if any.
|
$ext_ref = preg_replace("/'$/", '', $ext_ref); // Remove trailing ' if any.
|
||||||
|
|
@ -962,7 +962,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @access private
|
* @access private
|
||||||
* @return integer The sheet index, -1 if the sheet was not found
|
* @return integer The sheet index, -1 if the sheet was not found
|
||||||
*/
|
*/
|
||||||
function _getSheetIndex($sheet_name)
|
protected function _getSheetIndex($sheet_name)
|
||||||
{
|
{
|
||||||
if (!isset($this->_ext_sheets[$sheet_name])) {
|
if (!isset($this->_ext_sheets[$sheet_name])) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -981,7 +981,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param string $name The name of the worksheet being added
|
* @param string $name The name of the worksheet being added
|
||||||
* @param integer $index The index of the worksheet being added
|
* @param integer $index The index of the worksheet being added
|
||||||
*/
|
*/
|
||||||
function setExtSheet($name, $index)
|
public function setExtSheet($name, $index)
|
||||||
{
|
{
|
||||||
$this->_ext_sheets[$name] = $index;
|
$this->_ext_sheets[$name] = $index;
|
||||||
}
|
}
|
||||||
|
|
@ -993,7 +993,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param string $cell The Excel cell reference to be packed
|
* @param string $cell The Excel cell reference to be packed
|
||||||
* @return array Array containing the row and column in packed() format
|
* @return array Array containing the row and column in packed() format
|
||||||
*/
|
*/
|
||||||
function _cellToPackedRowcol($cell)
|
protected function _cellToPackedRowcol($cell)
|
||||||
{
|
{
|
||||||
$cell = strtoupper($cell);
|
$cell = strtoupper($cell);
|
||||||
list($row, $col, $row_rel, $col_rel) = $this->_cellToRowcol($cell);
|
list($row, $col, $row_rel, $col_rel) = $this->_cellToRowcol($cell);
|
||||||
|
|
@ -1028,7 +1028,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param string $range The Excel range to be packed
|
* @param string $range The Excel range to be packed
|
||||||
* @return array Array containing (row1,col1,row2,col2) in packed() format
|
* @return array Array containing (row1,col1,row2,col2) in packed() format
|
||||||
*/
|
*/
|
||||||
function _rangeToPackedRange($range)
|
protected function _rangeToPackedRange($range)
|
||||||
{
|
{
|
||||||
preg_match('/(\$)?(\d+)\:(\$)?(\d+)/', $range, $match);
|
preg_match('/(\$)?(\d+)\:(\$)?(\d+)/', $range, $match);
|
||||||
// return absolute rows if there is a $ in the ref
|
// return absolute rows if there is a $ in the ref
|
||||||
|
|
@ -1075,7 +1075,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param string $cell The Excel cell reference in A1 format.
|
* @param string $cell The Excel cell reference in A1 format.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function _cellToRowcol($cell)
|
protected function _cellToRowcol($cell)
|
||||||
{
|
{
|
||||||
preg_match('/(\$)?([A-I]?[A-Z])(\$)?(\d+)/',$cell,$match);
|
preg_match('/(\$)?([A-I]?[A-Z])(\$)?(\d+)/',$cell,$match);
|
||||||
// return absolute column if there is a $ in the ref
|
// return absolute column if there is a $ in the ref
|
||||||
|
|
@ -1105,7 +1105,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _advance()
|
protected function _advance()
|
||||||
{
|
{
|
||||||
$i = $this->_current_char;
|
$i = $this->_current_char;
|
||||||
$formula_length = strlen($this->_formula);
|
$formula_length = strlen($this->_formula);
|
||||||
|
|
@ -1155,7 +1155,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param mixed $token The token to check.
|
* @param mixed $token The token to check.
|
||||||
* @return mixed The checked token or false on failure
|
* @return mixed The checked token or false on failure
|
||||||
*/
|
*/
|
||||||
function _match($token)
|
protected function _match($token)
|
||||||
{
|
{
|
||||||
switch($token) {
|
switch($token) {
|
||||||
case SPREADSHEET_EXCEL_WRITER_ADD:
|
case SPREADSHEET_EXCEL_WRITER_ADD:
|
||||||
|
|
@ -1213,7 +1213,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
default:
|
default:
|
||||||
// if it's a reference
|
// if it's a reference
|
||||||
if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/',$token) and
|
if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/',$token) and
|
||||||
!preg_match("/[0-9]/",$this->_lookahead) and
|
!preg_match("/[0-9]/",$this->_lookahead) and
|
||||||
($this->_lookahead != ':') and ($this->_lookahead != '.') and
|
($this->_lookahead != ':') and ($this->_lookahead != '.') and
|
||||||
($this->_lookahead != '!'))
|
($this->_lookahead != '!'))
|
||||||
{
|
{
|
||||||
|
|
@ -1234,13 +1234,13 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// if it's a range (A1:A2)
|
// if it's a range (A1:A2)
|
||||||
elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$token) and
|
elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$token) and
|
||||||
!preg_match("/[0-9]/",$this->_lookahead))
|
!preg_match("/[0-9]/",$this->_lookahead))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// if it's a range (A1..A2)
|
// if it's a range (A1..A2)
|
||||||
elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$token) and
|
elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$token) and
|
||||||
!preg_match("/[0-9]/",$this->_lookahead))
|
!preg_match("/[0-9]/",$this->_lookahead))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
|
|
@ -1258,7 +1258,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// If it's a number (check that it's not a sheet name or range)
|
// If it's a number (check that it's not a sheet name or range)
|
||||||
elseif (is_numeric($token) and
|
elseif (is_numeric($token) and
|
||||||
(!is_numeric($token.$this->_lookahead) or ($this->_lookahead == '')) and
|
(!is_numeric($token.$this->_lookahead) or ($this->_lookahead == '')) and
|
||||||
($this->_lookahead != '!') and ($this->_lookahead != ':'))
|
($this->_lookahead != '!') and ($this->_lookahead != ':'))
|
||||||
{
|
{
|
||||||
|
|
@ -1269,7 +1269,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// if it's a function call
|
// if it's a public function call
|
||||||
elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$token) and ($this->_lookahead == "("))
|
elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$token) and ($this->_lookahead == "("))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
|
|
@ -1286,7 +1286,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* sign (=).
|
* sign (=).
|
||||||
* @return mixed true on success, PEAR_Error on failure
|
* @return mixed true on success, PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function parse($formula)
|
public function parse($formula)
|
||||||
{
|
{
|
||||||
$this->_current_char = 0;
|
$this->_current_char = 0;
|
||||||
$this->_formula = $formula;
|
$this->_formula = $formula;
|
||||||
|
|
@ -1306,7 +1306,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @access private
|
* @access private
|
||||||
* @return mixed The parsed ptg'd tree on success, PEAR_Error on failure
|
* @return mixed The parsed ptg'd tree on success, PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function _condition()
|
protected function _condition()
|
||||||
{
|
{
|
||||||
$result = $this->_expression();
|
$result = $this->_expression();
|
||||||
if (PEAR::isError($result)) {
|
if (PEAR::isError($result)) {
|
||||||
|
|
@ -1374,7 +1374,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @access private
|
* @access private
|
||||||
* @return mixed The parsed ptg'd tree on success, PEAR_Error on failure
|
* @return mixed The parsed ptg'd tree on success, PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function _expression()
|
protected function _expression()
|
||||||
{
|
{
|
||||||
// If it's a string return a string node
|
// If it's a string return a string node
|
||||||
if (preg_match("/^\"[^\"]{0,255}\"$/", $this->_current_token)) {
|
if (preg_match("/^\"[^\"]{0,255}\"$/", $this->_current_token)) {
|
||||||
|
|
@ -1415,14 +1415,14 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function just introduces a ptgParen element in the tree, so that Excel
|
* This public function just introduces a ptgParen element in the tree, so that Excel
|
||||||
* doesn't get confused when working with a parenthesized formula afterwards.
|
* doesn't get confused when working with a parenthesized formula afterwards.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @see _fact()
|
* @see _fact()
|
||||||
* @return array The parsed ptg'd tree
|
* @return array The parsed ptg'd tree
|
||||||
*/
|
*/
|
||||||
function _parenthesizedExpression()
|
protected function _parenthesizedExpression()
|
||||||
{
|
{
|
||||||
$result = $this->_createTree('ptgParen', $this->_expression(), '');
|
$result = $this->_createTree('ptgParen', $this->_expression(), '');
|
||||||
return $result;
|
return $result;
|
||||||
|
|
@ -1435,7 +1435,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @access private
|
* @access private
|
||||||
* @return mixed The parsed ptg'd tree on success, PEAR_Error on failure
|
* @return mixed The parsed ptg'd tree on success, PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function _term()
|
protected function _term()
|
||||||
{
|
{
|
||||||
$result = $this->_fact();
|
$result = $this->_fact();
|
||||||
if (PEAR::isError($result)) {
|
if (PEAR::isError($result)) {
|
||||||
|
|
@ -1474,7 +1474,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @access private
|
* @access private
|
||||||
* @return mixed The parsed ptg'd tree on success, PEAR_Error on failure
|
* @return mixed The parsed ptg'd tree on success, PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function _fact()
|
protected function _fact()
|
||||||
{
|
{
|
||||||
if ($this->_current_token == SPREADSHEET_EXCEL_WRITER_OPEN) {
|
if ($this->_current_token == SPREADSHEET_EXCEL_WRITER_OPEN) {
|
||||||
$this->_advance(); // eat the "("
|
$this->_advance(); // eat the "("
|
||||||
|
|
@ -1507,7 +1507,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
// if it's a range
|
// if it's a range
|
||||||
elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$this->_current_token) or
|
elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$this->_current_token) or
|
||||||
preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$this->_current_token))
|
preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$this->_current_token))
|
||||||
{
|
{
|
||||||
$result = $this->_current_token;
|
$result = $this->_current_token;
|
||||||
|
|
@ -1534,7 +1534,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
$this->_advance();
|
$this->_advance();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
// if it's a function call
|
// if it's a public function call
|
||||||
elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$this->_current_token))
|
elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$this->_current_token))
|
||||||
{
|
{
|
||||||
$result = $this->_func();
|
$result = $this->_func();
|
||||||
|
|
@ -1546,13 +1546,13 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It parses a function call. It assumes the following rule:
|
* It parses a public function call. It assumes the following rule:
|
||||||
* Func -> ( Expr [,Expr]* )
|
* Func -> ( Expr [,Expr]* )
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @return mixed The parsed ptg'd tree on success, PEAR_Error on failure
|
* @return mixed The parsed ptg'd tree on success, PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function _func()
|
protected function _func()
|
||||||
{
|
{
|
||||||
$num_args = 0; // number of arguments received
|
$num_args = 0; // number of arguments received
|
||||||
$function = strtoupper($this->_current_token);
|
$function = strtoupper($this->_current_token);
|
||||||
|
|
@ -1568,7 +1568,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
$this->_advance(); // eat the "," or ";"
|
$this->_advance(); // eat the "," or ";"
|
||||||
} else {
|
} else {
|
||||||
return $this->raiseError("Syntax error: comma expected in ".
|
return $this->raiseError("Syntax error: comma expected in ".
|
||||||
"function $function, arg #{$num_args}");
|
"public function $function, arg #{$num_args}");
|
||||||
}
|
}
|
||||||
$result2 = $this->_condition();
|
$result2 = $this->_condition();
|
||||||
if (PEAR::isError($result2)) {
|
if (PEAR::isError($result2)) {
|
||||||
|
|
@ -1590,7 +1590,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
$args = $this->_functions[$function][1];
|
$args = $this->_functions[$function][1];
|
||||||
// If fixed number of args eg. TIME($i,$j,$k). Check that the number of args is valid.
|
// If fixed number of args eg. TIME($i,$j,$k). Check that the number of args is valid.
|
||||||
if (($args >= 0) and ($args != $num_args)) {
|
if (($args >= 0) and ($args != $num_args)) {
|
||||||
return $this->raiseError("Incorrect number of arguments in function $function() ");
|
return $this->raiseError("Incorrect number of arguments in public function $function() ");
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->_createTree($function, $result, $num_args);
|
$result = $this->_createTree($function, $result, $num_args);
|
||||||
|
|
@ -1608,7 +1608,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param mixed $right The right array (sub-tree) or a final node.
|
* @param mixed $right The right array (sub-tree) or a final node.
|
||||||
* @return array A tree
|
* @return array A tree
|
||||||
*/
|
*/
|
||||||
function _createTree($value, $left, $right)
|
protected function _createTree($value, $left, $right)
|
||||||
{
|
{
|
||||||
return array('value' => $value, 'left' => $left, 'right' => $right);
|
return array('value' => $value, 'left' => $left, 'right' => $right);
|
||||||
}
|
}
|
||||||
|
|
@ -1640,7 +1640,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
* @param array $tree The optional tree to convert.
|
* @param array $tree The optional tree to convert.
|
||||||
* @return string The tree in reverse polish notation
|
* @return string The tree in reverse polish notation
|
||||||
*/
|
*/
|
||||||
function toReversePolish($tree = array())
|
public function toReversePolish($tree = array())
|
||||||
{
|
{
|
||||||
$polish = ""; // the string we are going to return
|
$polish = ""; // the string we are going to return
|
||||||
if (empty($tree)) { // If it's the first call use _parse_tree
|
if (empty($tree)) { // If it's the first call use _parse_tree
|
||||||
|
|
@ -1672,14 +1672,14 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
}
|
}
|
||||||
$polish .= $converted_tree;
|
$polish .= $converted_tree;
|
||||||
}
|
}
|
||||||
// if it's a function convert it here (so we can set it's arguments)
|
// if it's a public function convert it here (so we can set it's arguments)
|
||||||
if (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/",$tree['value']) and
|
if (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/",$tree['value']) and
|
||||||
!preg_match('/^([A-Ia-i]?[A-Za-z])(\d+)$/',$tree['value']) and
|
!preg_match('/^([A-Ia-i]?[A-Za-z])(\d+)$/',$tree['value']) and
|
||||||
!preg_match("/^[A-Ia-i]?[A-Za-z](\d+)\.\.[A-Ia-i]?[A-Za-z](\d+)$/",$tree['value']) and
|
!preg_match("/^[A-Ia-i]?[A-Za-z](\d+)\.\.[A-Ia-i]?[A-Za-z](\d+)$/",$tree['value']) and
|
||||||
!is_numeric($tree['value']) and
|
!is_numeric($tree['value']) and
|
||||||
!isset($this->ptg[$tree['value']]))
|
!isset($this->ptg[$tree['value']]))
|
||||||
{
|
{
|
||||||
// left subtree for a function is always an array.
|
// left subtree for a public function is always an array.
|
||||||
if ($tree['left'] != '') {
|
if ($tree['left'] != '') {
|
||||||
$left_tree = $this->toReversePolish($tree['left']);
|
$left_tree = $this->toReversePolish($tree['left']);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1700,4 +1700,4 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
return $polish;
|
return $polish;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
|
||||||
|
|
@ -47,27 +47,27 @@ define("OP_LTE", 0x07);
|
||||||
*/
|
*/
|
||||||
class Spreadsheet_Excel_Writer_Validator
|
class Spreadsheet_Excel_Writer_Validator
|
||||||
{
|
{
|
||||||
var $_type;
|
public $_type;
|
||||||
var $_style;
|
public $_style;
|
||||||
var $_fixedList;
|
public $_fixedList;
|
||||||
var $_blank;
|
public $_blank;
|
||||||
var $_incell;
|
public $_incell;
|
||||||
var $_showprompt;
|
public $_showprompt;
|
||||||
var $_showerror;
|
public $_showerror;
|
||||||
var $_title_prompt;
|
public $_title_prompt;
|
||||||
var $_descr_prompt;
|
public $_descr_prompt;
|
||||||
var $_title_error;
|
public $_title_error;
|
||||||
var $_descr_error;
|
public $_descr_error;
|
||||||
var $_operator;
|
public $_operator;
|
||||||
var $_formula1;
|
public $_formula1;
|
||||||
var $_formula2;
|
public $_formula2;
|
||||||
/**
|
/**
|
||||||
* The parser from the workbook. Used to parse validation formulas also
|
* The parser from the workbook. Used to parse validation formulas also
|
||||||
* @var Spreadsheet_Excel_Writer_Parser
|
* @var Spreadsheet_Excel_Writer_Parser
|
||||||
*/
|
*/
|
||||||
var $_parser;
|
public $_parser;
|
||||||
|
|
||||||
function Spreadsheet_Excel_Writer_Validator(&$parser)
|
public function Spreadsheet_Excel_Writer_Validator(&$parser)
|
||||||
{
|
{
|
||||||
$this->_parser = $parser;
|
$this->_parser = $parser;
|
||||||
$this->_type = 0x01; // FIXME: add method for setting datatype
|
$this->_type = 0x01; // FIXME: add method for setting datatype
|
||||||
|
|
@ -86,41 +86,41 @@ class Spreadsheet_Excel_Writer_Validator
|
||||||
$this->_formula2 = '';
|
$this->_formula2 = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPrompt($promptTitle = "\x00", $promptDescription = "\x00", $showPrompt = true)
|
public function setPrompt($promptTitle = "\x00", $promptDescription = "\x00", $showPrompt = true)
|
||||||
{
|
{
|
||||||
$this->_showprompt = $showPrompt;
|
$this->_showprompt = $showPrompt;
|
||||||
$this->_title_prompt = $promptTitle;
|
$this->_title_prompt = $promptTitle;
|
||||||
$this->_descr_prompt = $promptDescription;
|
$this->_descr_prompt = $promptDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setError($errorTitle = "\x00", $errorDescription = "\x00", $showError = true)
|
public function setError($errorTitle = "\x00", $errorDescription = "\x00", $showError = true)
|
||||||
{
|
{
|
||||||
$this->_showerror = $showError;
|
$this->_showerror = $showError;
|
||||||
$this->_title_error = $errorTitle;
|
$this->_title_error = $errorTitle;
|
||||||
$this->_descr_error = $errorDescription;
|
$this->_descr_error = $errorDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
function allowBlank()
|
public function allowBlank()
|
||||||
{
|
{
|
||||||
$this->_blank = true;
|
$this->_blank = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onInvalidStop()
|
public function onInvalidStop()
|
||||||
{
|
{
|
||||||
$this->_style = 0x00;
|
$this->_style = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onInvalidWarn()
|
public function onInvalidWarn()
|
||||||
{
|
{
|
||||||
$this->_style = 0x01;
|
$this->_style = 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onInvalidInfo()
|
public function onInvalidInfo()
|
||||||
{
|
{
|
||||||
$this->_style = 0x02;
|
$this->_style = 0x02;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setFormula1($formula)
|
public function setFormula1($formula)
|
||||||
{
|
{
|
||||||
// Parse the formula using the parser in Parser.php
|
// Parse the formula using the parser in Parser.php
|
||||||
$error = $this->_parser->parse($formula);
|
$error = $this->_parser->parse($formula);
|
||||||
|
|
@ -135,7 +135,7 @@ class Spreadsheet_Excel_Writer_Validator
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setFormula2($formula)
|
public function setFormula2($formula)
|
||||||
{
|
{
|
||||||
// Parse the formula using the parser in Parser.php
|
// Parse the formula using the parser in Parser.php
|
||||||
$error = $this->_parser->parse($formula);
|
$error = $this->_parser->parse($formula);
|
||||||
|
|
@ -150,7 +150,7 @@ class Spreadsheet_Excel_Writer_Validator
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function _getOptions()
|
protected function _getOptions()
|
||||||
{
|
{
|
||||||
$options = $this->_type;
|
$options = $this->_type;
|
||||||
$options |= $this->_style << 3;
|
$options |= $this->_style << 3;
|
||||||
|
|
@ -174,7 +174,7 @@ class Spreadsheet_Excel_Writer_Validator
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
function _getData()
|
protected function _getData()
|
||||||
{
|
{
|
||||||
$title_prompt_len = strlen($this->_title_prompt);
|
$title_prompt_len = strlen($this->_title_prompt);
|
||||||
$descr_prompt_len = strlen($this->_descr_prompt);
|
$descr_prompt_len = strlen($this->_descr_prompt);
|
||||||
|
|
@ -199,13 +199,13 @@ class Spreadsheet_Excel_Writer_Validator
|
||||||
|
|
||||||
/*class Spreadsheet_Excel_Writer_Validation_List extends Spreadsheet_Excel_Writer_Validation
|
/*class Spreadsheet_Excel_Writer_Validation_List extends Spreadsheet_Excel_Writer_Validation
|
||||||
{
|
{
|
||||||
function Spreadsheet_Excel_Writer_Validation_list()
|
public function Spreadsheet_Excel_Writer_Validation_list()
|
||||||
{
|
{
|
||||||
parent::Spreadsheet_Excel_Writer_Validation();
|
parent::Spreadsheet_Excel_Writer_Validation();
|
||||||
$this->_type = 0x03;
|
$this->_type = 0x03;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setList($source, $incell = true)
|
public function setList($source, $incell = true)
|
||||||
{
|
{
|
||||||
$this->_incell = $incell;
|
$this->_incell = $incell;
|
||||||
$this->_fixedList = true;
|
$this->_fixedList = true;
|
||||||
|
|
@ -214,13 +214,13 @@ class Spreadsheet_Excel_Writer_Validator
|
||||||
$this->_formula1 = pack("CCC", 0x17, strlen($source), 0x0c) . $source;
|
$this->_formula1 = pack("CCC", 0x17, strlen($source), 0x0c) . $source;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setRow($row, $col1, $col2, $incell = true)
|
public function setRow($row, $col1, $col2, $incell = true)
|
||||||
{
|
{
|
||||||
$this->_incell = $incell;
|
$this->_incell = $incell;
|
||||||
//$this->_formula1 = ...;
|
//$this->_formula1 = ...;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCol($col, $row1, $row2, $incell = true)
|
public function setCol($col, $row1, $row2, $incell = true)
|
||||||
{
|
{
|
||||||
$this->_incell = $incell;
|
$this->_incell = $incell;
|
||||||
//$this->_formula1 = ...;
|
//$this->_formula1 = ...;
|
||||||
|
|
|
||||||
|
|
@ -53,120 +53,120 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* Filename for the Workbook
|
* Filename for the Workbook
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_filename;
|
public $_filename;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Formula parser
|
* Formula parser
|
||||||
* @var object Parser
|
* @var object Parser
|
||||||
*/
|
*/
|
||||||
var $_parser;
|
public $_parser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag for 1904 date system (0 => base date is 1900, 1 => base date is 1904)
|
* Flag for 1904 date system (0 => base date is 1900, 1 => base date is 1904)
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_1904;
|
public $_1904;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The active worksheet of the workbook (0 indexed)
|
* The active worksheet of the workbook (0 indexed)
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_activesheet;
|
public $_activesheet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1st displayed worksheet in the workbook (0 indexed)
|
* 1st displayed worksheet in the workbook (0 indexed)
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_firstsheet;
|
public $_firstsheet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number of workbook tabs selected
|
* Number of workbook tabs selected
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_selected;
|
public $_selected;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Index for creating adding new formats to the workbook
|
* Index for creating adding new formats to the workbook
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_xf_index;
|
public $_xf_index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag for preventing close from being called twice.
|
* Flag for preventing close from being called twice.
|
||||||
* @var integer
|
* @var integer
|
||||||
* @see close()
|
* @see close()
|
||||||
*/
|
*/
|
||||||
var $_fileclosed;
|
public $_fileclosed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The BIFF file size for the workbook.
|
* The BIFF file size for the workbook.
|
||||||
* @var integer
|
* @var integer
|
||||||
* @see _calcSheetOffsets()
|
* @see _calcSheetOffsets()
|
||||||
*/
|
*/
|
||||||
var $_biffsize;
|
public $_biffsize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default sheetname for all sheets created.
|
* The default sheetname for all sheets created.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_sheetname;
|
public $_sheetname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default XF format.
|
* The default XF format.
|
||||||
* @var object Format
|
* @var object Format
|
||||||
*/
|
*/
|
||||||
var $_tmp_format;
|
public $_tmp_format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array containing references to all of this workbook's worksheets
|
* Array containing references to all of this workbook's worksheets
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $_worksheets;
|
public $_worksheets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of sheetnames for creating the EXTERNSHEET records
|
* Array of sheetnames for creating the EXTERNSHEET records
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $_sheetnames;
|
public $_sheetnames;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array containing references to all of this workbook's formats
|
* Array containing references to all of this workbook's formats
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $_formats;
|
public $_formats;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array containing the colour palette
|
* Array containing the colour palette
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $_palette;
|
public $_palette;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default format for URLs.
|
* The default format for URLs.
|
||||||
* @var object Format
|
* @var object Format
|
||||||
*/
|
*/
|
||||||
var $_url_format;
|
public $_url_format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The codepage indicates the text encoding used for strings
|
* The codepage indicates the text encoding used for strings
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_codepage;
|
public $_codepage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The country code used for localization
|
* The country code used for localization
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_country_code;
|
public $_country_code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* number of bytes for sizeinfo of strings
|
* number of bytes for sizeinfo of strings
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
var $_string_sizeinfo_size;
|
public $_string_sizeinfo_size;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
var $_timestamp;
|
public $_timestamp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor
|
* Class constructor
|
||||||
|
|
@ -174,7 +174,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param string filename for storing the workbook. "-" for writing to stdout.
|
* @param string filename for storing the workbook. "-" for writing to stdout.
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function Spreadsheet_Excel_Writer_Workbook($filename)
|
public function Spreadsheet_Excel_Writer_Workbook($filename)
|
||||||
{
|
{
|
||||||
// It needs to call its parent's constructor explicitly
|
// It needs to call its parent's constructor explicitly
|
||||||
$this->Spreadsheet_Excel_Writer_BIFFwriter();
|
$this->Spreadsheet_Excel_Writer_BIFFwriter();
|
||||||
|
|
@ -215,7 +215,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @access public
|
* @access public
|
||||||
* @return mixed true on success. PEAR_Error on failure
|
* @return mixed true on success. PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function close()
|
public function close()
|
||||||
{
|
{
|
||||||
if ($this->_fileclosed) { // Prevent close() from being called twice.
|
if ($this->_fileclosed) { // Prevent close() from being called twice.
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -237,7 +237,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @see worksheets()
|
* @see worksheets()
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function sheets()
|
public function sheets()
|
||||||
{
|
{
|
||||||
return $this->worksheets();
|
return $this->worksheets();
|
||||||
}
|
}
|
||||||
|
|
@ -249,14 +249,14 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @access public
|
* @access public
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function worksheets()
|
public function worksheets()
|
||||||
{
|
{
|
||||||
return $this->_worksheets;
|
return $this->_worksheets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the BIFF version.
|
* Sets the BIFF version.
|
||||||
* This method exists just to access experimental functionality
|
* This method exists just to access experimental public functionality
|
||||||
* from BIFF8. It will be deprecated !
|
* from BIFF8. It will be deprecated !
|
||||||
* Only possible value is 8 (Excel 97/2000).
|
* Only possible value is 8 (Excel 97/2000).
|
||||||
* For any other value it fails silently.
|
* For any other value it fails silently.
|
||||||
|
|
@ -264,7 +264,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @access public
|
* @access public
|
||||||
* @param integer $version The BIFF version
|
* @param integer $version The BIFF version
|
||||||
*/
|
*/
|
||||||
function setVersion($version)
|
public function setVersion($version)
|
||||||
{
|
{
|
||||||
if ($version == 8) { // only accept version 8
|
if ($version == 8) { // only accept version 8
|
||||||
$version = 0x0600;
|
$version = 0x0600;
|
||||||
|
|
@ -297,7 +297,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param integer $code Is the international calling country code for the
|
* @param integer $code Is the international calling country code for the
|
||||||
* chosen country.
|
* chosen country.
|
||||||
*/
|
*/
|
||||||
function setCountry($code)
|
public function setCountry($code)
|
||||||
{
|
{
|
||||||
$this->_country_code = $code;
|
$this->_country_code = $code;
|
||||||
}
|
}
|
||||||
|
|
@ -312,7 +312,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @return mixed reference to a worksheet object on success, PEAR_Error
|
* @return mixed reference to a worksheet object on success, PEAR_Error
|
||||||
* on failure
|
* on failure
|
||||||
*/
|
*/
|
||||||
function &addWorksheet($name = '')
|
public function &addWorksheet($name = '')
|
||||||
{
|
{
|
||||||
$index = count($this->_worksheets);
|
$index = count($this->_worksheets);
|
||||||
$sheetname = $this->_sheetname;
|
$sheetname = $this->_sheetname;
|
||||||
|
|
@ -362,7 +362,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param array $properties array with properties for initializing the format.
|
* @param array $properties array with properties for initializing the format.
|
||||||
* @return &Spreadsheet_Excel_Writer_Format reference to an Excel Format
|
* @return &Spreadsheet_Excel_Writer_Format reference to an Excel Format
|
||||||
*/
|
*/
|
||||||
function &addFormat($properties = array())
|
public function &addFormat($properties = array())
|
||||||
{
|
{
|
||||||
$format = new Spreadsheet_Excel_Writer_Format($this->_BIFF_version, $this->_xf_index, $properties);
|
$format = new Spreadsheet_Excel_Writer_Format($this->_BIFF_version, $this->_xf_index, $properties);
|
||||||
$this->_xf_index += 1;
|
$this->_xf_index += 1;
|
||||||
|
|
@ -376,7 +376,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @access public
|
* @access public
|
||||||
* @return &Spreadsheet_Excel_Writer_Validator reference to a Validator
|
* @return &Spreadsheet_Excel_Writer_Validator reference to a Validator
|
||||||
*/
|
*/
|
||||||
function &addValidator()
|
public function &addValidator()
|
||||||
{
|
{
|
||||||
include_once 'Spreadsheet/Excel/Writer/Validator.php';
|
include_once 'Spreadsheet/Excel/Writer/Validator.php';
|
||||||
/* FIXME: check for successful inclusion*/
|
/* FIXME: check for successful inclusion*/
|
||||||
|
|
@ -394,7 +394,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param integer $blue blue RGB value [0-255]
|
* @param integer $blue blue RGB value [0-255]
|
||||||
* @return integer The palette index for the custom color
|
* @return integer The palette index for the custom color
|
||||||
*/
|
*/
|
||||||
function setCustomColor($index, $red, $green, $blue)
|
public function setCustomColor($index, $red, $green, $blue)
|
||||||
{
|
{
|
||||||
// Match a HTML #xxyyzz style parameter
|
// Match a HTML #xxyyzz style parameter
|
||||||
/*if (defined $_[1] and $_[1] =~ /^#(\w\w)(\w\w)(\w\w)/ ) {
|
/*if (defined $_[1] and $_[1] =~ /^#(\w\w)(\w\w)(\w\w)/ ) {
|
||||||
|
|
@ -427,7 +427,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _setPaletteXl97()
|
protected function _setPaletteXl97()
|
||||||
{
|
{
|
||||||
$this->_palette = array(
|
$this->_palette = array(
|
||||||
array(0x00, 0x00, 0x00, 0x00), // 8
|
array(0x00, 0x00, 0x00, 0x00), // 8
|
||||||
|
|
@ -496,7 +496,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @access private
|
* @access private
|
||||||
* @return mixed true on success. PEAR_Error on failure
|
* @return mixed true on success. PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function _storeWorkbook()
|
protected function _storeWorkbook()
|
||||||
{
|
{
|
||||||
if (count($this->_worksheets) == 0) {
|
if (count($this->_worksheets) == 0) {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -572,7 +572,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @access private
|
* @access private
|
||||||
* @return mixed true on success. PEAR_Error on failure
|
* @return mixed true on success. PEAR_Error on failure
|
||||||
*/
|
*/
|
||||||
function _storeOLEFile()
|
protected function _storeOLEFile()
|
||||||
{
|
{
|
||||||
if($this->_BIFF_version == 0x0600) {
|
if($this->_BIFF_version == 0x0600) {
|
||||||
$OLE = new OLE_PPS_File(OLE::Asc2Ucs('Workbook'));
|
$OLE = new OLE_PPS_File(OLE::Asc2Ucs('Workbook'));
|
||||||
|
|
@ -612,7 +612,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _calcSheetOffsets()
|
protected function _calcSheetOffsets()
|
||||||
{
|
{
|
||||||
if ($this->_BIFF_version == 0x0600) {
|
if ($this->_BIFF_version == 0x0600) {
|
||||||
$boundsheet_length = 12; // fixed length for a BOUNDSHEET record
|
$boundsheet_length = 12; // fixed length for a BOUNDSHEET record
|
||||||
|
|
@ -651,7 +651,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeAllFonts()
|
protected function _storeAllFonts()
|
||||||
{
|
{
|
||||||
// tmp_format is added by the constructor. We use this to write the default XF's
|
// tmp_format is added by the constructor. We use this to write the default XF's
|
||||||
$format = $this->_tmp_format;
|
$format = $this->_tmp_format;
|
||||||
|
|
@ -695,7 +695,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeAllNumFormats()
|
protected function _storeAllNumFormats()
|
||||||
{
|
{
|
||||||
// Leaning num_format syndrome
|
// Leaning num_format syndrome
|
||||||
$hash_num_formats = array();
|
$hash_num_formats = array();
|
||||||
|
|
@ -743,7 +743,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeAllXfs()
|
protected function _storeAllXfs()
|
||||||
{
|
{
|
||||||
// _tmp_format is added by the constructor. We use this to write the default XF's
|
// _tmp_format is added by the constructor. We use this to write the default XF's
|
||||||
// The default font index is 0
|
// The default font index is 0
|
||||||
|
|
@ -770,7 +770,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeAllStyles()
|
protected function _storeAllStyles()
|
||||||
{
|
{
|
||||||
$this->_storeStyle();
|
$this->_storeStyle();
|
||||||
}
|
}
|
||||||
|
|
@ -781,7 +781,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeExterns()
|
protected function _storeExterns()
|
||||||
|
|
||||||
{
|
{
|
||||||
// Create EXTERNCOUNT with number of worksheets
|
// Create EXTERNCOUNT with number of worksheets
|
||||||
|
|
@ -798,7 +798,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeNames()
|
protected function _storeNames()
|
||||||
{
|
{
|
||||||
// Create the print area NAME records
|
// Create the print area NAME records
|
||||||
$total_worksheets = count($this->_worksheets);
|
$total_worksheets = count($this->_worksheets);
|
||||||
|
|
@ -878,7 +878,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeCodepage()
|
protected function _storeCodepage()
|
||||||
{
|
{
|
||||||
$record = 0x0042; // Record identifier
|
$record = 0x0042; // Record identifier
|
||||||
$length = 0x0002; // Number of bytes to follow
|
$length = 0x0002; // Number of bytes to follow
|
||||||
|
|
@ -895,7 +895,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeWindow1()
|
protected function _storeWindow1()
|
||||||
{
|
{
|
||||||
$record = 0x003D; // Record identifier
|
$record = 0x003D; // Record identifier
|
||||||
$length = 0x0012; // Number of bytes to follow
|
$length = 0x0012; // Number of bytes to follow
|
||||||
|
|
@ -928,7 +928,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param integer $offset Location of worksheet BOF
|
* @param integer $offset Location of worksheet BOF
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeBoundsheet($sheetname,$offset)
|
protected function _storeBoundsheet($sheetname,$offset)
|
||||||
{
|
{
|
||||||
$record = 0x0085; // Record identifier
|
$record = 0x0085; // Record identifier
|
||||||
if ($this->_BIFF_version == 0x0600) {
|
if ($this->_BIFF_version == 0x0600) {
|
||||||
|
|
@ -958,7 +958,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeSupbookInternal()
|
protected function _storeSupbookInternal()
|
||||||
{
|
{
|
||||||
$record = 0x01AE; // Record identifier
|
$record = 0x01AE; // Record identifier
|
||||||
$length = 0x0004; // Bytes to follow
|
$length = 0x0004; // Bytes to follow
|
||||||
|
|
@ -975,7 +975,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param string $sheetname Worksheet name
|
* @param string $sheetname Worksheet name
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeExternsheetBiff8()
|
protected function _storeExternsheetBiff8()
|
||||||
{
|
{
|
||||||
$total_references = count($this->_parser->_references);
|
$total_references = count($this->_parser->_references);
|
||||||
$record = 0x0017; // Record identifier
|
$record = 0x0017; // Record identifier
|
||||||
|
|
@ -995,7 +995,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeStyle()
|
protected function _storeStyle()
|
||||||
{
|
{
|
||||||
$record = 0x0293; // Record identifier
|
$record = 0x0293; // Record identifier
|
||||||
$length = 0x0004; // Bytes to follow
|
$length = 0x0004; // Bytes to follow
|
||||||
|
|
@ -1017,7 +1017,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param integer $ifmt Format index code
|
* @param integer $ifmt Format index code
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeNumFormat($format, $ifmt)
|
protected function _storeNumFormat($format, $ifmt)
|
||||||
{
|
{
|
||||||
$record = 0x041E; // Record identifier
|
$record = 0x041E; // Record identifier
|
||||||
|
|
||||||
|
|
@ -1055,7 +1055,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeDatemode()
|
protected function _storeDatemode()
|
||||||
{
|
{
|
||||||
$record = 0x0022; // Record identifier
|
$record = 0x0022; // Record identifier
|
||||||
$length = 0x0002; // Bytes to follow
|
$length = 0x0002; // Bytes to follow
|
||||||
|
|
@ -1081,7 +1081,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param integer $cxals Number of external references
|
* @param integer $cxals Number of external references
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeExterncount($cxals)
|
protected function _storeExterncount($cxals)
|
||||||
{
|
{
|
||||||
$record = 0x0016; // Record identifier
|
$record = 0x0016; // Record identifier
|
||||||
$length = 0x0002; // Number of bytes to follow
|
$length = 0x0002; // Number of bytes to follow
|
||||||
|
|
@ -1102,7 +1102,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param string $sheetname Worksheet name
|
* @param string $sheetname Worksheet name
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeExternsheet($sheetname)
|
protected function _storeExternsheet($sheetname)
|
||||||
{
|
{
|
||||||
$record = 0x0017; // Record identifier
|
$record = 0x0017; // Record identifier
|
||||||
$length = 0x02 + strlen($sheetname); // Number of bytes to follow
|
$length = 0x02 + strlen($sheetname); // Number of bytes to follow
|
||||||
|
|
@ -1128,7 +1128,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param integer $colmax End column
|
* @param integer $colmax End column
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeNameShort($index, $type, $rowmin, $rowmax, $colmin, $colmax)
|
protected function _storeNameShort($index, $type, $rowmin, $rowmax, $colmin, $colmax)
|
||||||
{
|
{
|
||||||
$record = 0x0018; // Record identifier
|
$record = 0x0018; // Record identifier
|
||||||
$length = 0x0024; // Number of bytes to follow
|
$length = 0x0024; // Number of bytes to follow
|
||||||
|
|
@ -1194,7 +1194,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
* @param integer $colmax End column
|
* @param integer $colmax End column
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeNameLong($index, $type, $rowmin, $rowmax, $colmin, $colmax)
|
protected function _storeNameLong($index, $type, $rowmin, $rowmax, $colmin, $colmax)
|
||||||
{
|
{
|
||||||
$record = 0x0018; // Record identifier
|
$record = 0x0018; // Record identifier
|
||||||
$length = 0x003d; // Number of bytes to follow
|
$length = 0x003d; // Number of bytes to follow
|
||||||
|
|
@ -1269,7 +1269,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeCountry()
|
protected function _storeCountry()
|
||||||
{
|
{
|
||||||
$record = 0x008C; // Record identifier
|
$record = 0x008C; // Record identifier
|
||||||
$length = 4; // Number of bytes to follow
|
$length = 4; // Number of bytes to follow
|
||||||
|
|
@ -1285,7 +1285,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storePalette()
|
protected function _storePalette()
|
||||||
{
|
{
|
||||||
$aref = $this->_palette;
|
$aref = $this->_palette;
|
||||||
|
|
||||||
|
|
@ -1315,7 +1315,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _calculateSharedStringsSizes()
|
protected function _calculateSharedStringsSizes()
|
||||||
{
|
{
|
||||||
/* Iterate through the strings to calculate the CONTINUE block sizes.
|
/* Iterate through the strings to calculate the CONTINUE block sizes.
|
||||||
For simplicity we use the same size for the SST and CONTINUE records:
|
For simplicity we use the same size for the SST and CONTINUE records:
|
||||||
|
|
@ -1461,7 +1461,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _storeSharedStringsTable()
|
protected function _storeSharedStringsTable()
|
||||||
{
|
{
|
||||||
$record = 0x00fc; // Record identifier
|
$record = 0x00fc; // Record identifier
|
||||||
$length = 0x0008; // Number of bytes to follow
|
$length = 0x0008; // Number of bytes to follow
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue