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

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