PHPExcel_Writer_Excel5
[ class tree: PHPExcel_Writer_Excel5 ] [ index: PHPExcel_Writer_Excel5 ] [ all elements ]

Source for file Xf.php

Documentation is available at Xf.php

  1. <?php
  2. /**
  3.  * PHPExcel
  4.  *
  5.  * Copyright (c) 2006 - 2009 PHPExcel
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2.1 of the License, or (at your option) any later version.
  11.  *
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the Free Software
  19.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  20.  *
  21.  * @category   PHPExcel
  22.  * @package    PHPExcel_Writer_Excel5
  23.  * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    1.7.0, 2009-08-10
  26.  */
  27.  
  28. // Original file header of PEAR::Spreadsheet_Excel_Writer_Format (used as the base for this class):
  29. // -----------------------------------------------------------------------------------------
  30. // /*
  31. // *  Module written/ported by Xavier Noguer <xnoguer@rezebra.com>
  32. // *
  33. // *  The majority of this is _NOT_ my code.  I simply ported it from the
  34. // *  PERL Spreadsheet::WriteExcel module.
  35. // *
  36. // *  The author of the Spreadsheet::WriteExcel module is John McNamara 
  37. // *  <jmcnamara@cpan.org>
  38. // *
  39. // *  I _DO_ maintain this code, and John McNamara has nothing to do with the
  40. // *  porting of this code to PHP.  Any questions directly related to this
  41. // *  class library should be directed to me.
  42. // *
  43. // *  License Information:
  44. // *
  45. // *    Spreadsheet_Excel_Writer:  A library for generating Excel Spreadsheets
  46. // *    Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com
  47. // *
  48. // *    This library is free software; you can redistribute it and/or
  49. // *    modify it under the terms of the GNU Lesser General Public
  50. // *    License as published by the Free Software Foundation; either
  51. // *    version 2.1 of the License, or (at your option) any later version.
  52. // *
  53. // *    This library is distributed in the hope that it will be useful,
  54. // *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  55. // *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  56. // *    Lesser General Public License for more details.
  57. // *
  58. // *    You should have received a copy of the GNU Lesser General Public
  59. // *    License along with this library; if not, write to the Free Software
  60. // *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  61. // */
  62.  
  63.  
  64. /** PHPExcel root directory */
  65. if (!defined('PHPEXCEL_ROOT')) {
  66.     /**
  67.      * @ignore
  68.      */
  69.     define('PHPEXCEL_ROOT'dirname(__FILE__'/../../../');
  70. }
  71.  
  72. /** PHPExcel_Style_Alignment */
  73. require_once PHPEXCEL_ROOT 'PHPExcel/Style/Alignment.php';
  74.  
  75. /** PHPExcel_Style_Border */
  76. require_once PHPEXCEL_ROOT 'PHPExcel/Style/Border.php';
  77.  
  78. /** PHPExcel_Style_Fill */
  79. require_once PHPEXCEL_ROOT 'PHPExcel/Style/Fill.php';
  80.  
  81. /** PHPExcel_Style_Protection */
  82. require_once PHPEXCEL_ROOT 'PHPExcel/Style/Protection.php';
  83.  
  84.  
  85. /**
  86.  * PHPExcel_Writer_Excel5_Xf
  87.  *
  88.  * @category   PHPExcel
  89.  * @package    PHPExcel_Writer_Excel5
  90.  * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
  91.  */
  92. {
  93.     /**
  94.      * BIFF version
  95.      *
  96.      * @var int 
  97.      */
  98.     private $_BIFFVersion;
  99.  
  100.     /**
  101.      * Style XF or a cell XF ?
  102.      *
  103.      * @var boolean 
  104.      */
  105.     private $_isStyleXf;
  106.  
  107.     /**
  108.      * Index to the FONT record. Index 4 does not exist
  109.      * @var integer 
  110.      */
  111.     private $_fontIndex;
  112.  
  113.     /**
  114.      * An index (2 bytes) to a FORMAT record (number format).
  115.      * @var integer 
  116.      */
  117.     var $_numberFormatIndex;
  118.  
  119.     /**
  120.      * 1 bit, apparently not used.
  121.      * @var integer 
  122.      */
  123.     var $_text_justlast;
  124.  
  125.     /**
  126.      * The cell's foreground color.
  127.      * @var integer 
  128.      */
  129.     var $_fg_color;
  130.  
  131.     /**
  132.      * The cell's background color.
  133.      * @var integer 
  134.      */
  135.     var $_bg_color;
  136.  
  137.     /**
  138.      * Color of the bottom border of the cell.
  139.      * @var integer 
  140.      */
  141.     var $_bottom_color;
  142.  
  143.     /**
  144.      * Color of the top border of the cell.
  145.      * @var integer 
  146.      */
  147.     var $_top_color;
  148.  
  149.     /**
  150.     * Color of the left border of the cell.
  151.     * @var integer 
  152.     */
  153.     var $_left_color;
  154.  
  155.     /**
  156.      * Color of the right border of the cell.
  157.      * @var integer 
  158.      */
  159.     var $_right_color;
  160.  
  161.     /**
  162.      * Constructor
  163.      *
  164.      * @access private
  165.      * @param integer $index the XF index for the format.
  166.      * @param PHPExcel_Style 
  167.      */
  168.     public function __construct(PHPExcel_Style $style null)
  169.     {
  170.         $this->_isStyleXf =     false;
  171.         $this->_BIFFVersion   = 0x0600;
  172.         $this->_fontIndex      = 0;
  173.  
  174.         $this->_numberFormatIndex     = 0;
  175.  
  176.         $this->_text_justlast  = 0;
  177.  
  178.         $this->_fg_color       = 0x40;
  179.         $this->_bg_color       = 0x41;
  180.  
  181.         $this->_diag           0;
  182.  
  183.         $this->_bottom_color   = 0x40;
  184.         $this->_top_color      = 0x40;
  185.         $this->_left_color     = 0x40;
  186.         $this->_right_color    = 0x40;
  187.         $this->_diag_color     0x40;
  188.         $this->_style $style;
  189.  
  190.     }
  191.  
  192.  
  193.     /**
  194.      * Generate an Excel BIFF XF record (style or cell).
  195.      *
  196.      * @param string $style The type of the XF record ('style' or 'cell').
  197.      * @return string The XF record
  198.      */
  199.     function writeXf()
  200.     {
  201.         // Set the type of the XF record and some of the attributes.
  202.         if ($this->_isStyleXf{
  203.             $style 0xFFF5;
  204.         else {
  205.             $style   $this->_mapLocked($this->_style->getProtection()->getLocked());
  206.             $style  |= $this->_mapHidden($this->_style->getProtection()->getHidden()) << 1;
  207.         }
  208.  
  209.         // Flags to indicate if attributes have been set.
  210.         $atr_num     ($this->_numberFormatIndex != 0)?1:0;
  211.         $atr_fnt     ($this->_fontIndex != 0)?1:0;
  212.         $atr_alc     ((int) $this->_style->getAlignment()->getWrapText())?1:0;
  213.         $atr_bdr     ($this->_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle())   ||
  214.                         $this->_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle())      ||
  215.                         $this->_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle())     ||
  216.                         $this->_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()))?1:0;
  217.         $atr_pat     (($this->_fg_color != 0x40||
  218.                         ($this->_bg_color != 0x41||
  219.                         $this->_mapFillType($this->_style->getFill()->getFillType()))?1:0;
  220.         $atr_prot    $this->_mapLocked($this->_style->getProtection()->getLocked())
  221.                         | $this->_mapHidden($this->_style->getProtection()->getHidden());
  222.  
  223.         // Zero the default border colour if the border has not been set.
  224.         if ($this->_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) == 0{
  225.             $this->_bottom_color = 0;
  226.         }
  227.         if ($this->_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle())  == 0{
  228.             $this->_top_color = 0;
  229.         }
  230.         if ($this->_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) == 0{
  231.             $this->_right_color = 0;
  232.         }
  233.         if ($this->_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) == 0{
  234.             $this->_left_color = 0;
  235.         }
  236.         if ($this->_diag == 0{
  237.             $this->_diag_color 0;
  238.         }
  239.  
  240.         $record         0x00E0;              // Record identifier
  241.         if ($this->_BIFFVersion == 0x0500{
  242.             $length         0x0010;              // Number of bytes to follow
  243.         }
  244.         if ($this->_BIFFVersion == 0x0600{
  245.             $length         0x0014;
  246.         }
  247.  
  248.         $ifnt           $this->_fontIndex;   // Index to FONT record
  249.         $ifmt           $this->_numberFormatIndex;  // Index to FORMAT record
  250.         if ($this->_BIFFVersion == 0x0500{
  251.             $align          $this->_mapHAlign($this->_style->getAlignment()->getHorizontal());       // Alignment
  252.             $align         |= (int) $this->_style->getAlignment()->getWrapText()     << 3;
  253.             $align         |= $this->_mapVAlign($this->_style->getAlignment()->getVertical())  << 4;
  254.             $align         |= $this->_text_justlast << 7;
  255.             $align         |= 0                       << 8// rotation
  256.             $align         |= $atr_num                << 10;
  257.             $align         |= $atr_fnt                << 11;
  258.             $align         |= $atr_alc                << 12;
  259.             $align         |= $atr_bdr                << 13;
  260.             $align         |= $atr_pat                << 14;
  261.             $align         |= $atr_prot               << 15;
  262.  
  263.             $icv            $this->_fg_color;       // fg and bg pattern colors
  264.             $icv           |= $this->_bg_color      << 7;
  265.  
  266.             $fill           $this->_mapFillType($this->_style->getFill()->getFillType());        // Fill and border line style
  267.             $fill          |= $this->_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle())        << 6;
  268.             $fill          |= $this->_bottom_color  << 9;
  269.  
  270.             $border1        $this->_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle());            // Border line style and color
  271.             $border1       |= $this->_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle())          << 3;
  272.             $border1       |= $this->_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle())         << 6;
  273.             $border1       |= $this->_top_color     << 9;
  274.  
  275.             $border2        $this->_left_color;     // Border color
  276.             $border2       |= $this->_right_color   << 7;
  277.  
  278.             $header      pack("vv",       $record$length);
  279.             $data        pack("vvvvvvvv"$ifnt$ifmt$style$align,
  280.                                             $icv$fill,
  281.                                             $border1$border2);
  282.         elseif ($this->_BIFFVersion == 0x0600{
  283.             $align          $this->_mapHAlign($this->_style->getAlignment()->getHorizontal());       // Alignment
  284.             $align         |= (int) $this->_style->getAlignment()->getWrapText()     << 3;
  285.             $align         |= $this->_mapVAlign($this->_style->getAlignment()->getVertical())  << 4;
  286.             $align         |= $this->_text_justlast << 7;
  287.  
  288.             $used_attrib    $atr_num              << 2;
  289.             $used_attrib   |= $atr_fnt              << 3;
  290.             $used_attrib   |= $atr_alc              << 4;
  291.             $used_attrib   |= $atr_bdr              << 5;
  292.             $used_attrib   |= $atr_pat              << 6;
  293.             $used_attrib   |= $atr_prot             << 7;
  294.  
  295.             $icv            $this->_fg_color;      // fg and bg pattern colors
  296.             $icv           |= $this->_bg_color      << 7;
  297.  
  298.             $border1        $this->_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle());          // Border line style and color
  299.             $border1       |= $this->_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle())         << 4;
  300.             $border1       |= $this->_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle())           << 8;
  301.             $border1       |= $this->_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle())        << 12;
  302.             $border1       |= $this->_left_color    << 16;
  303.             $border1       |= $this->_right_color   << 23;
  304.             $diag_tl_to_rb 0;
  305.             $diag_tr_to_lb 0;
  306.             $border1       |= $diag_tl_to_rb        << 30;
  307.             $border1       |= $diag_tr_to_lb        << 31;
  308.  
  309.             $border2        $this->_top_color;    // Border color
  310.             $border2       |= $this->_bottom_color   << 7;
  311.             $border2       |= $this->_diag_color     << 14;
  312.             $border2       |= $this->_diag           << 21;
  313.             $border2       |= $this->_mapFillType($this->_style->getFill()->getFillType())        << 26;
  314.  
  315.             $header      pack("vv",       $record$length);
  316.  
  317.             //BIFF8 options: identation, shrinkToFit and  text direction
  318.             $biff8_options  $this->_style->getAlignment()->getIndent();
  319.             $biff8_options |= (int) $this->_style->getAlignment()->getShrinkToFit(<< 4;
  320.  
  321.             $data  pack("vvvC"$ifnt$ifmt$style$align);
  322.             $data .= pack("CCC"
  323.                 $this->_mapTextRotation($this->_style->getAlignment()->getTextRotation())
  324.                 $biff8_options
  325.                 $used_attrib
  326.                 );
  327.             $data .= pack("VVv"$border1$border2$icv);
  328.         }
  329.  
  330.         return($header $data);
  331.     }
  332.  
  333.     /**
  334.      * Set BIFF version
  335.      *
  336.      * @param int $BIFFVersion 
  337.      */
  338.     public function setBIFFVersion($BIFFVersion)
  339.     {
  340.         $this->_BIFFVersion = $BIFFVersion;
  341.     }
  342.  
  343.     /**
  344.      * Is this a style XF ?
  345.      *
  346.      * @param boolean $value 
  347.      */
  348.     public function setIsStyleXf($value)
  349.     {
  350.         $this->_isStyleXf = $value;
  351.     }
  352.  
  353.     /**
  354.      * Sets the cell's bottom border color
  355.      *
  356.      * @access public
  357.      * @param int $colorIndex Color index
  358.      */
  359.     function setBottomColor($colorIndex)
  360.     {
  361.         $this->_bottom_color = $colorIndex;
  362.     }
  363.  
  364.     /**
  365.      * Sets the cell's top border color
  366.      *
  367.      * @access public
  368.      * @param int $colorIndex Color index
  369.      */
  370.     function setTopColor($colorIndex)
  371.     {
  372.         $this->_top_color = $colorIndex;
  373.     }
  374.  
  375.     /**
  376.      * Sets the cell's left border color
  377.      *
  378.      * @access public
  379.      * @param int $colorIndex Color index
  380.      */
  381.     function setLeftColor($colorIndex)
  382.     {
  383.         $this->_left_color = $colorIndex;
  384.     }
  385.  
  386.     /**
  387.      * Sets the cell's right border color
  388.      *
  389.      * @access public
  390.      * @param int $colorIndex Color index
  391.      */
  392.     function setRightColor($colorIndex)
  393.     {
  394.         $this->_right_color = $colorIndex;
  395.     }
  396.  
  397.  
  398.     /**
  399.      * Sets the cell's foreground color
  400.      *
  401.      * @access public
  402.      * @param int $colorIndex Color index
  403.      */
  404.     function setFgColor($colorIndex)
  405.     {
  406.         $this->_fg_color = $colorIndex;
  407.     }
  408.  
  409.     /**
  410.      * Sets the cell's background color
  411.      *
  412.      * @access public
  413.      * @param int $colorIndex Color index
  414.      */
  415.     function setBgColor($colorIndex)
  416.     {
  417.         $this->_bg_color = $colorIndex;
  418.     }
  419.  
  420.     /**
  421.      * Sets the index to the number format record
  422.      * It can be date, time, currency, etc...
  423.      *
  424.      * @access public
  425.      * @param integer $numberFormatIndex Index to format record
  426.      */
  427.     function setNumberFormatIndex($numberFormatIndex)
  428.     {
  429.         $this->_numberFormatIndex = $numberFormatIndex;
  430.     }
  431.  
  432.     /**
  433.      * Set the font index.
  434.      *
  435.      * @param int $value Font index, note that value 4 does not exist
  436.      */
  437.     public function setFontIndex($value)
  438.     {
  439.         $this->_fontIndex = $value;
  440.     }
  441.  
  442.     /**
  443.      * Map border style
  444.      */
  445.     private function _mapBorderStyle($borderStyle{
  446.         switch ($borderStyle{
  447.             case PHPExcel_Style_Border::BORDER_NONE:                return 0x00;
  448.             case PHPExcel_Style_Border::BORDER_THIN;                return 0x01;
  449.             case PHPExcel_Style_Border::BORDER_MEDIUM;                return 0x02;
  450.             case PHPExcel_Style_Border::BORDER_DASHED;                return 0x03;
  451.             case PHPExcel_Style_Border::BORDER_DOTTED;                return 0x04;
  452.             case PHPExcel_Style_Border::BORDER_THICK;                return 0x05;
  453.             case PHPExcel_Style_Border::BORDER_DOUBLE;                return 0x06;
  454.             case PHPExcel_Style_Border::BORDER_HAIR;                return 0x07;
  455.             case PHPExcel_Style_Border::BORDER_MEDIUMDASHED;        return 0x08;
  456.             case PHPExcel_Style_Border::BORDER_DASHDOT;                return 0x09;
  457.             case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT;        return 0x0A;
  458.             case PHPExcel_Style_Border::BORDER_DASHDOTDOT;            return 0x0B;
  459.             case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT;    return 0x0C;
  460.             case PHPExcel_Style_Border::BORDER_SLANTDASHDOT;        return 0x0D;
  461.             default:                                                return 0x00;
  462.         }
  463.     }
  464.  
  465.     /**
  466.      * Map fill type
  467.      */
  468.     private function _mapFillType($fillType{
  469.         switch ($fillType{
  470.             case PHPExcel_Style_Fill::FILL_NONE:                    return 0x00;
  471.             case PHPExcel_Style_Fill::FILL_SOLID:                    return 0x01;
  472.             case PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY:        return 0x02;
  473.             case PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY:        return 0x03;
  474.             case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY:        return 0x04;
  475.             case PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL:    return 0x05;
  476.             case PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL:    return 0x06;
  477.             case PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN:        return 0x07;
  478.             case PHPExcel_Style_Fill::FILL_PATTERN_DARKUP:            return 0x08;
  479.             case PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID:        return 0x09;
  480.             case PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS:        return 0x0A;
  481.             case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL:    return 0x0B;
  482.             case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL:    return 0x0C;
  483.             case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN:        return 0x0D;
  484.             case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP:            return 0x0E;
  485.             case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID:        return 0x0F;
  486.             case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS:    return 0x10;
  487.             case PHPExcel_Style_Fill::FILL_PATTERN_GRAY125:            return 0x11;
  488.             case PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625:        return 0x12;
  489.             case PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR:        // does not exist in BIFF8
  490.             case PHPExcel_Style_Fill::FILL_GRADIENT_PATH:        // does not exist in BIFF8
  491.             default:                                                return 0x00;
  492.         }
  493.     }
  494.  
  495.     /**
  496.      * Map to BIFF2-BIFF8 codes for horizontal alignment
  497.      *
  498.      * @param string $hAlign 
  499.      * @return int 
  500.      */
  501.     private function _mapHAlign($hAlign)
  502.     {
  503.         switch ($hAlign{
  504.             case PHPExcel_Style_Alignment::HORIZONTAL_GENERAL:                return 0;
  505.             case PHPExcel_Style_Alignment::HORIZONTAL_LEFT:                    return 1;
  506.             case PHPExcel_Style_Alignment::HORIZONTAL_CENTER:                return 2;
  507.             case PHPExcel_Style_Alignment::HORIZONTAL_RIGHT:                return 3;
  508.             case PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY:                return 5;
  509.             case PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS:    return 6;
  510.             default:                                                        return 0;
  511.         }
  512.     }
  513.  
  514.     /**
  515.      * Map to BIFF2-BIFF8 codes for vertical alignment
  516.      *
  517.      * @param string $vAlign 
  518.      * @return int 
  519.      */
  520.     private function _mapVAlign($vAlign{
  521.         switch ($vAlign{
  522.             case PHPExcel_Style_Alignment::VERTICAL_TOP:        return 0;
  523.             case PHPExcel_Style_Alignment::VERTICAL_CENTER:        return 1;
  524.             case PHPExcel_Style_Alignment::VERTICAL_BOTTOM:        return 2;
  525.             case PHPExcel_Style_Alignment::VERTICAL_JUSTIFY:    return 3;
  526.             default:                                            return 2;
  527.         }
  528.     }
  529.  
  530.     /**
  531.      * Map to BIFF8 codes for text rotation angle
  532.      *
  533.      * @param int $textRotation 
  534.      * @return int 
  535.      */
  536.     private function _mapTextRotation($textRotation{
  537.         if ($textRotation >= 0{
  538.             return $textRotation;
  539.         }
  540.         if ($textRotation == -165{
  541.             return 255;
  542.         }
  543.         if ($textRotation 0{
  544.             return 90 $textRotation;
  545.         }
  546.     }
  547.  
  548.     /**
  549.      * Map locked
  550.      *
  551.      * @param string 
  552.      * @return int 
  553.      */
  554.     private function _mapLocked($locked{
  555.         switch ($locked{
  556.             case PHPExcel_Style_Protection::PROTECTION_INHERIT:        return 1;
  557.             case PHPExcel_Style_Protection::PROTECTION_PROTECTED:    return 1;
  558.             case PHPExcel_Style_Protection::PROTECTION_UNPROTECTED:    return 0;
  559.             default:                                                return 1;
  560.         }
  561.     }
  562.  
  563.     /**
  564.      * Map hidden
  565.      *
  566.      * @param string 
  567.      * @return int 
  568.      */
  569.     private function _mapHidden($hidden{
  570.         switch ($hidden{
  571.             case PHPExcel_Style_Protection::PROTECTION_INHERIT:        return 0;
  572.             case PHPExcel_Style_Protection::PROTECTION_PROTECTED:    return 1;
  573.             case PHPExcel_Style_Protection::PROTECTION_UNPROTECTED:    return 0;
  574.             default:                                                return 0;
  575.         }
  576.     }
  577.  
  578. }

Documentation generated on Mon, 10 Aug 2009 08:12:03 +0200 by phpDocumentor 1.4.1