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

Documentation generated on Sun, 27 Feb 2011 16:37:29 -0800 by phpDocumentor 1.4.3