Add consistency using getCellXML()
This commit is contained in:
parent
435a9a016e
commit
9dd4a56a64
@ -155,7 +155,7 @@ class Worksheet implements WorksheetInterface
|
|||||||
$currentCellValue !== $dataRowWithNumericIndexes[$nextCellIndex]) {
|
$currentCellValue !== $dataRowWithNumericIndexes[$nextCellIndex]) {
|
||||||
|
|
||||||
$numTimesValueRepeated = ($nextCellIndex - $currentCellIndex);
|
$numTimesValueRepeated = ($nextCellIndex - $currentCellIndex);
|
||||||
$data .= $this->getCellContent($currentCellValue, $styleIndex, $numTimesValueRepeated);
|
$data .= $this->getCellXML($currentCellValue, $styleIndex, $numTimesValueRepeated);
|
||||||
|
|
||||||
$currentCellIndex = $nextCellIndex;
|
$currentCellIndex = $nextCellIndex;
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@ class Worksheet implements WorksheetInterface
|
|||||||
* @return string The cell XML content
|
* @return string The cell XML content
|
||||||
* @throws \Box\Spout\Common\Exception\InvalidArgumentException If a cell value's type is not supported
|
* @throws \Box\Spout\Common\Exception\InvalidArgumentException If a cell value's type is not supported
|
||||||
*/
|
*/
|
||||||
protected function getCellContent($cellValue, $styleIndex, $numTimesValueRepeated)
|
protected function getCellXML($cellValue, $styleIndex, $numTimesValueRepeated)
|
||||||
{
|
{
|
||||||
$data = '<table:table-cell table:style-name="ce' . $styleIndex . '"';
|
$data = '<table:table-cell table:style-name="ce' . $styleIndex . '"';
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ EOD;
|
|||||||
$rowXML = '<row r="' . $rowIndex . '" spans="1:' . $numCells . '">';
|
$rowXML = '<row r="' . $rowIndex . '" spans="1:' . $numCells . '">';
|
||||||
|
|
||||||
foreach($dataRow as $cellValue) {
|
foreach($dataRow as $cellValue) {
|
||||||
$rowXML .= $this->getCellXml($rowIndex, $cellNumber, $cellValue, $style->getId());
|
$rowXML .= $this->getCellXML($rowIndex, $cellNumber, $cellValue, $style->getId());
|
||||||
$cellNumber++;
|
$cellNumber++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ EOD;
|
|||||||
* @return string
|
* @return string
|
||||||
* @throws InvalidArgumentException
|
* @throws InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
private function getCellXml($rowIndex, $cellNumber, $cellValue, $styleId)
|
private function getCellXML($rowIndex, $cellNumber, $cellValue, $styleId)
|
||||||
{
|
{
|
||||||
$columnIndex = CellHelper::getCellIndexFromColumnIndex($cellNumber);
|
$columnIndex = CellHelper::getCellIndexFromColumnIndex($cellNumber);
|
||||||
$cellXML = '<c r="' . $columnIndex . $rowIndex . '"';
|
$cellXML = '<c r="' . $columnIndex . $rowIndex . '"';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user