From d1c255193b6a5a67eecf8be8e0eaca38892781fb Mon Sep 17 00:00:00 2001 From: Xavier Noguer Gallego Date: Fri, 12 Dec 2003 21:05:02 +0000 Subject: [PATCH] adding setLocked() git-svn-id: https://svn.php.net/repository/pear/packages/Spreadsheet_Excel_Writer/trunk@146340 c90b9560-bf6c-de11-be94-00142212c4b1 --- Writer/Format.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Writer/Format.php b/Writer/Format.php index 872fc56..788d25b 100644 --- a/Writer/Format.php +++ b/Writer/Format.php @@ -270,7 +270,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR $this->_num_format = 0; $this->_hidden = 0; - $this->_locked = 1; + $this->_locked = 0; $this->_text_h_align = 0; $this->_text_wrap = 0; @@ -335,7 +335,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR $atr_pat = (($this->_fg_color != 0x40) || ($this->_bg_color != 0x41) || $this->_pattern)?1:0; - $atr_prot = 0; + $atr_prot = $this->_locked | $this->_hidden; // Zero the default border colour if the border has not been set. if ($this->_bottom == 0) { @@ -1000,6 +1000,16 @@ class Spreadsheet_Excel_Writer_Format extends PEAR $this->_font_script = $script; } + /** + * Locks a cell. + * + * @access public + */ + function setLocked() + { + $this->_locked = 1; + } + /** * Unlocks a cell. Useful for unprotecting particular cells of a protected sheet. *