Forráskód Böngészése

Fix duplications on row

Paolo Libertini 6 éve
szülő
commit
1e0c53c8c5
1 módosított fájl, 5 hozzáadás és 1 törlés
  1. 5 1
      src/Parser/Excel2007.php

+ 5 - 1
src/Parser/Excel2007.php

@@ -107,6 +107,7 @@ class Excel2007 {
     private static $thousandSeparator = ',';
     private static $currencyCode = '';
     private static $runtimeInfo = ['GMPSupported' => false];
+    private $_sharedStrings = [];
 
     /**
      * Use ZipArchive reader to extract the relevant data streams from the ZipArchive file
@@ -280,9 +281,12 @@ class Excel2007 {
                 }
             } elseif ($name == 't' && $position == $this->sharedStringsPosition && $nodeType == \XMLReader::ELEMENT) {
                 $value .= trim($this->sharedStringsXML->readString());
+		$this->_sharedStrings[$position] = $value;
             }
         }
-
+	if(strlen($value) == 0 && array_key_exists($position, $this->_sharedStrings)){
+            $value .= $this->_sharedStrings[$position];
+        }
         return $value;
     }