mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-29 08:46:03 +03:00
Ensure that writers access the workbook rather than the global calculation engine
This commit is contained in:
parent
1e1a6ac361
commit
6f4cfcc8c6
@ -102,8 +102,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
||||
// Fetch sheet
|
||||
$sheet = $this->_phpExcel->getSheet($this->_sheetIndex);
|
||||
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance()->writeDebugLog;
|
||||
PHPExcel_Calculation::getInstance()->writeDebugLog = false;
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_phpExcel)->writeDebugLog;
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->writeDebugLog = FALSE;
|
||||
$saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
|
||||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
|
||||
|
||||
@ -139,7 +139,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
||||
fclose($fileHandle);
|
||||
|
||||
PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType);
|
||||
PHPExcel_Calculation::getInstance()->writeDebugLog = $saveDebugLog;
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->writeDebugLog = $saveDebugLog;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -179,8 +179,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance()->writeDebugLog;
|
||||
PHPExcel_Calculation::getInstance()->writeDebugLog = false;
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_spreadSheet)->writeDebugLog;
|
||||
PHPExcel_Calculation::getInstance($this->_spreadSheet)->writeDebugLog = false;
|
||||
$saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType();
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
|
||||
@ -341,7 +341,7 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
|
||||
}
|
||||
|
||||
PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType);
|
||||
PHPExcel_Calculation::getInstance()->writeDebugLog = $saveDebugLog;
|
||||
PHPExcel_Calculation::getInstance($this->_spreadSheet)->writeDebugLog = $saveDebugLog;
|
||||
|
||||
// Close file
|
||||
if ($objZip->close() === false) {
|
||||
|
@ -120,13 +120,13 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||
// garbage collect
|
||||
$this->_phpExcel->garbageCollect();
|
||||
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance()->writeDebugLog;
|
||||
PHPExcel_Calculation::getInstance()->writeDebugLog = false;
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_phpExcel)->writeDebugLog;
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->writeDebugLog = false;
|
||||
$saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType();
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
|
||||
// initialize colors array
|
||||
$this->_colors = array();
|
||||
$this->_colors = array();
|
||||
|
||||
// Initialise workbook writer
|
||||
$this->_writerWorkbook = new PHPExcel_Writer_Excel5_Workbook($this->_phpExcel,
|
||||
@ -226,7 +226,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
||||
$res = $root->save($pFilename);
|
||||
|
||||
PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType);
|
||||
PHPExcel_Calculation::getInstance()->writeDebugLog = $saveDebugLog;
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->writeDebugLog = $saveDebugLog;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -152,8 +152,8 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
// garbage collect
|
||||
$this->_phpExcel->garbageCollect();
|
||||
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance()->writeDebugLog;
|
||||
PHPExcel_Calculation::getInstance()->writeDebugLog = false;
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_phpExcel)->writeDebugLog;
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->writeDebugLog = false;
|
||||
$saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
|
||||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
|
||||
|
||||
@ -184,7 +184,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
fclose($fileHandle);
|
||||
|
||||
PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType);
|
||||
PHPExcel_Calculation::getInstance()->writeDebugLog = $saveDebugLog;
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->writeDebugLog = $saveDebugLog;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user