mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-30 01:06:03 +03:00
Allow cell value type attribute of "str" in Excel2007 xlsx files as a synonym for type of "s"
git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@65165 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
parent
5168f49b36
commit
5a5e920444
@ -232,6 +232,8 @@ class PHPExcel_Cell
|
|||||||
{
|
{
|
||||||
// set the value according to data type
|
// set the value according to data type
|
||||||
switch ($pDataType) {
|
switch ($pDataType) {
|
||||||
|
case PHPExcel_Cell_DataType::TYPE_STRING2:
|
||||||
|
$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
|
||||||
case PHPExcel_Cell_DataType::TYPE_STRING:
|
case PHPExcel_Cell_DataType::TYPE_STRING:
|
||||||
case PHPExcel_Cell_DataType::TYPE_NULL:
|
case PHPExcel_Cell_DataType::TYPE_NULL:
|
||||||
case PHPExcel_Cell_DataType::TYPE_INLINE:
|
case PHPExcel_Cell_DataType::TYPE_INLINE:
|
||||||
@ -343,6 +345,9 @@ class PHPExcel_Cell
|
|||||||
*/
|
*/
|
||||||
public function setDataType($pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
|
public function setDataType($pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
|
||||||
{
|
{
|
||||||
|
if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2)
|
||||||
|
$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
|
||||||
|
|
||||||
$this->_dataType = $pDataType;
|
$this->_dataType = $pDataType;
|
||||||
|
|
||||||
return $this->notifyCacheController();
|
return $this->notifyCacheController();
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
class PHPExcel_Cell_DataType
|
class PHPExcel_Cell_DataType
|
||||||
{
|
{
|
||||||
/* Data types */
|
/* Data types */
|
||||||
|
const TYPE_STRING2 = 'str';
|
||||||
const TYPE_STRING = 's';
|
const TYPE_STRING = 's';
|
||||||
const TYPE_FORMULA = 'f';
|
const TYPE_FORMULA = 'f';
|
||||||
const TYPE_NUMERIC = 'n';
|
const TYPE_NUMERIC = 'n';
|
||||||
|
@ -66,7 +66,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
|
|||||||
!isset($aFlippedStringTable[$cell->getValue()]) &&
|
!isset($aFlippedStringTable[$cell->getValue()]) &&
|
||||||
!is_null($cell->getValue()) &&
|
!is_null($cell->getValue()) &&
|
||||||
$cell->getValue() !== '' &&
|
$cell->getValue() !== '' &&
|
||||||
($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_NULL)
|
($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING2 || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_NULL)
|
||||||
) {
|
) {
|
||||||
$aStringTable[] = $cell->getValue();
|
$aStringTable[] = $cell->getValue();
|
||||||
$aFlippedStringTable[$cell->getValue()] = 1;
|
$aFlippedStringTable[$cell->getValue()] = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user