tstr = str_replace(''h'', ''H'', $formatstr);
//echo "ndate-time $formatstr n";
}
}
if ($isdate){
$this->formatRecords[''xfrecords''][] = array(
''type'' => ''date'',
''format'' => $formatstr,
);
}else{
$this->formatRecords[''xfrecords''][] = array(
''type'' => ''other'',
''format'' => '''',
''code'' => $indexCode
);
}
}
//echo "n";
break;
case SPREADSHEET_EXCEL_READER_TYPE_NINETEENFOUR:
//echo "Type.NINETEENFOURn";
$this->nineteenFour = (ord($this->data[$pos+4]) == 1);
break;
case SPREADSHEET_EXCEL_READER_TYPE_BOUNDSHEET:
//echo "Type.BOUNDSHEETn";
$rec_offset = $this->_GetInt4d($this->data, $pos+4);
$rec_typeFlag = ord($this->data[$pos+8]);
$rec_visibilityFlag = ord($this->data[$pos+9]);
$rec_length = ord($this->data[$pos+10]);
if ($version == SPREADSHEET_EXCEL_READER_BIFF8){
$chartype = ord($this->data[$pos+11]);
if ($chartype == 0){
$rec_name = substr($this->data, $pos+12, $rec_length);
} else {
$rec_name = $this->_encodeUTF16(substr($this->data, $pos+12, $rec_length*2));
}
}elseif ($version == SPREADSHEET_EXCEL_READER_BIFF7){
$rec_name = substr($this->data, $pos+11, $rec_length);
}
$this->boundsheets[] = array(''name''=>$rec_name,
''offset''=>$rec_offset);
break;
}
//echo "Code = ".base_convert($r[''code''],10,16)."n";
$pos += $length + 4;
$code = ord($this->data[$pos]) | ord($this->data[$pos+1])<<8;
$length = ord($this->data[$pos+2]) | ord($this->data[$pos+3])<<8;
//$r = &$this->nextRecord();
//echo "1 Code = ".base_convert($r[''code''],10,16)."n";
}
foreach ($this->boundsheets as $key=>$val){
$this->sn = $key;
$this->_parsesheet($val[''offset'']);
}
return true;
}
/**
* Parse a worksheet
*
* @access private
* @param todo
* @todo fix return codes
*/
function _parsesheet($spos)
{
$cont = true;
// read BOF
$code = ord($this->data[$spos]) | ord($this->data[$spos+1])<<8;
$length = ord($this->data[$spos+2]) | ord($this->data[$spos+3])<<8;
$version = ord($this->data[$spos + 4]) | ord($this->data[$spos + 5])<<8;
$substreamType = ord($this->data[$spos + 6]) | ord($this->data[$spos + 7])<<8;
if (($version != SPREADSHEET_EXCEL_READER_BIFF8) && ($version != SPREADSHEET_EXCEL_READER_BIFF7)) {
return -1;
}
if ($substreamType != SPREADSHEET_EXCEL_READER_WORKSHEET){
return -2;
}
//echo "Start parse code=".base_convert($code,10,16)." version=".base_convert($version,10,16)." substreamType=".base_convert($substreamType,10,16).""."n";
$spos += $length + 4;
//var_dump($this->formatRecords);
//echo "code $code $length";
while($cont) {
//echo "mem= ".memory_get_usage()."n";
// $r = &$this->file->nextRecord();
$lowcode = ord($this->data[$spos]);
if ($lowcode == SPREADSHEET_EXCEL_READER_TYPE_EOF) break;
$code = $lowcode | ord($this->data[$spos+1])<<8;
$length = ord($this->data[$spos+2]) | ord($this->data[$spos+3])<<8;
$spos += 4;
$this->sheets[$this->sn][''maxrow''] = $this-&