~ubuntu-branches/ubuntu/jaunty/moodle/jaunty

« back to all changes in this revision

Viewing changes to lib/pear/Spreadsheet/Excel/Writer/Worksheet.php

  • Committer: Bazaar Package Importer
  • Author(s): Jordan Mantha, Matt Oquist
  • Date: 2009-02-25 15:16:22 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090225151622-0ekt1liwhv2obfza
Tags: 1.9.4.dfsg-0ubuntu1
* Merge with Debian git (Closes LP: #322961, #239481, #334611):
  - use Ubuntu's smarty lib directory for linking
  - use internal yui library 
  - add update-notifier support back in

[Matt Oquist]
  * renamed prerm script
  * significantly rewrote postinst and other maintainer scripts to improve
    user experience and package maintainability
    (Closes LP: #225662, #325450, #327843, #303078, #234609)

Show diffs side-by-side

added added

removed removed

Lines of Context:
728
728
    * @param integer $hidden   The optional hidden atribute
729
729
    * @param integer $level    The optional outline level
730
730
    */
731
 
    function setColumn($firstcol, $lastcol, $width, $format = 0, $hidden = 0, $level = 0)
 
731
    function setColumn($firstcol, $lastcol, $width, $format = null, $hidden = 0, $level = 0)
732
732
    {
733
733
        $this->_colinfo[] = array($firstcol, $lastcol, $width, &$format, $hidden, $level);
734
734
 
1133
1133
    * @param mixed   $token  What we are writing
1134
1134
    * @param mixed   $format The optional format to apply to the cell
1135
1135
    */
1136
 
    function write($row, $col, $token, $format = 0)
 
1136
    function write($row, $col, $token, $format = null)
1137
1137
    {
1138
1138
        // Check for a cell reference in A1 notation and substitute row and column
1139
1139
        /*if ($_[0] =~ /^\D/) {
1178
1178
    * @return mixed PEAR_Error on failure
1179
1179
    */
1180
1180
 
1181
 
    function writeRow($row, $col, $val, $format = 0)
 
1181
    function writeRow($row, $col, $val, $format = null)
1182
1182
    {
1183
1183
        $retval = '';
1184
1184
        if (is_array($val)) {
1207
1207
    * @return mixed PEAR_Error on failure
1208
1208
    */
1209
1209
 
1210
 
    function writeCol($row, $col, $val, $format=0)
 
1210
    function writeCol($row, $col, $val, $format = null)
1211
1211
    {
1212
1212
        $retval = '';
1213
1213
        if (is_array($val)) {
1230
1230
    */
1231
1231
    function _XF(&$format)
1232
1232
    {
1233
 
        if (is_object($format)) {
 
1233
        if ($format) {
1234
1234
            return($format->getXfIndex());
1235
1235
        } else {
1236
1236
            return(0x0F);
1408
1408
    * @param mixed   $format The optional XF format
1409
1409
    * @return integer
1410
1410
    */
1411
 
    function writeNumber($row, $col, $num, $format = 0)
 
1411
    function writeNumber($row, $col, $num, $format = null)
1412
1412
    {
1413
1413
        $record    = 0x0203;                 // Record identifier
1414
1414
        $length    = 0x000E;                 // Number of bytes to follow
1461
1461
    * @param mixed   $format The XF format for the cell
1462
1462
    * @return integer
1463
1463
    */
1464
 
    function writeString($row, $col, $str, $format = 0)
 
1464
    function writeString($row, $col, $str, $format = null)
1465
1465
    {
1466
1466
        if ($this->_BIFF_version == 0x0600) {
1467
1467
            return $this->writeStringBIFF8($row, $col, $str, $format);
1535
1535
    * @param mixed   $format The XF format for the cell
1536
1536
    * @return integer
1537
1537
    */
1538
 
    function writeStringBIFF8($row, $col, $str, $format = 0)
 
1538
    function writeStringBIFF8($row, $col, $str, $format = null)
1539
1539
    {
1540
1540
        if ($this->_input_encoding == 'UTF-16LE')
1541
1541
        {
1683
1683
    function writeBlank($row, $col, $format)
1684
1684
    {
1685
1685
        // Don't write a blank cell unless it has a format
1686
 
        if (!is_object($format)) {
 
1686
        if (!$format) {
1687
1687
            return(0);
1688
1688
        }
1689
1689
 
1733
1733
    * @param mixed   $format  The optional XF format
1734
1734
    * @return integer
1735
1735
    */
1736
 
    function writeFormula($row, $col, $formula, $format = 0)
 
1736
    function writeFormula($row, $col, $formula, $format = null)
1737
1737
    {
1738
1738
        $record    = 0x0006;     // Record identifier
1739
1739
 
1811
1811
    * @param mixed   $format The cell format
1812
1812
    * @return integer
1813
1813
    */
1814
 
    function writeUrl($row, $col, $url, $string = '', $format = 0)
 
1814
    function writeUrl($row, $col, $url, $string = '', $format = null)
1815
1815
    {
1816
1816
        // Add start row and col to arg list
1817
1817
        return($this->_writeUrlRange($row, $col, $row, $col, $url, $string, $format));
1835
1835
    * @return integer
1836
1836
    */
1837
1837
 
1838
 
    function _writeUrlRange($row1, $col1, $row2, $col2, $url, $string = '', $format = 0)
 
1838
    function _writeUrlRange($row1, $col1, $row2, $col2, $url, $string = '', $format = null)
1839
1839
    {
1840
1840
 
1841
1841
        // Check for internal/external sheet links or default to web link
1865
1865
    * @param mixed   $format The cell format
1866
1866
    * @return integer
1867
1867
    */
1868
 
    function _writeUrlWeb($row1, $col1, $row2, $col2, $url, $str, $format = 0)
 
1868
    function _writeUrlWeb($row1, $col1, $row2, $col2, $url, $str, $format = null)
1869
1869
    {
1870
1870
        $record      = 0x01B8;                       // Record identifier
1871
1871
        $length      = 0x00000;                      // Bytes to follow
1872
1872
 
1873
 
        if (!is_object($format)) {
 
1873
        if (!$format) {
1874
1874
            $format = $this->_url_format;
1875
1875
        }
1876
1876
 
1925
1925
    * @param mixed   $format The cell format
1926
1926
    * @return integer
1927
1927
    */
1928
 
    function _writeUrlInternal($row1, $col1, $row2, $col2, $url, $str, $format = 0)
 
1928
    function _writeUrlInternal($row1, $col1, $row2, $col2, $url, $str, $format = null)
1929
1929
    {
1930
1930
        $record      = 0x01B8;                       // Record identifier
1931
1931
        $length      = 0x00000;                      // Bytes to follow
1932
1932
 
1933
 
        if (!is_object($format)) {
 
1933
        if (!$format) {
1934
1934
            $format = $this->_url_format;
1935
1935
        }
1936
1936
 
1991
1991
    * @param mixed   $format The cell format
1992
1992
    * @return integer
1993
1993
    */
1994
 
    function _writeUrlExternal($row1, $col1, $row2, $col2, $url, $str, $format = 0)
 
1994
    function _writeUrlExternal($row1, $col1, $row2, $col2, $url, $str, $format = null)
1995
1995
    {
1996
1996
        // Network drives are different. We will handle them separately
1997
1997
        // MS/Novell network drives and shares start with \\
2002
2002
        $record      = 0x01B8;                       // Record identifier
2003
2003
        $length      = 0x00000;                      // Bytes to follow
2004
2004
    
2005
 
        if (!is_object($format)) {
 
2005
        if (!$format) {
2006
2006
            $format = $this->_url_format;
2007
2007
        }
2008
2008
    
2121
2121
    * @param bool    $hidden The optional hidden attribute
2122
2122
    * @param integer $level  The optional outline level for row, in range [0,7]
2123
2123
    */
2124
 
    function setRow($row, $height, $format = 0, $hidden = false, $level = 0)
 
2124
    function setRow($row, $height, $format = null, $hidden = false, $level = 0)
2125
2125
    {
2126
2126
        $record      = 0x0208;               // Record identifier
2127
2127
        $length      = 0x0010;               // Number of bytes to follow
2158
2158
            $grbit |= 0x0020;
2159
2159
        }
2160
2160
        $grbit |= 0x0040; // fUnsynced
2161
 
        if (is_object($format)) {
 
2161
        if ($format) {
2162
2162
            $grbit |= 0x0080;
2163
2163
        }
2164
2164
        $grbit |= 0x0100;