diff --git a/Spreadsheet/Excel/Writer/BIFFwriter.php b/Spreadsheet/Excel/Writer/BIFFwriter.php index c949b45..57e1de9 100644 --- a/Spreadsheet/Excel/Writer/BIFFwriter.php +++ b/Spreadsheet/Excel/Writer/BIFFwriter.php @@ -57,51 +57,51 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR * The BIFF/Excel version (5). * @var integer */ - var $_BIFF_version = 0x0500; + public $_BIFF_version = 0x0500; /** * The byte order of this architecture. 0 => little endian, 1 => big endian * @var integer */ - var $_byte_order; + public $_byte_order; /** * The string containing the data of the BIFF stream * @var string */ - var $_data; + public $_data; /** * The size of the data in bytes. Should be the same as strlen($this->_data) * @var integer */ - var $_datasize; + public $_datasize; /** * The maximun length for a BIFF record. See _addContinue() * @var integer * @see _addContinue() */ - var $_limit; + public $_limit; /** * The temporary dir for storing the OLE file * @var string */ - var $_tmp_dir; + public $_tmp_dir; /** * The temporary file for storing the OLE file * @var string */ - var $_tmp_file; + public $_tmp_file; /** * Constructor * * @access public */ - function Spreadsheet_Excel_Writer_BIFFwriter() + public function Spreadsheet_Excel_Writer_BIFFwriter() { $this->_byte_order = ''; $this->_data = ''; @@ -118,7 +118,7 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR * * @access private */ - function _setByteOrder() + protected function _setByteOrder() { // Check if "pack" gives the required IEEE 64bit float $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 * @access private */ - function _prepend($data) + protected function _prepend($data) { if (strlen($data) > $this->_limit) { $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 * @access private */ - function _append($data) + protected function _append($data) { if (strlen($data) > $this->_limit) { $data = $this->_addContinue($data); @@ -173,7 +173,7 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR * 0x0010 Worksheet. * @access private */ - function _storeBof($type) + protected function _storeBof($type) { $record = 0x0809; // Record identifier @@ -202,7 +202,7 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR * * @access private */ - function _storeEof() + protected function _storeEof() { $record = 0x000A; // Record identifier $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 * 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. * * @param string $data The original binary data to be written * @return string A very convenient string of continue blocks * @access private */ - function _addContinue($data) + protected function _addContinue($data) { $limit = $this->_limit; $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 * @return true if given dir is valid, false otherwise */ - function setTempDir($dir) + public function setTempDir($dir) { if (is_dir($dir)) { $this->_tmp_dir = $dir; diff --git a/Spreadsheet/Excel/Writer/Format.php b/Spreadsheet/Excel/Writer/Format.php index 8922360..58dc8d1 100644 --- a/Spreadsheet/Excel/Writer/Format.php +++ b/Spreadsheet/Excel/Writer/Format.php @@ -48,199 +48,199 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * The index given by the workbook when creating a new format. * @var integer */ - var $_xf_index; + public $_xf_index; /** * Index to the FONT record. * @var integer */ - var $font_index; + public $font_index; /** * The font name (ASCII). * @var string */ - var $_font_name; + public $_font_name; /** * Height of font (1/20 of a point) * @var integer */ - var $_size; + public $_size; /** * Bold style * @var integer */ - var $_bold; + public $_bold; /** * Bit specifiying if the font is italic. * @var integer */ - var $_italic; + public $_italic; /** * Index to the cell's color * @var integer */ - var $_color; + public $_color; /** * The text underline property * @var integer */ - var $_underline; + public $_underline; /** * Bit specifiying if the font has strikeout. * @var integer */ - var $_font_strikeout; + public $_font_strikeout; /** * Bit specifiying if the font has outline. * @var integer */ - var $_font_outline; + public $_font_outline; /** * Bit specifiying if the font has shadow. * @var integer */ - var $_font_shadow; + public $_font_shadow; /** * 2 bytes specifiying the script type for the font. * @var integer */ - var $_font_script; + public $_font_script; /** * Byte specifiying the font family. * @var integer */ - var $_font_family; + public $_font_family; /** * Byte specifiying the font charset. * @var integer */ - var $_font_charset; + public $_font_charset; /** * An index (2 bytes) to a FORMAT record (number format). * @var integer */ - var $_num_format; + public $_num_format; /** * Bit specifying if formulas are hidden. * @var integer */ - var $_hidden; + public $_hidden; /** * Bit specifying if the cell is locked. * @var integer */ - var $_locked; + public $_locked; /** * The three bits specifying the text horizontal alignment. * @var integer */ - var $_text_h_align; + public $_text_h_align; /** * Bit specifying if the text is wrapped at the right border. * @var integer */ - var $_text_wrap; + public $_text_wrap; /** * The three bits specifying the text vertical alignment. * @var integer */ - var $_text_v_align; + public $_text_v_align; /** * 1 bit, apparently not used. * @var integer */ - var $_text_justlast; + public $_text_justlast; /** * The two bits specifying the text rotation. * @var integer */ - var $_rotation; + public $_rotation; /** * The cell's foreground color. * @var integer */ - var $_fg_color; + public $_fg_color; /** * The cell's background color. * @var integer */ - var $_bg_color; + public $_bg_color; /** * The cell's background fill pattern. * @var integer */ - var $_pattern; + public $_pattern; /** * Style of the bottom border of the cell * @var integer */ - var $_bottom; + public $_bottom; /** * Color of the bottom border of the cell. * @var integer */ - var $_bottom_color; + public $_bottom_color; /** * Style of the top border of the cell * @var integer */ - var $_top; + public $_top; /** * Color of the top border of the cell. * @var integer */ - var $_top_color; + public $_top_color; /** * Style of the left border of the cell * @var integer */ - var $_left; + public $_left; /** * Color of the left border of the cell. * @var integer */ - var $_left_color; + public $_left_color; /** * Style of the right border of the cell * @var integer */ - var $_right; + public $_right; /** * Color of the right border of the cell. * @var integer */ - var $_right_color; + public $_right_color; /** * Constructor @@ -249,7 +249,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @param integer $index the XF index for the format. * @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->_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'). * @return string The XF record */ - function getXf($style) + public function getXf($style) { // Set the type of the XF record and some of the attributes. if ($style == 'style') { @@ -444,7 +444,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * * @return string The FONT record */ - function getFont() + public function getFont() { $dyHeight = $this->_size * 20; // Height of font (1/20 of a point) $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 */ - function getFontKey() + public function getFontKey() { $key = "$this->_font_name$this->_size"; $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 */ - function getXfIndex() + public function getXfIndex() { 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. * @return integer The color index */ - function _getColor($name_color = '') + protected function _getColor($name_color = '') { $colors = array( 'aqua' => 0x07, @@ -583,7 +583,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @param string $location alignment for the cell ('left', 'right', etc...). */ - function setAlign($location) + public function setAlign($location) { if (preg_match("/\d/",$location)) { return; // Ignore numbers @@ -641,14 +641,14 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @param string $location alignment for the cell ('left', 'right', etc...). */ - function setHAlign($location) + public function setHAlign($location) { if (preg_match("/\d/",$location)) { return; // Ignore numbers } - + $location = strtolower($location); - + if ($location == 'left') { $this->_text_h_align = 1; } @@ -681,14 +681,14 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @param string $location alignment for the cell ('top', 'vleft', 'vright', etc...). */ - function setVAlign($location) + public function setVAlign($location) { if (preg_match("/\d/",$location)) { return; // Ignore numbers } - + $location = strtolower($location); - + if ($location == 'top') { $this->_text_v_align = 0; } @@ -714,7 +714,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * * @access public */ - function setMerge() + public function setMerge() { $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. It's Optional, default is 1 (bold). */ - function setBold($weight = 1) + public function setBold($weight = 1) { if ($weight == 1) { $weight = 0x2BC; // Bold text @@ -757,7 +757,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @param integer $style style of the cell border. 1 => thin, 2 => thick. */ - function setBottom($style) + public function setBottom($style) { $this->_bottom = $style; } @@ -768,7 +768,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @param integer $style style of the cell top border. 1 => thin, 2 => thick. */ - function setTop($style) + public function setTop($style) { $this->_top = $style; } @@ -779,7 +779,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @param integer $style style of the cell left border. 1 => thin, 2 => thick. */ - function setLeft($style) + public function setLeft($style) { $this->_left = $style; } @@ -790,7 +790,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @param integer $style style of the cell right border. 1 => thin, 2 => thick. */ - function setRight($style) + public function setRight($style) { $this->_right = $style; } @@ -802,7 +802,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @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->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'), * or an integer (range is [8...63]). */ - function setBorderColor($color) + public function setBorderColor($color) { $this->setBottomColor($color); $this->setTopColor($color); @@ -836,7 +836,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @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); $this->_bottom_color = $value; @@ -848,7 +848,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @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); $this->_top_color = $value; @@ -860,7 +860,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @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); $this->_left_color = $value; @@ -872,7 +872,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @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); $this->_right_color = $value; @@ -885,7 +885,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @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); $this->_fg_color = $value; @@ -900,7 +900,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @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); $this->_bg_color = $value; @@ -915,7 +915,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @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); $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, * 0 meaning no background. */ - function setPattern($arg = 1) + public function setPattern($arg = 1) { $this->_pattern = $arg; } @@ -940,7 +940,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @param integer $underline The value for underline. Possible values are: * 1 => underline, 2 => double underline. */ - function setUnderline($underline) + public function setUnderline($underline) { $this->_underline = $underline; } @@ -950,7 +950,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * * @access public */ - function setItalic() + public function setItalic() { $this->_italic = 1; } @@ -961,7 +961,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @param integer $size The font size (in pixels I think). */ - function setSize($size) + public function setSize($size) { $this->_size = $size; } @@ -971,7 +971,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * * @access public */ - function setTextWrap() + public function setTextWrap() { $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 values are: 0, 90, 270 and -1 for stacking top-to-bottom. */ - function setTextRotation($angle) + public function setTextRotation($angle) { switch ($angle) { @@ -1027,7 +1027,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @access public * @param integer $num_format The numeric format. */ - function setNumFormat($num_format) + public function setNumFormat($num_format) { $this->_num_format = $num_format; } @@ -1037,7 +1037,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * * @access public */ - function setStrikeOut() + public function setStrikeOut() { $this->_font_strikeout = 1; } @@ -1047,7 +1047,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * * @access public */ - function setOutLine() + public function setOutLine() { $this->_font_outline = 1; } @@ -1057,7 +1057,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * * @access public */ - function setShadow() + public function setShadow() { $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: * 1 => superscript, 2 => subscript. */ - function setScript($script) + public function setScript($script) { $this->_font_script = $script; } @@ -1079,7 +1079,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * * @access public */ - function setLocked() + public function setLocked() { $this->_locked = 1; } @@ -1089,7 +1089,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * * @access public */ - function setUnLocked() + public function setUnLocked() { $this->_locked = 0; } @@ -1101,7 +1101,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR * @param string $fontfamily The font family name. Possible values are: * 'Times New Roman', 'Arial', 'Courier'. */ - function setFontFamily($font_family) + public function setFontFamily($font_family) { $this->_font_name = $font_family; } diff --git a/Spreadsheet/Excel/Writer/Parser.php b/Spreadsheet/Excel/Writer/Parser.php index bd93824..ee43e12 100644 --- a/Spreadsheet/Excel/Writer/Parser.php +++ b/Spreadsheet/Excel/Writer/Parser.php @@ -113,55 +113,55 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * The index of the character we are currently looking at * @var integer */ - var $_current_char; + public $_current_char; /** * The token we are working on. * @var string */ - var $_current_token; + public $_current_token; /** * The formula to parse * @var string */ - var $_formula; + public $_formula; /** * The character ahead of the current char * @var string */ - var $_lookahead; + public $_lookahead; /** * The parse tree to be generated * @var string */ - var $_parse_tree; + public $_parse_tree; /** * The byte order. 1 => big endian, 0 => little endian. * @var integer */ - var $_byte_order; + public $_byte_order; /** * Array of external sheets * @var array */ - var $_ext_sheets; + public $_ext_sheets; /** * Array of sheet references in the form of REF structures * @var array */ - var $_references; + public $_references; /** * The BIFF version for the workbook * @var integer */ - var $_BIFF_version; + public $_BIFF_version; /** * 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 (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->_BIFF_version = $biff_version; @@ -177,18 +177,18 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR $this->_formula = ''; // The formula to parse. $this->_lookahead = ''; // The character ahead of the current char. $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->_ext_sheets = array(); $this->_references = array(); } /** - * Initialize the ptg and function hashes. + * Initialize the ptg and public function hashes. * * @access private */ - function _initializeHashes() + protected function _initializeHashes() { // The Excel ptg indices $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. // // 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: - // ptg: The Excel function ptg code. - // args: The number of arguments that the function takes: + // ptg: The Excel public function ptg code. + // args: The number of arguments that the public function takes: // >=0 is a fixed number of arguments. // -1 is a variable number of arguments. - // class: The reference, value or array class of the function args. - // vol: The function is volatile. + // class: The reference, value or array class of the public function args. + // vol: The public function is volatile. // $this->_functions = array( - // function ptg args class vol + // public function ptg args class vol 'COUNT' => array( 0, -1, 0, 0 ), 'IF' => array( 1, -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 * is not recognized */ - function _convert($token) + protected function _convert($token) { if (preg_match("/^\"[^\"]{0,255}\"$/", $token)) { return $this->_convertString($token); @@ -600,7 +600,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @access private * @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 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 * is longer than 255 characters. */ - function _convertString($string) + protected function _convertString($string) { // chop away beggining and ending quotes $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. * * @access private - * @param string $token The name of the function for convertion to ptg value. - * @param integer $num_args The number of arguments the function receives. - * @return string The packed ptg for the function + * @param string $token The name of the public function for convertion to ptg value. + * @param integer $num_args The number of arguments the public function receives. + * @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]; $volatile = $this->_functions[$token][3]; @@ -667,7 +667,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @access private * @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 @@ -716,7 +716,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @param string $token An Excel range in the Sheet1!A1:A2 format. * @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. @@ -780,7 +780,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @param string $cell An Excel cell reference * @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. @@ -813,7 +813,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @param string $cell An Excel cell reference * @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. @@ -858,7 +858,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @param string $ext_ref The name of the external reference * @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 trailing ' if any. @@ -904,7 +904,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @return mixed The reference index in packed() format on success, * 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 trailing ' if any. @@ -962,7 +962,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @access private * @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])) { return -1; @@ -981,7 +981,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @param string $name The name 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; } @@ -993,7 +993,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @param string $cell The Excel cell reference to be packed * @return array Array containing the row and column in packed() format */ - function _cellToPackedRowcol($cell) + protected function _cellToPackedRowcol($cell) { $cell = strtoupper($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 * @return array Array containing (row1,col1,row2,col2) in packed() format */ - function _rangeToPackedRange($range) + protected function _rangeToPackedRange($range) { preg_match('/(\$)?(\d+)\:(\$)?(\d+)/', $range, $match); // 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. * @return array */ - function _cellToRowcol($cell) + protected function _cellToRowcol($cell) { preg_match('/(\$)?([A-I]?[A-Z])(\$)?(\d+)/',$cell,$match); // return absolute column if there is a $ in the ref @@ -1105,7 +1105,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * * @access private */ - function _advance() + protected function _advance() { $i = $this->_current_char; $formula_length = strlen($this->_formula); @@ -1155,7 +1155,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @param mixed $token The token to check. * @return mixed The checked token or false on failure */ - function _match($token) + protected function _match($token) { switch($token) { case SPREADSHEET_EXCEL_WRITER_ADD: @@ -1213,7 +1213,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR default: // if it's a reference 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 != '!')) { @@ -1234,13 +1234,13 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR return $token; } // 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)) { return $token; } // 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)) { return $token; @@ -1258,7 +1258,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR return $token; } // 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 ($this->_lookahead != '!') and ($this->_lookahead != ':')) { @@ -1269,7 +1269,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR { 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 == "(")) { return $token; @@ -1286,7 +1286,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * sign (=). * @return mixed true on success, PEAR_Error on failure */ - function parse($formula) + public function parse($formula) { $this->_current_char = 0; $this->_formula = $formula; @@ -1306,7 +1306,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @access private * @return mixed The parsed ptg'd tree on success, PEAR_Error on failure */ - function _condition() + protected function _condition() { $result = $this->_expression(); if (PEAR::isError($result)) { @@ -1374,7 +1374,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @access private * @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 (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. * * @access private * @see _fact() * @return array The parsed ptg'd tree */ - function _parenthesizedExpression() + protected function _parenthesizedExpression() { $result = $this->_createTree('ptgParen', $this->_expression(), ''); return $result; @@ -1435,7 +1435,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @access private * @return mixed The parsed ptg'd tree on success, PEAR_Error on failure */ - function _term() + protected function _term() { $result = $this->_fact(); if (PEAR::isError($result)) { @@ -1474,7 +1474,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @access private * @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) { $this->_advance(); // eat the "(" @@ -1507,7 +1507,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR return $result; } // 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)) { $result = $this->_current_token; @@ -1534,7 +1534,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR $this->_advance(); 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)) { $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]* ) * * @access private * @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 $function = strtoupper($this->_current_token); @@ -1568,7 +1568,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR $this->_advance(); // eat the "," or ";" } else { return $this->raiseError("Syntax error: comma expected in ". - "function $function, arg #{$num_args}"); + "public function $function, arg #{$num_args}"); } $result2 = $this->_condition(); if (PEAR::isError($result2)) { @@ -1590,7 +1590,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR $args = $this->_functions[$function][1]; // If fixed number of args eg. TIME($i,$j,$k). Check that the number of args is valid. if (($args >= 0) and ($args != $num_args)) { - 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); @@ -1608,7 +1608,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR * @param mixed $right The right array (sub-tree) or a final node. * @return array A tree */ - function _createTree($value, $left, $right) + protected function _createTree($value, $left, $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. * @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 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; } - // 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 !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 !is_numeric($tree['value']) and !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'] != '') { $left_tree = $this->toReversePolish($tree['left']); } else { @@ -1700,4 +1700,4 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR return $polish; } } -?> + diff --git a/Spreadsheet/Excel/Writer/Validator.php b/Spreadsheet/Excel/Writer/Validator.php index 0f091c6..e100326 100644 --- a/Spreadsheet/Excel/Writer/Validator.php +++ b/Spreadsheet/Excel/Writer/Validator.php @@ -47,27 +47,27 @@ define("OP_LTE", 0x07); */ class Spreadsheet_Excel_Writer_Validator { - var $_type; - var $_style; - var $_fixedList; - var $_blank; - var $_incell; - var $_showprompt; - var $_showerror; - var $_title_prompt; - var $_descr_prompt; - var $_title_error; - var $_descr_error; - var $_operator; - var $_formula1; - var $_formula2; + public $_type; + public $_style; + public $_fixedList; + public $_blank; + public $_incell; + public $_showprompt; + public $_showerror; + public $_title_prompt; + public $_descr_prompt; + public $_title_error; + public $_descr_error; + public $_operator; + public $_formula1; + public $_formula2; /** * The parser from the workbook. Used to parse validation formulas also * @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->_type = 0x01; // FIXME: add method for setting datatype @@ -86,41 +86,41 @@ class Spreadsheet_Excel_Writer_Validator $this->_formula2 = ''; } - function setPrompt($promptTitle = "\x00", $promptDescription = "\x00", $showPrompt = true) + public function setPrompt($promptTitle = "\x00", $promptDescription = "\x00", $showPrompt = true) { $this->_showprompt = $showPrompt; $this->_title_prompt = $promptTitle; $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->_title_error = $errorTitle; $this->_descr_error = $errorDescription; } - function allowBlank() + public function allowBlank() { $this->_blank = true; } - function onInvalidStop() + public function onInvalidStop() { $this->_style = 0x00; } - function onInvalidWarn() + public function onInvalidWarn() { $this->_style = 0x01; } - function onInvalidInfo() + public function onInvalidInfo() { $this->_style = 0x02; } - function setFormula1($formula) + public function setFormula1($formula) { // Parse the formula using the parser in Parser.php $error = $this->_parser->parse($formula); @@ -135,7 +135,7 @@ class Spreadsheet_Excel_Writer_Validator return true; } - function setFormula2($formula) + public function setFormula2($formula) { // Parse the formula using the parser in Parser.php $error = $this->_parser->parse($formula); @@ -150,7 +150,7 @@ class Spreadsheet_Excel_Writer_Validator return true; } - function _getOptions() + protected function _getOptions() { $options = $this->_type; $options |= $this->_style << 3; @@ -174,7 +174,7 @@ class Spreadsheet_Excel_Writer_Validator return $options; } - function _getData() + protected function _getData() { $title_prompt_len = strlen($this->_title_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 { - function Spreadsheet_Excel_Writer_Validation_list() + public function Spreadsheet_Excel_Writer_Validation_list() { parent::Spreadsheet_Excel_Writer_Validation(); $this->_type = 0x03; } - function setList($source, $incell = true) + public function setList($source, $incell = true) { $this->_incell = $incell; $this->_fixedList = true; @@ -214,13 +214,13 @@ class Spreadsheet_Excel_Writer_Validator $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->_formula1 = ...; } - function setCol($col, $row1, $row2, $incell = true) + public function setCol($col, $row1, $row2, $incell = true) { $this->_incell = $incell; //$this->_formula1 = ...; diff --git a/Spreadsheet/Excel/Writer/Workbook.php b/Spreadsheet/Excel/Writer/Workbook.php index 788d461..00d9a5c 100644 --- a/Spreadsheet/Excel/Writer/Workbook.php +++ b/Spreadsheet/Excel/Writer/Workbook.php @@ -53,120 +53,120 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * Filename for the Workbook * @var string */ - var $_filename; + public $_filename; /** * Formula parser * @var object Parser */ - var $_parser; + public $_parser; /** * Flag for 1904 date system (0 => base date is 1900, 1 => base date is 1904) * @var integer */ - var $_1904; + public $_1904; /** * The active worksheet of the workbook (0 indexed) * @var integer */ - var $_activesheet; + public $_activesheet; /** * 1st displayed worksheet in the workbook (0 indexed) * @var integer */ - var $_firstsheet; + public $_firstsheet; /** * Number of workbook tabs selected * @var integer */ - var $_selected; + public $_selected; /** * Index for creating adding new formats to the workbook * @var integer */ - var $_xf_index; + public $_xf_index; /** * Flag for preventing close from being called twice. * @var integer * @see close() */ - var $_fileclosed; + public $_fileclosed; /** * The BIFF file size for the workbook. * @var integer * @see _calcSheetOffsets() */ - var $_biffsize; + public $_biffsize; /** * The default sheetname for all sheets created. * @var string */ - var $_sheetname; + public $_sheetname; /** * The default XF format. * @var object Format */ - var $_tmp_format; + public $_tmp_format; /** * Array containing references to all of this workbook's worksheets * @var array */ - var $_worksheets; + public $_worksheets; /** * Array of sheetnames for creating the EXTERNSHEET records * @var array */ - var $_sheetnames; + public $_sheetnames; /** * Array containing references to all of this workbook's formats * @var array */ - var $_formats; + public $_formats; /** * Array containing the colour palette * @var array */ - var $_palette; + public $_palette; /** * The default format for URLs. * @var object Format */ - var $_url_format; + public $_url_format; /** * The codepage indicates the text encoding used for strings * @var integer */ - var $_codepage; + public $_codepage; /** * The country code used for localization * @var integer */ - var $_country_code; + public $_country_code; /** * number of bytes for sizeinfo of strings * @var integer */ - var $_string_sizeinfo_size; + public $_string_sizeinfo_size; /** @var int */ - var $_timestamp; + public $_timestamp; /** * 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. * @access public */ - function Spreadsheet_Excel_Writer_Workbook($filename) + public function Spreadsheet_Excel_Writer_Workbook($filename) { // It needs to call its parent's constructor explicitly $this->Spreadsheet_Excel_Writer_BIFFwriter(); @@ -215,7 +215,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * @access public * @return mixed true on success. PEAR_Error on failure */ - function close() + public function close() { if ($this->_fileclosed) { // Prevent close() from being called twice. return true; @@ -237,7 +237,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * @see worksheets() * @return array */ - function sheets() + public function sheets() { return $this->worksheets(); } @@ -249,14 +249,14 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * @access public * @return array */ - function worksheets() + public function worksheets() { return $this->_worksheets; } /** * 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 ! * Only possible value is 8 (Excel 97/2000). * For any other value it fails silently. @@ -264,7 +264,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * @access public * @param integer $version The BIFF version */ - function setVersion($version) + public function setVersion($version) { if ($version == 8) { // only accept version 8 $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 * chosen country. */ - function setCountry($code) + public function setCountry($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 * on failure */ - function &addWorksheet($name = '') + public function &addWorksheet($name = '') { $index = count($this->_worksheets); $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. * @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); $this->_xf_index += 1; @@ -376,7 +376,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * @access public * @return &Spreadsheet_Excel_Writer_Validator reference to a Validator */ - function &addValidator() + public function &addValidator() { include_once 'Spreadsheet/Excel/Writer/Validator.php'; /* 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] * @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 /*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 */ - function _setPaletteXl97() + protected function _setPaletteXl97() { $this->_palette = array( array(0x00, 0x00, 0x00, 0x00), // 8 @@ -496,7 +496,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * @access private * @return mixed true on success. PEAR_Error on failure */ - function _storeWorkbook() + protected function _storeWorkbook() { if (count($this->_worksheets) == 0) { return true; @@ -572,7 +572,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * @access private * @return mixed true on success. PEAR_Error on failure */ - function _storeOLEFile() + protected function _storeOLEFile() { if($this->_BIFF_version == 0x0600) { $OLE = new OLE_PPS_File(OLE::Asc2Ucs('Workbook')); @@ -612,7 +612,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _calcSheetOffsets() + protected function _calcSheetOffsets() { if ($this->_BIFF_version == 0x0600) { $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 */ - function _storeAllFonts() + protected function _storeAllFonts() { // tmp_format is added by the constructor. We use this to write the default XF's $format = $this->_tmp_format; @@ -695,7 +695,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeAllNumFormats() + protected function _storeAllNumFormats() { // Leaning num_format syndrome $hash_num_formats = array(); @@ -743,7 +743,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeAllXfs() + protected function _storeAllXfs() { // _tmp_format is added by the constructor. We use this to write the default XF's // The default font index is 0 @@ -770,7 +770,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeAllStyles() + protected function _storeAllStyles() { $this->_storeStyle(); } @@ -781,7 +781,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeExterns() + protected function _storeExterns() { // Create EXTERNCOUNT with number of worksheets @@ -798,7 +798,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeNames() + protected function _storeNames() { // Create the print area NAME records $total_worksheets = count($this->_worksheets); @@ -878,7 +878,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeCodepage() + protected function _storeCodepage() { $record = 0x0042; // Record identifier $length = 0x0002; // Number of bytes to follow @@ -895,7 +895,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeWindow1() + protected function _storeWindow1() { $record = 0x003D; // Record identifier $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 * @access private */ - function _storeBoundsheet($sheetname,$offset) + protected function _storeBoundsheet($sheetname,$offset) { $record = 0x0085; // Record identifier if ($this->_BIFF_version == 0x0600) { @@ -958,7 +958,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeSupbookInternal() + protected function _storeSupbookInternal() { $record = 0x01AE; // Record identifier $length = 0x0004; // Bytes to follow @@ -975,7 +975,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * @param string $sheetname Worksheet name * @access private */ - function _storeExternsheetBiff8() + protected function _storeExternsheetBiff8() { $total_references = count($this->_parser->_references); $record = 0x0017; // Record identifier @@ -995,7 +995,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeStyle() + protected function _storeStyle() { $record = 0x0293; // Record identifier $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 * @access private */ - function _storeNumFormat($format, $ifmt) + protected function _storeNumFormat($format, $ifmt) { $record = 0x041E; // Record identifier @@ -1055,7 +1055,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeDatemode() + protected function _storeDatemode() { $record = 0x0022; // Record identifier $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 * @access private */ - function _storeExterncount($cxals) + protected function _storeExterncount($cxals) { $record = 0x0016; // Record identifier $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 * @access private */ - function _storeExternsheet($sheetname) + protected function _storeExternsheet($sheetname) { $record = 0x0017; // Record identifier $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 * @access private */ - function _storeNameShort($index, $type, $rowmin, $rowmax, $colmin, $colmax) + protected function _storeNameShort($index, $type, $rowmin, $rowmax, $colmin, $colmax) { $record = 0x0018; // Record identifier $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 * @access private */ - function _storeNameLong($index, $type, $rowmin, $rowmax, $colmin, $colmax) + protected function _storeNameLong($index, $type, $rowmin, $rowmax, $colmin, $colmax) { $record = 0x0018; // Record identifier $length = 0x003d; // Number of bytes to follow @@ -1269,7 +1269,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storeCountry() + protected function _storeCountry() { $record = 0x008C; // Record identifier $length = 4; // Number of bytes to follow @@ -1285,7 +1285,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _storePalette() + protected function _storePalette() { $aref = $this->_palette; @@ -1315,7 +1315,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri * * @access private */ - function _calculateSharedStringsSizes() + protected function _calculateSharedStringsSizes() { /* Iterate through the strings to calculate the CONTINUE block sizes. 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 */ - function _storeSharedStringsTable() + protected function _storeSharedStringsTable() { $record = 0x00fc; // Record identifier $length = 0x0008; // Number of bytes to follow diff --git a/Spreadsheet/Excel/Writer/Worksheet.php b/Spreadsheet/Excel/Writer/Worksheet.php index 2cbf9b0..1ff4947 100644 --- a/Spreadsheet/Excel/Writer/Worksheet.php +++ b/Spreadsheet/Excel/Writer/Worksheet.php @@ -49,329 +49,329 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * Name of the Worksheet * @var string */ - var $name; + public $name; /** * Index for the Worksheet * @var integer */ - var $index; + public $index; /** * Reference to the (default) Format object for URLs * @var object Format */ - var $_url_format; + public $_url_format; /** * Reference to the parser used for parsing formulas * @var object Format */ - var $_parser; + public $_parser; /** * Filehandle to the temporary file for storing data * @var resource */ - var $_filehandle; + public $_filehandle; /** * Boolean indicating if we are using a temporary file for storing data * @var bool */ - var $_using_tmpfile; + public $_using_tmpfile; /** * Maximum number of rows for an Excel spreadsheet (BIFF5) * @var integer */ - var $_xls_rowmax; + public $_xls_rowmax; /** * Maximum number of columns for an Excel spreadsheet (BIFF5) * @var integer */ - var $_xls_colmax; + public $_xls_colmax; /** * Maximum number of characters for a string (LABEL record in BIFF5) * @var integer */ - var $_xls_strmax; + public $_xls_strmax; /** * First row for the DIMENSIONS record * @var integer * @see _storeDimensions() */ - var $_dim_rowmin; + public $_dim_rowmin; /** * Last row for the DIMENSIONS record * @var integer * @see _storeDimensions() */ - var $_dim_rowmax; + public $_dim_rowmax; /** * First column for the DIMENSIONS record * @var integer * @see _storeDimensions() */ - var $_dim_colmin; + public $_dim_colmin; /** * Last column for the DIMENSIONS record * @var integer * @see _storeDimensions() */ - var $_dim_colmax; + public $_dim_colmax; /** * Array containing format information for columns * @var array */ - var $_colinfo; + public $_colinfo; /** * Array containing the selected area for the worksheet * @var array */ - var $_selection; + public $_selection; /** * Array containing the panes for the worksheet * @var array */ - var $_panes; + public $_panes; /** * The active pane for the worksheet * @var integer */ - var $_active_pane; + public $_active_pane; /** * Bit specifying if panes are frozen * @var integer */ - var $_frozen; + public $_frozen; /** * Bit specifying if the worksheet is selected * @var integer */ - var $selected; + public $selected; /** * The paper size (for printing) (DOCUMENT!!!) * @var integer */ - var $_paper_size; + public $_paper_size; /** * Bit specifying paper orientation (for printing). 0 => landscape, 1 => portrait * @var integer */ - var $_orientation; + public $_orientation; /** * The page header caption * @var string */ - var $_header; + public $_header; /** * The page footer caption * @var string */ - var $_footer; + public $_footer; /** * The horizontal centering value for the page * @var integer */ - var $_hcenter; + public $_hcenter; /** * The vertical centering value for the page * @var integer */ - var $_vcenter; + public $_vcenter; /** * The margin for the header * @var float */ - var $_margin_head; + public $_margin_head; /** * The margin for the footer * @var float */ - var $_margin_foot; + public $_margin_foot; /** * The left margin for the worksheet in inches * @var float */ - var $_margin_left; + public $_margin_left; /** * The right margin for the worksheet in inches * @var float */ - var $_margin_right; + public $_margin_right; /** * The top margin for the worksheet in inches * @var float */ - var $_margin_top; + public $_margin_top; /** * The bottom margin for the worksheet in inches * @var float */ - var $_margin_bottom; + public $_margin_bottom; /** * First row to reapeat on each printed page * @var integer */ - var $title_rowmin; + public $title_rowmin; /** * Last row to reapeat on each printed page * @var integer */ - var $title_rowmax; + public $title_rowmax; /** * First column to reapeat on each printed page * @var integer */ - var $title_colmin; + public $title_colmin; /** * First row of the area to print * @var integer */ - var $print_rowmin; + public $print_rowmin; /** * Last row to of the area to print * @var integer */ - var $print_rowmax; + public $print_rowmax; /** * First column of the area to print * @var integer */ - var $print_colmin; + public $print_colmin; /** * Last column of the area to print * @var integer */ - var $print_colmax; + public $print_colmax; /** * Whether to display RightToLeft. * @var integer */ - var $_Arabic; + public $_Arabic; /** * Whether to use outline. * @var integer */ - var $_outline_on; + public $_outline_on; /** * Auto outline styles. * @var bool */ - var $_outline_style; + public $_outline_style; /** * Whether to have outline summary below. * @var bool */ - var $_outline_below; + public $_outline_below; /** * Whether to have outline summary at the right. * @var bool */ - var $_outline_right; + public $_outline_right; /** * Outline row level. * @var integer */ - var $_outline_row_level; + public $_outline_row_level; /** * Whether to fit to page when printing or not. * @var bool */ - var $_fit_page; + public $_fit_page; /** * Number of pages to fit wide * @var integer */ - var $_fit_width; + public $_fit_width; /** * Number of pages to fit high * @var integer */ - var $_fit_height; + public $_fit_height; /** * Reference to the total number of strings in the workbook * @var integer */ - var $_str_total; + public $_str_total; /** * Reference to the number of unique strings in the workbook * @var integer */ - var $_str_unique; + public $_str_unique; /** * Reference to the array containing all the unique strings in the workbook * @var array */ - var $_str_table; + public $_str_table; /** * Number of merged cell ranges in actual record * @var int $_merged_cells_counter */ - var $_merged_cells_counter = 0; + public $_merged_cells_counter = 0; /** * Number of actual mergedcells record * @var int $_merged_cells_record */ - var $_merged_cells_record = 0; + public $_merged_cells_record = 0; /** * Merged cell ranges * @var array */ - var $_merged_ranges; + public $_merged_ranges; /** * Charset encoding currently used when calling writeString() * @var string */ - var $_input_encoding; + public $_input_encoding; /** * Constructor @@ -385,7 +385,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param string $tmp_dir The path to the directory for temporary files * @access private */ - function Spreadsheet_Excel_Writer_Worksheet($BIFF_version, $name, + public function Spreadsheet_Excel_Writer_Worksheet($BIFF_version, $name, $index, &$activesheet, &$firstsheet, &$str_total, &$str_unique, &$str_table, @@ -495,7 +495,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _initialize() + protected function _initialize() { if ($this->_using_tmpfile == false) { return; @@ -535,7 +535,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param array $sheetnames The array of sheetnames from the Workbook this * worksheet belongs to */ - function close($sheetnames) + public function close($sheetnames) { $num_sheets = count($sheetnames); @@ -664,7 +664,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @return string The worksheet's name */ - function getName() + public function getName() { return $this->name; } @@ -675,7 +675,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @return string The data */ - function getData() + public function getData() { $buffer = 4096; @@ -709,7 +709,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $last_row Last row of the area to merge * @param integer $last_col Last column of the area to merge */ - function setMerge($first_row, $first_col, $last_row, $last_col) + public function setMerge($first_row, $first_col, $last_row, $last_col) { if (($last_row < $first_row) || ($last_col < $first_col)) { return; @@ -734,7 +734,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access public */ - function select() + public function select() { $this->selected = 1; } @@ -746,7 +746,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access public */ - function activate() + public function activate() { $this->selected = 1; $this->activesheet = $this->index; @@ -759,7 +759,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access public */ - function setFirstSheet() + public function setFirstSheet() { $this->firstsheet = $this->index; } @@ -772,7 +772,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param string $password The password to use for protecting the sheet. */ - function protect($password) + public function protect($password) { $this->_protect = 1; $this->_password = $this->_encodePassword($password); @@ -789,7 +789,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $hidden The optional hidden atribute * @param integer $level The optional outline level */ - function setColumn($firstcol, $lastcol, $width, $format = null, $hidden = 0, $level = 0) + public function setColumn($firstcol, $lastcol, $width, $format = null, $hidden = 0, $level = 0) { // added by Dan Lynn _colinfo as $key => $colinfo) @@ -834,7 +834,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $last_row last row in the selected quadrant * @param integer $last_column last column in the selected quadrant */ - function setSelection($first_row,$first_column,$last_row,$last_column) + public function setSelection($first_row,$first_column,$last_row,$last_column) { $this->_selection = array($first_row,$first_column,$last_row,$last_column); } @@ -850,7 +850,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * 3 => Leftmost column visible * 4 => Active pane */ - function freezePanes($panes) + public function freezePanes($panes) { $this->_frozen = 1; $this->_panes = $panes; @@ -867,7 +867,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * 3 => Leftmost column visible * 4 => Active pane */ - function thawPanes($panes) + public function thawPanes($panes) { $this->_frozen = 0; $this->_panes = $panes; @@ -878,7 +878,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access public */ - function setPortrait() + public function setPortrait() { $this->_orientation = 1; } @@ -888,7 +888,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access public */ - function setLandscape() + public function setLandscape() { $this->_orientation = 0; } @@ -899,7 +899,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param integer $size The type of paper size to use */ - function setPaper($size = 0) + public function setPaper($size = 0) { $this->_paper_size = $size; } @@ -912,7 +912,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param string $string The header text * @param float $margin optional head margin in inches. */ - function setHeader($string,$margin = 0.50) + public function setHeader($string,$margin = 0.50) { if (strlen($string) >= 255) { //carp 'Header string must be less than 255 characters'; @@ -929,7 +929,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param string $string The footer text * @param float $margin optional foot margin in inches. */ - function setFooter($string,$margin = 0.50) + public function setFooter($string,$margin = 0.50) { if (strlen($string) >= 255) { //carp 'Footer string must be less than 255 characters'; @@ -945,7 +945,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param integer $center the optional value for centering. Defaults to 1 (center). */ - function centerHorizontally($center = 1) + public function centerHorizontally($center = 1) { $this->_hcenter = $center; } @@ -956,7 +956,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param integer $center the optional value for centering. Defaults to 1 (center). */ - function centerVertically($center = 1) + public function centerVertically($center = 1) { $this->_vcenter = $center; } @@ -967,7 +967,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param float $margin The margin to set in inches */ - function setMargins($margin) + public function setMargins($margin) { $this->setMarginLeft($margin); $this->setMarginRight($margin); @@ -981,7 +981,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param float $margin The margin to set in inches */ - function setMargins_LR($margin) + public function setMargins_LR($margin) { $this->setMarginLeft($margin); $this->setMarginRight($margin); @@ -993,7 +993,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param float $margin The margin to set in inches */ - function setMargins_TB($margin) + public function setMargins_TB($margin) { $this->setMarginTop($margin); $this->setMarginBottom($margin); @@ -1005,7 +1005,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param float $margin The margin to set in inches */ - function setMarginLeft($margin = 0.75) + public function setMarginLeft($margin = 0.75) { $this->_margin_left = $margin; } @@ -1016,7 +1016,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param float $margin The margin to set in inches */ - function setMarginRight($margin = 0.75) + public function setMarginRight($margin = 0.75) { $this->_margin_right = $margin; } @@ -1027,7 +1027,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param float $margin The margin to set in inches */ - function setMarginTop($margin = 1.00) + public function setMarginTop($margin = 1.00) { $this->_margin_top = $margin; } @@ -1038,7 +1038,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param float $margin The margin to set in inches */ - function setMarginBottom($margin = 1.00) + public function setMarginBottom($margin = 1.00) { $this->_margin_bottom = $margin; } @@ -1050,7 +1050,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $first_row First row to repeat * @param integer $last_row Last row to repeat. Optional. */ - function repeatRows($first_row, $last_row = null) + public function repeatRows($first_row, $last_row = null) { $this->title_rowmin = $first_row; if (isset($last_row)) { //Second row is optional @@ -1067,7 +1067,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $first_col First column to repeat * @param integer $last_col Last column to repeat. Optional. */ - function repeatColumns($first_col, $last_col = null) + public function repeatColumns($first_col, $last_col = null) { $this->title_colmin = $first_col; if (isset($last_col)) { // Second col is optional @@ -1086,7 +1086,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $last_row Last row of the area to print * @param integer $last_col Last column of the area to print */ - function printArea($first_row, $first_col, $last_row, $last_col) + public function printArea($first_row, $first_col, $last_row, $last_col) { $this->print_rowmin = $first_row; $this->print_colmin = $first_col; @@ -1100,7 +1100,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access public */ - function hideGridlines() + public function hideGridlines() { $this->_print_gridlines = 0; } @@ -1110,7 +1110,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access public */ - function hideScreenGridlines() + public function hideScreenGridlines() { $this->_screen_gridlines = 0; } @@ -1121,7 +1121,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param integer $print Whether to print the headers or not. Defaults to 1 (print). */ - function printRowColHeaders($print = 1) + public function printRowColHeaders($print = 1) { $this->_print_headers = $print; } @@ -1135,7 +1135,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $height Maximun heigth of printed area in pages * @see setPrintScale() */ - function fitToPages($width, $height) + public function fitToPages($width, $height) { $this->_fit_page = 1; $this->_fit_width = $width; @@ -1149,7 +1149,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param array $breaks Array containing the horizontal page breaks */ - function setHPagebreaks($breaks) + public function setHPagebreaks($breaks) { foreach ($breaks as $break) { array_push($this->_hbreaks, $break); @@ -1163,7 +1163,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param array $breaks Array containing the vertical page breaks */ - function setVPagebreaks($breaks) + public function setVPagebreaks($breaks) { foreach ($breaks as $break) { array_push($this->_vbreaks, $break); @@ -1177,7 +1177,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param integer $scale The zoom factor */ - function setZoom($scale = 100) + public function setZoom($scale = 100) { // Confine the scale to Excel's range if ($scale < 10 || $scale > 400) { @@ -1195,7 +1195,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param integer $scale The optional scale factor. Defaults to 100 */ - function setPrintScale($scale = 100) + public function setPrintScale($scale = 100) { // Confine the scale to Excel's range if ($scale < 10 || $scale > 400) { @@ -1218,7 +1218,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param mixed $token What we are writing * @param mixed $format The optional format to apply to the cell */ - function write($row, $col, $token, $format = null) + public function write($row, $col, $token, $format = null) { // Check for a cell reference in A1 notation and substitute row and column /*if ($_[0] =~ /^\D/) { @@ -1260,7 +1260,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @return mixed PEAR_Error on failure */ - function writeRow($row, $col, $val, $format = null) + public function writeRow($row, $col, $val, $format = null) { $retval = ''; if (is_array($val)) { @@ -1289,7 +1289,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @return mixed PEAR_Error on failure */ - function writeCol($row, $col, $val, $format = null) + public function writeCol($row, $col, $val, $format = null) { $retval = ''; if (is_array($val)) { @@ -1310,7 +1310,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param mixed &$format The optional XF format * @return integer The XF record index */ - function _XF(&$format) + protected function _XF(&$format) { if ($format) { return($format->getXfIndex()); @@ -1334,7 +1334,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access private * @param string $data The binary data to append */ - function _append($data) + protected function _append($data) { if ($this->_using_tmpfile) { // Add CONTINUE records if necessary @@ -1358,7 +1358,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param string $cell The cell reference. Or range of cells. * @return array */ - function _substituteCellref($cell) + protected function _substituteCellref($cell) { $cell = strtoupper($cell); @@ -1394,7 +1394,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param string $cell The cell reference. * @return array containing (row, column) */ - function _cellToRowcol($cell) + protected function _cellToRowcol($cell) { preg_match("/\$?([A-I]?[A-Z])\$?(\d+)/",$cell,$match); $col = $match[1]; @@ -1425,7 +1425,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param string $plaintext The password to be encoded in plaintext. * @return string The encoded password */ - function _encodePassword($plaintext) + protected function _encodePassword($plaintext) { $password = 0x0000; $i = 1; // char position @@ -1455,7 +1455,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param bool $symbols_right * @param bool $auto_style */ - function setOutline($visible = true, $symbols_below = true, $symbols_right = true, $auto_style = false) + public function setOutline($visible = true, $symbols_below = true, $symbols_right = true, $auto_style = false) { $this->_outline_on = $visible; $this->_outline_below = $symbols_below; @@ -1473,7 +1473,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @param bool $rtl */ - function setRTL($rtl = true) + public function setRTL($rtl = true) { $this->_Arabic = ($rtl ? 1 : 0); } @@ -1500,7 +1500,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param mixed $format The optional XF format * @return integer */ - function writeNumber($row, $col, $num, $format = null) + public function writeNumber($row, $col, $num, $format = null) { $record = 0x0203; // Record identifier $length = 0x000E; // Number of bytes to follow @@ -1553,7 +1553,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param mixed $format The XF format for the cell * @return integer */ - function writeString($row, $col, $str, $format = null) + public function writeString($row, $col, $str, $format = null) { if ($this->_BIFF_version == 0x0600) { return $this->writeStringBIFF8($row, $col, $str, $format); @@ -1604,7 +1604,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access public * @param string $encoding The encoding. Ex: 'UTF-16LE', 'utf-8', 'ISO-859-7' */ - function setInputEncoding($encoding) + public function setInputEncoding($encoding) { if ($encoding != 'UTF-16LE' && !function_exists('iconv')) { $this->raiseError("Using an input encoding other than UTF-16LE requires PHP support for iconv"); @@ -1627,7 +1627,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param mixed $format The XF format for the cell * @return integer */ - function writeStringBIFF8($row, $col, $str, $format = null) + public function writeStringBIFF8($row, $col, $str, $format = null) { // If the string is Unicode and contains any "surrogate pairs" then using mb_strlen($str, 'UTF-16LE') // as the string length will cause a "found unreadable content" error when opening the worksheet in Excel @@ -1685,7 +1685,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @return boolean true for success, false if row and/or col are grester * then maximums allowed. */ - function _checkRowCol($row, $col) + protected function _checkRowCol($row, $col) { if ($row >= $this->_xls_rowmax) { return false; @@ -1717,7 +1717,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $col Zero indexed column * @param string $note The note to write */ - function writeNote($row, $col, $note) + public function writeNote($row, $col, $note) { $note_length = strlen($note); $record = 0x001C; // Record identifier @@ -1777,7 +1777,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $col Zero indexed column * @param mixed $format The XF format */ - function writeBlank($row, $col, $format) + public function writeBlank($row, $col, $format) { // Don't write a blank cell unless it has a format if (!$format) { @@ -1830,7 +1830,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param mixed $format The optional XF format * @return integer */ - function writeFormula($row, $col, $formula, $format = null) + public function writeFormula($row, $col, $formula, $format = null) { $record = 0x0006; // Record identifier @@ -1908,7 +1908,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param mixed $format The cell format * @return integer */ - function writeUrl($row, $col, $url, $string = '', $format = null) + public function writeUrl($row, $col, $url, $string = '', $format = null) { // Add start row and col to arg list return($this->_writeUrlRange($row, $col, $row, $col, $url, $string, $format)); @@ -1916,7 +1916,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr /** * This is the more general form of writeUrl(). It allows a hyperlink to be - * written to a range of cells. This function also decides the type of hyperlink + * written to a range of cells. This public function also decides the type of hyperlink * to be written. These are either, Web (http, ftp, mailto), Internal * (Sheet1!A1) or external ('c:\temp\foo.xls#Sheet1!A1'). * @@ -1932,7 +1932,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @return integer */ - function _writeUrlRange($row1, $col1, $row2, $col2, $url, $string = '', $format = null) + protected function _writeUrlRange($row1, $col1, $row2, $col2, $url, $string = '', $format = null) { // Check for internal/external sheet links or default to web link @@ -1962,7 +1962,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param mixed $format The cell format * @return integer */ - function _writeUrlWeb($row1, $col1, $row2, $col2, $url, $str, $format = null) + protected function _writeUrlWeb($row1, $col1, $row2, $col2, $url, $str, $format = null) { $record = 0x01B8; // Record identifier $length = 0x00000; // Bytes to follow @@ -2022,7 +2022,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param mixed $format The cell format * @return integer */ - function _writeUrlInternal($row1, $col1, $row2, $col2, $url, $str, $format = null) + protected function _writeUrlInternal($row1, $col1, $row2, $col2, $url, $str, $format = null) { $record = 0x01B8; // Record identifier $length = 0x00000; // Bytes to follow @@ -2088,7 +2088,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param mixed $format The cell format * @return integer */ - function _writeUrlExternal($row1, $col1, $row2, $col2, $url, $str, $format = null) + protected function _writeUrlExternal($row1, $col1, $row2, $col2, $url, $str, $format = null) { // Network drives are different. We will handle them separately // MS/Novell network drives and shares start with \\ @@ -2218,7 +2218,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param bool $hidden The optional hidden attribute * @param integer $level The optional outline level for row, in range [0,7] */ - function setRow($row, $height, $format = null, $hidden = false, $level = 0) + public function setRow($row, $height, $format = null, $hidden = false, $level = 0) { $record = 0x0208; // Record identifier $length = 0x0010; // Number of bytes to follow @@ -2271,7 +2271,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeDimensions() + protected function _storeDimensions() { $record = 0x0200; // Record identifier $row_min = $this->_dim_rowmin; // First row @@ -2298,7 +2298,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeWindow2() + protected function _storeWindow2() { $record = 0x023E; // Record identifier if ($this->_BIFF_version == 0x0500) { @@ -2357,7 +2357,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeDefcol() + protected function _storeDefcol() { $record = 0x0055; // Record identifier $length = 0x0002; // Number of bytes to follow @@ -2383,7 +2383,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * 4 => Option flags. * 5 => Optional outline level */ - function _storeColinfo($col_array) + protected function _storeColinfo($col_array) { if (isset($col_array[0])) { $colFirst = $col_array[0]; @@ -2436,7 +2436,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param array $array array containing ($rwFirst,$colFirst,$rwLast,$colLast) * @see setSelection() */ - function _storeSelection($array) + protected function _storeSelection($array) { list($rwFirst,$colFirst,$rwLast,$colLast) = $array; $record = 0x001D; // Record identifier @@ -2477,7 +2477,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeMergedCells() + protected function _storeMergedCells() { // if there are no merged cell ranges set, return if (count($this->_merged_ranges) == 0) { @@ -2509,7 +2509,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access private * @param integer $count The number of external sheet references in this worksheet */ - function _storeExterncount($count) + protected function _storeExterncount($count) { $record = 0x0016; // Record identifier $length = 0x0002; // Number of bytes to follow @@ -2528,7 +2528,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @access private * @param string $sheetname The name of a external worksheet */ - function _storeExternsheet($sheetname) + protected function _storeExternsheet($sheetname) { $record = 0x0017; // Record identifier @@ -2565,7 +2565,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * 3 => Leftmost column visible * 4 => Active pane */ - function _storePanes($panes) + protected function _storePanes($panes) { $y = $panes[0]; $x = $panes[1]; @@ -2637,7 +2637,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeSetup() + protected function _storeSetup() { $record = 0x00A1; // Record identifier $length = 0x0022; // Number of bytes to follow @@ -2698,7 +2698,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeHeader() + protected function _storeHeader() { $record = 0x0014; // Record identifier @@ -2726,7 +2726,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeFooter() + protected function _storeFooter() { $record = 0x0015; // Record identifier @@ -2754,7 +2754,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeHcenter() + protected function _storeHcenter() { $record = 0x0083; // Record identifier $length = 0x0002; // Bytes to follow @@ -2772,7 +2772,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeVcenter() + protected function _storeVcenter() { $record = 0x0084; // Record identifier $length = 0x0002; // Bytes to follow @@ -2789,7 +2789,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeMarginLeft() + protected function _storeMarginLeft() { $record = 0x0026; // Record identifier $length = 0x0008; // Bytes to follow @@ -2810,7 +2810,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeMarginRight() + protected function _storeMarginRight() { $record = 0x0027; // Record identifier $length = 0x0008; // Bytes to follow @@ -2831,7 +2831,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeMarginTop() + protected function _storeMarginTop() { $record = 0x0028; // Record identifier $length = 0x0008; // Bytes to follow @@ -2852,7 +2852,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeMarginBottom() + protected function _storeMarginBottom() { $record = 0x0029; // Record identifier $length = 0x0008; // Bytes to follow @@ -2879,7 +2879,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $last_row Last row of the area to merge * @param integer $last_col Last column of the area to merge */ - function mergeCells($first_row, $first_col, $last_row, $last_col) + public function mergeCells($first_row, $first_col, $last_row, $last_col) { $record = 0x00E5; // Record identifier $length = 0x000A; // Bytes to follow @@ -2906,7 +2906,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storePrintHeaders() + protected function _storePrintHeaders() { $record = 0x002a; // Record identifier $length = 0x0002; // Bytes to follow @@ -2924,7 +2924,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storePrintGridlines() + protected function _storePrintGridlines() { $record = 0x002b; // Record identifier $length = 0x0002; // Bytes to follow @@ -2942,7 +2942,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeGridset() + protected function _storeGridset() { $record = 0x0082; // Record identifier $length = 0x0002; // Bytes to follow @@ -2962,7 +2962,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @see _storeWsbool() * @access private */ - function _storeGuts() + protected function _storeGuts() { $record = 0x0080; // Record identifier $length = 0x0008; // Bytes to follow @@ -3007,7 +3007,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeWsbool() + protected function _storeWsbool() { $record = 0x0081; // Record identifier $length = 0x0002; // Bytes to follow @@ -3049,7 +3049,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeHbreak() + protected function _storeHbreak() { // Return if the user hasn't specified pagebreaks if (empty($this->_hbreaks)) { @@ -3092,7 +3092,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeVbreak() + protected function _storeVbreak() { // Return if the user hasn't specified pagebreaks if (empty($this->_vbreaks)) { @@ -3137,7 +3137,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeProtect() + protected function _storeProtect() { // Exit unless sheet protection has been specified if ($this->_protect == 0) { @@ -3160,7 +3160,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storePassword() + protected function _storePassword() { // Exit unless sheet protection and password have been specified if (($this->_protect == 0) || (!isset($this->_password))) { @@ -3191,7 +3191,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $scale_x The horizontal scale * @param integer $scale_y The vertical scale */ - function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) + public function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) { $bitmap_array = $this->_processBitmap($bitmap); if ($this->isError($bitmap_array)) { @@ -3243,7 +3243,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * The width and height of the cells are also variable and have to be taken into * account. * The values of $col_start and $row_start are passed in from the calling - * function. The values of $col_end and $row_end are calculated by subtracting + * public function. The values of $col_end and $row_end are calculated by subtracting * the width and height of the bitmap from the width and height of the * underlying cells. * The vertices are expressed as a percentage of the underlying cell width as @@ -3269,7 +3269,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $width Width of image frame * @param integer $height Height of image frame */ - function _positionImage($col_start, $row_start, $x1, $y1, $width, $height) + protected function _positionImage($col_start, $row_start, $x1, $y1, $width, $height) { // Initialise end cell to the same as the start cell $col_end = $col_start; // Col containing lower right corner of object @@ -3335,7 +3335,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $col The column * @return integer The width in pixels */ - function _sizeCol($col) + protected function _sizeCol($col) { // Look up the cell value to see if it has been changed if (isset($this->col_sizes[$col])) { @@ -3359,7 +3359,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $row The row * @return integer The width in pixels */ - function _sizeRow($row) + protected function _sizeRow($row) { // Look up the cell value to see if it has been changed if (isset($this->_row_sizes[$row])) { @@ -3387,7 +3387,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param integer $rwB Row containing bottom right corner of object * @param integer $dyB Distance from bottom of cell */ - function _storeObjPicture($colL,$dxL,$rwT,$dyT,$colR,$dxR,$rwB,$dyB) + protected function _storeObjPicture($colL,$dxL,$rwT,$dyT,$colR,$dxR,$rwB,$dyB) { $record = 0x005d; // Record identifier $length = 0x003c; // Bytes to follow @@ -3462,7 +3462,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * @param string $bitmap The bitmap to process * @return array Array with data and properties of the bitmap */ - function _processBitmap($bitmap) + protected function _processBitmap($bitmap) { // Open file. $bmp_fd = @fopen($bitmap,"rb"); @@ -3546,7 +3546,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeZoom() + protected function _storeZoom() { // If scale is 100 we don't need to write a record if ($this->_zoom == 100) { @@ -3564,7 +3564,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr /** * FIXME: add comments */ - function setValidation($row1, $col1, $row2, $col2, &$validator) + public function setValidation($row1, $col1, $row2, $col2, &$validator) { $this->_dv[] = $validator->_getData() . pack("vvvvv", 1, $row1, $row2, $col1, $col2); @@ -3575,7 +3575,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr * * @access private */ - function _storeDataValidity() + protected function _storeDataValidity() { $record = 0x01b2; // Record identifier $length = 0x0012; // Bytes to follow