Modified applyFromArray() method of PHPExcel_Style to use PHPExcel::cellXfExists() call instead of expensive hash test.
This commit is contained in:
parent
d1ee820c10
commit
91de8c54e4
|
@ -402,7 +402,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
|
|||
$newStyle = clone $style;
|
||||
$newStyle->applyFromArray($pStyles);
|
||||
|
||||
if ($existingStyle = $workbook->getCellXfByHashCode($newStyle->getHashCode())) {
|
||||
if ($workbook->cellXfExists($newStyle)) {
|
||||
// there is already such cell Xf in our collection
|
||||
$newXfIndexes[$oldXfIndex] = $existingStyle->getIndex();
|
||||
} else {
|
||||
|
|
|
@ -84,6 +84,8 @@ $aTests = array(
|
|||
, '34chartupdate.php'
|
||||
, '35chartrender.php'
|
||||
, '36chartreadwriteHTML.php'
|
||||
, '37page_layout_view.php'
|
||||
, '40duplicateStyle.php'
|
||||
, 'OOCalcReader.php'
|
||||
, 'SylkReader.php'
|
||||
, 'Excel2003XMLReader.php'
|
||||
|
|
|
@ -32,10 +32,11 @@ Fixed in develop branch:
|
|||
- General: (kea) Work item GH-69 - Improved AdvancedValueBinder for currency
|
||||
- General: (MBaker) Work items 17936 and 17840 - Fix for environments where there is no access to /tmp but to upload_tmp_dir
|
||||
Provided an option to set the sys_get_temp_dir() call to use the upload_tmp_dir; though by default the standard temp directory will still be used
|
||||
- General: (amironov ) Work item GH-84 - Search style by identity in PHPExcel_Worksheet::duplicateStyle()
|
||||
- Bugfix: (techhead) Work item GH-70 - Fixed formula/formatting bug when removing rows
|
||||
- Bugfix: (alexgann) Work item GH-63 - Fix to cellExists for non-existent namedRanges
|
||||
- Bugfix: (MBaker) Work item 18844 - cache_in_memory_gzip "eats" last worksheet line, cache_in_memory doesn't
|
||||
- Bugfix: (Progi1984)Work item GH-22 - Sheet View in Excel5 Writer
|
||||
- Bugfix: (Progi1984) Work item GH-22 - Sheet View in Excel5 Writer
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
BREAKING CHANGE! As part of the planned changes for handling array formulae in
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
class FileTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
public function testGetUseUploadTempDirectory()
|
||||
{
|
||||
$expectedResult = FALSE;
|
||||
|
||||
$result = call_user_func(array('PHPExcel_Shared_File','getUseUploadTempDirectory'));
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testSetUseUploadTempDirectory()
|
||||
{
|
||||
$useUploadTempDirectoryValues = array(
|
||||
TRUE,
|
||||
FALSE,
|
||||
);
|
||||
|
||||
foreach($useUploadTempDirectoryValues as $useUploadTempDirectoryValue) {
|
||||
call_user_func(array('PHPExcel_Shared_File','setUseUploadTempDirectory'),$useUploadTempDirectoryValue);
|
||||
|
||||
$result = call_user_func(array('PHPExcel_Shared_File','getUseUploadTempDirectory'));
|
||||
$this->assertEquals($useUploadTempDirectoryValue, $result);
|
||||
}
|
||||
}
|
||||
|
||||
public function testSysGetTempDir()
|
||||
{
|
||||
$expectedResult = 'C:\Users\Mark\AppData\Local\Temp';
|
||||
|
||||
$result = call_user_func(array('PHPExcel_Shared_File','sys_get_temp_dir'));
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testSysGetTempDirUpload()
|
||||
{
|
||||
$expectedResult = 'C:\xampp\tmp';
|
||||
|
||||
call_user_func(array('PHPExcel_Shared_File','setUseUploadTempDirectory'),TRUE);
|
||||
|
||||
$result = call_user_func(array('PHPExcel_Shared_File','sys_get_temp_dir'));
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue